Constructor and Description |
---|
TypeFactory(Elements elementUtils,
Types typeUtils,
FormattingMessager messager,
RoundContext roundContext,
Map<String,String> notToBeImportedTypes) |
Modifier and Type | Method and Description |
---|---|
Type |
asCollectionOrMap(Type collectionOrMap)
Converts any collection type, e.g.
|
BuilderType |
builderTypeFor(Type type,
org.mapstruct.ap.internal.prism.BuilderPrism builderPrism) |
Type |
classTypeOf(Type type)
Returns the Type that represents the declared Class type of the given type.
|
Type |
createVoidType()
creates a void return type
|
Type |
effectiveResultTypeFor(Type type,
org.mapstruct.ap.internal.prism.BuilderPrism builderPrism) |
TypeMirror |
getMethodType(DeclaredType includingType,
Element method)
Get the Type for given method as part of usedMapper.
|
ExecutableType |
getMethodType(DeclaredType includingType,
ExecutableElement method)
Get the ExecutableType for given method as part of usedMapper.
|
List<Parameter> |
getParameters(DeclaredType includingType,
Accessor accessor) |
List<Parameter> |
getParameters(ExecutableType methodType,
ExecutableElement method) |
Type |
getReturnType(DeclaredType includingType,
Accessor accessor) |
Type |
getReturnType(ExecutableType method) |
Parameter |
getSingleParameter(DeclaredType includingType,
Accessor method) |
List<Type> |
getThrownTypes(Accessor accessor) |
List<Type> |
getThrownTypes(ExecutableType 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
|
Type |
getTypeForLiteral(Class<?> type) |
Type |
getWrappedType(Type type) |
boolean |
isTypeAvailable(String canonicalName)
Determines if the type with the given full qualified name is part of the classpath
|
public TypeFactory(Elements elementUtils, Types typeUtils, FormattingMessager messager, RoundContext roundContext, Map<String,String> notToBeImportedTypes)
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(DeclaredType includingType, ExecutableElement method)
ExecutableElement
directly.includingType
- the type on which's scope the method type shall be evaluatedmethod
- the methodpublic TypeMirror getMethodType(DeclaredType includingType, Element method)
includingType
- the type on which's scope the method type shall be evaluatedmethod
- the methodpublic Parameter getSingleParameter(DeclaredType includingType, Accessor method)
public List<Parameter> getParameters(DeclaredType includingType, Accessor accessor)
public List<Parameter> getParameters(ExecutableType methodType, ExecutableElement method)
public Type getReturnType(DeclaredType includingType, Accessor accessor)
public Type getReturnType(ExecutableType 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 Type createVoidType()
public TypeMirror getTypeBound(TypeMirror typeMirror)
<? extends Number>
, returns Number<? super Number>
, returns Number<?>
, returns Object<T extends Number>, returns Number
typeMirror
- the type to return the bound forpublic BuilderType builderTypeFor(Type type, org.mapstruct.ap.internal.prism.BuilderPrism builderPrism)
public Type effectiveResultTypeFor(Type type, org.mapstruct.ap.internal.prism.BuilderPrism builderPrism)
Copyright © 2012-2019 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.