java.lang.Object
org.microbean.lang.Lang
A utility class for working with the
javax.lang.model.* packages at runtime.- Author:
- Laird Nelson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classATypeAndElementSourceimplementation that is alsoConstable. -
Method Summary
Modifier and TypeMethodDescriptionstatic final Set<? extends ModuleElement> static final ArrayTypestatic final ArrayTypestatic final ArrayTypearrayTypeOf(TypeMirror componentType) static final booleanassignable(TypeMirror payload, TypeMirror receiver) Returnstrueif and only if a bearer of the suppliedpayloadis assignable to a bearer of the suppliedreceiver.static final Namestatic final TypeMirrorbox(TypeMirror t) static final TypeElementstatic final booleanstatic final booleanstatic final TypeMirrorstatic final booleanstatic final booleancontains(TypeMirror t, TypeMirror s) static final DeclaredTypedeclaredType(CharSequence canonicalName) static final DeclaredTypedeclaredType(Class<?> c) static final DeclaredTypestatic final DeclaredTypedeclaredType(TypeElement typeElement, TypeMirror... typeArguments) static final DeclaredTypedeclaredType(DeclaredType containingType, TypeElement typeElement, TypeMirror... typeArguments) static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Stringstatic final List<? extends TypeMirror> static final Elementstatic final Stringstatic final TypeMirrorstatic final ExecutableElementexecutableElement(Constructor<?> c) static final ExecutableElementstatic final ExecutableElementstatic final ExecutableElementexecutableElement(TypeElement declaringClass, CharSequence name, List<? extends TypeMirror> parameterTypes) static final ExecutableElementexecutableElement(TypeElement declaringClass, CharSequence name, TypeMirror... parameterTypes) static final ExecutableElementexecutableElement(TypeElement declaringClass, List<? extends TypeMirror> parameterTypes) static final ExecutableElementexecutableElement(TypeElement declaringClass, TypeMirror... parameterTypes) static final ExecutableTypestatic final booleanstatic final booleanstatic final voidAsynchronously and idempotently initializes theLangclass for use.static final Stringstatic final TypeMirrormemberOf(DeclaredType t, Element e) modifiers(long modifiers) static final longstatic final longstatic final ModuleElementmoduleElement(CharSequence moduleName) static final ModuleElementmoduleElement(Class<?> c) static final ModuleElementmoduleElement(Module module) static final ModuleElementstatic final Namename(CharSequence name) static final NoTypestatic final NullTypenullType()static final Elements.Originstatic final PackageElementpackageElement(CharSequence fullyQualifiedName) static final PackageElementpackageElement(Class<?> c) static final PackageElementpackageElement(Module module, Package pkg) static final PackageElementpackageElement(Package pkg) static final PackageElementpackageElement(ModuleElement moduleElement, CharSequence fullyQualifiedName) static final PackageElementpackageElement(ModuleElement moduleElement, Package pkg) static final PackageElementstatic final Parameterizablestatic final PrimitiveTypeprimitiveType(Class<?> c) static final PrimitiveTypestatic final booleansameType(TypeMirror t, TypeMirror s) static final booleanstatic final booleansubtype(TypeMirror payload, TypeMirror receiver) static final TypeMirrorstatic final TypeMirrorstatic final TypeAndElementSourceReturns aTypeAndElementSourcebacked by relevantstaticmethods in this class.static final List<? extends TypeMirror> static final TypeElementtypeElement(CharSequence canonicalName) static final TypeElementtypeElement(Class<?> c) static final TypeElementtypeElement(ModuleElement moduleElement, CharSequence canonicalName) static final TypeParameterElementtypeParameterElement(GenericDeclaration gd, String name) static final TypeParameterElementstatic final Stringstatic final TypeVariabletypeVariable(GenericDeclaration gd, String name) static final TypeVariabletypeVariable(TypeVariable<?> t) static final TypeMirrorunbox(TypeMirror t) static final PrimitiveTypestatic final <E extends Element>
Eunwrap(E e) static final TypeMirror[]unwrap(TypeMirror[] ts) static final <T extends TypeMirror>
Tunwrap(T t) static final VariableElementstatic final VariableElementvariableElement(ExecutableElement declaringExecutable, int position) static final VariableElementvariableElement(ExecutableElement declaringExecutable, CharSequence parameterName) static final VariableElementvariableElement(TypeElement declaringClass, CharSequence fieldName) static final WildcardTypestatic final WildcardTypestatic final WildcardTypewildcardType(TypeMirror extendsBound, TypeMirror superBound) static final <E extends Element>
Ewrap(E e) static final <T extends TypeMirror>
Twrap(T t) wrapElements(Collection<? extends Element> es) static final List<? extends TypeMirror> wrapTypes(Collection<? extends TypeMirror> ts)
-
Method Details
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
describeConstable
-
allModuleElements
-
binaryName
-
functionalInterface
-
generic
-
capture
-
contains
-
element
-
memberOf
-
box
-
unbox
-
boxedClass
-
bridge
-
compactConstructor
-
canonicalConstructor
-
unboxedType
-
elementSignature
-
typeSignature
-
descriptor
-
jvmBinaryName
-
directSupertypes
-
subsignature
-
erasure
-
typeAndElementSource
Returns aTypeAndElementSourcebacked by relevantstaticmethods in this class.- Returns:
- a
TypeAndElementSource; nevernull - See Also:
-
modifiers
-
modifiers
-
modifiers
-
moduleElement
-
moduleElement
-
moduleElement
-
moduleOf
-
name
-
origin
-
packageElement
-
packageElement
-
packageElement
-
packageElement
-
packageElement
-
packageElement
public static final PackageElement packageElement(ModuleElement moduleElement, CharSequence fullyQualifiedName) -
packageOf
-
arrayType
-
arrayType
-
arrayTypeOf
-
declaredType
-
declaredType
-
declaredType
-
declaredType
-
declaredType
public static final DeclaredType declaredType(DeclaredType containingType, TypeElement typeElement, TypeMirror... typeArguments) -
typeArguments
-
executableElement
-
executableElement
-
executableElement
-
executableElement
public static final ExecutableElement executableElement(TypeElement declaringClass, List<? extends TypeMirror> parameterTypes) -
executableElement
public static final ExecutableElement executableElement(TypeElement declaringClass, TypeMirror... parameterTypes) -
executableElement
public static final ExecutableElement executableElement(TypeElement declaringClass, CharSequence name, List<? extends TypeMirror> parameterTypes) -
executableElement
public static final ExecutableElement executableElement(TypeElement declaringClass, CharSequence name, TypeMirror... parameterTypes) -
executableType
-
noType
-
nullType
-
primitiveType
-
primitiveType
-
sameType
-
typeElement
-
typeElement
-
typeElement
public static final TypeElement typeElement(ModuleElement moduleElement, CharSequence canonicalName) -
parameterizable
-
typeParameterElement
-
typeParameterElement
-
typeVariable
-
typeVariable
-
variableElement
-
variableElement
public static final VariableElement variableElement(TypeElement declaringClass, CharSequence fieldName) -
variableElement
public static final VariableElement variableElement(ExecutableElement declaringExecutable, CharSequence parameterName) -
variableElement
public static final VariableElement variableElement(ExecutableElement declaringExecutable, int position) -
wildcardType
-
wildcardType
-
wildcardType
-
assignable
Returnstrueif and only if a bearer of the suppliedpayloadis assignable to a bearer of the suppliedreceiver.- Parameters:
payload- a type borne by the "right hand side" of a potential assignment; must not benullreceiver- a type borne by the "left hand side" of a potential assignment; must not benull- Returns:
trueif and only if a bearer of the suppliedpayloadis assignable to a bearer of the suppliedreceiver- Throws:
NullPointerException- if any argument isnull- See Also:
-
subtype
-
type
-
type
-
initialize
public static final void initialize()Asynchronously and idempotently initializes theLangclass for use.This method is automatically called by the internals of this class when appropriate, but is
publicto support eager initialization use cases. -
unwrap
-
unwrap
-
unwrap
-
wrap
-
wrap
-
wrapTypes
-
wrapElements
-