TypeGuesser

Type guesser for JavaPoet

License

License

Categories

Categories

JavaPoet Application Layer Libs Code Generators
GroupId

GroupId

de.xn--ho-hia.javapoet
ArtifactId

ArtifactId

javapoet-type-guesser
Last Version

Last Version

2017.03.19-185842
Release Date

Release Date

Type

Type

jar
Description

Description

TypeGuesser
Type guesser for JavaPoet
Project URL

Project URL

https://seb.xn--ho-hia.de/javapoet-type-guesser
Project Organization

Project Organization

metio.wtf
Source Code Management

Source Code Management

https://github.com/sebhoss/javapoet-type-guesser

Download javapoet-type-guesser

How to add to project

<!-- https://jarcasting.com/artifacts/de.xn--ho-hia.javapoet/javapoet-type-guesser/ -->
<dependency>
    <groupId>de.xn--ho-hia.javapoet</groupId>
    <artifactId>javapoet-type-guesser</artifactId>
    <version>2017.03.19-185842</version>
</dependency>
// https://jarcasting.com/artifacts/de.xn--ho-hia.javapoet/javapoet-type-guesser/
implementation 'de.xn--ho-hia.javapoet:javapoet-type-guesser:2017.03.19-185842'
// https://jarcasting.com/artifacts/de.xn--ho-hia.javapoet/javapoet-type-guesser/
implementation ("de.xn--ho-hia.javapoet:javapoet-type-guesser:2017.03.19-185842")
'de.xn--ho-hia.javapoet:javapoet-type-guesser:jar:2017.03.19-185842'
<dependency org="de.xn--ho-hia.javapoet" name="javapoet-type-guesser" rev="2017.03.19-185842">
  <artifact name="javapoet-type-guesser" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.xn--ho-hia.javapoet', module='javapoet-type-guesser', version='2017.03.19-185842')
)
libraryDependencies += "de.xn--ho-hia.javapoet" % "javapoet-type-guesser" % "2017.03.19-185842"
[de.xn--ho-hia.javapoet/javapoet-type-guesser "2017.03.19-185842"]

Dependencies

compile (3)

Group / Artifact Type Version
com.squareup : javapoet jar
org.junit.platform : junit-platform-runner jar
org.eclipse.jdt : org.eclipse.jdt.annotation jar

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar
junit : junit jar

Project Modules

There are no modules declared in this project.

JavaPoet TypeGuesser Discuss on Google Groups Chat on IRC

CC Zero Maven Central Read JavaDocs Repository size Open Hub statistics

Build Status Code Coverage Technical Debt Codacy Code Quality Dependency Analysis Can this project be forked? Is this thing still maintained? Bounties on open tickets

Ever wanted to call ClassName.bestGuess("int") or ClassName.bestGuess("java.util.List<java.lang.Integer>")? This project provides an extension to JavaPoet that allows you to do just that. Simply replace the call to ClassName.bestGuess(String) with a call to TypeGuesser.guessTypeName(String) which is able to parse everything that ClassName can and additionally is fine with primitives, generics, wildcards and arrays.

Features

  • Guess everything that ClassName can guess

  • Guess primitives

  • Guess generic types

  • Support for wildcards

  • Support for array types

Development Status

All currently required features are implemented. This project is in maintenance mode. Take a look at the open tickets for ways to help out or create a new ticket yourself.

Usage

Use the TypeGuesser class as a replacement for ClassName like this:

import de.xn__ho_hia.javapoet.TypeGuesser;

TypeName guessedType = TypeGuesser.guessTypeName("...");

Take a look at the test cases for types that can and cannot be parsed by this project.

Integration

To use this project just declare the following dependency inside your POM:

<dependency>
  <groupId>de.xn--ho-hia.javapoet</groupId>
  <artifactId>javapoet-type-guesser</artifactId>
  <version>${version.javapoet-type-guesser}</version>
</dependency>

Replace ${version.javapoet-type-guesser} with the latest release. This project is continuously deployed and uses a date based versioning approach. I vow not to break any of its API ever, thus it is safe to use an open version range like (1.0.0,) as a replacement for ${version.javapoet-type-guesser}.

Compatibility

This project is compatible with the following Java versions:

Table 1. Java compatibility
X.Y.Z

Java 8

License

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.

Versions

Version
2017.03.19-185842
2017.03.19-165043
2017.03.19-134127
2017.03.19-132433
2017.03.19-115321
2017.03.19-102611
2017.03.19-094538
2017.03.19-020435