Constructor and Description |
---|
TypeFactory(Elements elementUtils,
Types typeUtils) |
Modifier and Type | Method and Description |
---|---|
Type |
asCollectionOrMap(Type collectionOrMap)
Converts any collection type, e.g.
|
Type |
classTypeOf(Type type)
Returns the Type that represents the declared Class type of the given type.
|
ExecutableType |
getMethodType(TypeElement includingType,
ExecutableElement method)
Get the ExecutableType for given method as part of usedMapper.
|
List<Parameter> |
getParameters(ExecutableType methodType,
ExecutableElement method) |
List<Parameter> |
getParameters(TypeElement includingType,
ExecutableElement method) |
Type |
getReturnType(ExecutableType method) |
Type |
getReturnType(TypeElement includingType,
ExecutableElement method) |
Parameter |
getSingleParameter(TypeElement includingType,
ExecutableElement method) |
List<Type> |
getThrownTypes(ExecutableType method) |
List<Type> |
getThrownTypes(TypeElement includingType,
ExecutableElement method) |
Type |
getType(Class<?> type) |
Type |
getType(String canonicalName) |
Type |
getType(TypeElement typeElement) |
Type |
getType(TypeMirror mirror) |
TypeMirror |
getTypeBound(TypeMirror typeMirror)
Establishes the type bound:
{@code
|
boolean |
isTypeAvailable(String canonicalName)
Determines if the type with the given full qualified name is part of the classpath
|
public boolean isTypeAvailable(String canonicalName)
canonicalName
- Name of the type to be checked for availabilitypublic Type getType(TypeElement typeElement)
public Type getType(TypeMirror mirror)
public Type classTypeOf(Type type)
java.lang.Integer
, it will return the type that represents Class<Integer>
.
int
, it will return the type that represents Class<Integer>
.type
- the type to return the declared class type forClass<type>
.public ExecutableType getMethodType(TypeElement includingType, ExecutableElement method)
includingType
- the type on which's scope the method type shall be evaluatedmethod
- the methodpublic Parameter getSingleParameter(TypeElement includingType, ExecutableElement method)
public List<Parameter> getParameters(TypeElement includingType, ExecutableElement method)
public List<Parameter> getParameters(ExecutableType methodType, ExecutableElement method)
public Type getReturnType(TypeElement includingType, ExecutableElement method)
public Type getReturnType(ExecutableType method)
public List<Type> getThrownTypes(TypeElement includingType, ExecutableElement method)
public List<Type> getThrownTypes(ExecutableType method)
public Type asCollectionOrMap(Type collectionOrMap)
List<T>
to Collection<T>
and any map type, e.g.
HashMap<K,V>
to Map<K,V>
.collectionOrMap
- any collection or map typeCollection<T>
or Map<K,V>
, if the argument type is a subtype of
Collection<T>
or of Map<K,V>
respectively.public TypeMirror getTypeBound(TypeMirror typeMirror)
typeMirror
- the type to return the bound forCopyright © 2012-2015 Gunnar Morling; All rights reserved. Released under the Apache Software License 2.0.