Interface Domain
- All Known Implementing Classes:
DefaultDomain
A domain is a set of valid Java constructs. A Domain
provides access to a domain and its members.
A Java construct is either a type or an element.
A type is a usage of a Java type, most commonly represented as a TypeMirror.
An element ia a declaration of a Java program element, most commonly represented as an
Element.
Domains impose constraints on the types and elements they contain, and on the kinds and semantics of operations that can be performed on them.
This interface is modeled on a deliberately restricted combination of the Elements
and Types interfaces.
Domain implementations must be thread-safe.
- Author:
- Laird Nelson
-
Method Summary
Modifier and TypeMethodDescriptionarrayTypeOf(TypeMirror componentType) asMemberOf(DeclaredType containingType, Element e) Returns a non-nullTypeMirrorrepresenting the type of the suppliedElementwhen thatElementis viewed as a member of, or otherwise directly contained by, the suppliedcontainingType.booleanassignable(TypeMirror payload, TypeMirror receiver) Returnstrueif and only if the suppliedpayload(the first argument) is considered assignable to the suppliedreceiver(the second argument) according to the rules of the Java Language Specification.booleanReturnstrueif and only if the suppliedExecutableElementrepresents a bridge method.capture(TypeMirror wildcard) booleancontains(TypeMirror candidateContainer, TypeMirror candidate) Returnstrueif and only ifcandidateContainercontainscandidate, according to the Java Language Specification, section 4.5.1.default DeclaredTypedeclaredType(CharSequence canonicalName) A convenience method that returns theDeclaredTypeof aTypeElementthat bears the suppliedcanonicalName, ornullif there is no suchTypeElement(and therefore no suchDeclaredType).declaredType(TypeElement typeElement, TypeMirror... typeArguments) Returns theDeclaredTypeof the suppliedTypeElementwith the suppliedTypeMirrorarguments (if any), yielding a parameterized type.declaredType(DeclaredType enclosingType, TypeElement typeElement, TypeMirror... typeArguments) Returns theDeclaredTypeof the suppliedTypeElementwith the suppliedTypeMirrorarguments (if any), given a containingDeclaredTypeof which it is a member, yielding a parameterized type.List<? extends TypeMirror> Returns a non-nullListof the direct supertypes of the suppliedTypeMirror, which is normally a declared type.Returns theElementresponsible for declaring the suppliedTypeMirror, which is most commonly aDeclaredType, aTypeVariable, aNoTypewith aTypeKindofTypeKind.MODULE, or aNoTypewith aTypeKindofTypeKind.PACKAGE, ornullif there is no suchElement.default TypeMirrorA convenience method that returns the element type of the suppliedTypeMirror.<T extends TypeMirror>
Terasure(T t) Returns the erasure of the suppliedTypeMirror.default ExecutableElementReturns anExecutableElementcorresponding to the suppliedExecutable.default ExecutableElementexecutableElement(TypeElement declaringElement, TypeMirror returnType, CharSequence name, TypeMirror... parameterTypes) A convenience method that returns anExecutableElementrepresenting the static initializer, constructor or method described by the supplied arguments, ornullif no suchExecutableElementexists.default booleanA convenience method that returnstrueif and only if the suppliedElementis generic.default booleanA convenience method that returnstrueif and only if the suppliedTypeMirroris declared by anElementthat is generic.default TypeElementA convenience method that returns theTypeElementrepresenting the class namedjava.lang.Object.default booleandefault booleanA convenience method that returnstrueif and only if the suppliedTypeMirrorrepresents theDeclaredTypedeclared by the (essentially primordial)java.lang.Objectelement.lock()Semantically locks an opaque lock used to serialize symbol completion, and returns it in the form of anUnlockable.moduleElement(CharSequence qualifiedName) Returns aModuleElementrepresenting the module named by the suppliedqualifiedName, ornullif there is no suchModuleElement.name(CharSequence name) Returns aNamerepresenting the suppliedCharSequence.Returns aNoTypebearing the suppliedTypeKind, if the suppliedTypeKindis eitherTypeKind.NONEorTypeKind.VOID.nullType()packageElement(CharSequence canonicalName) Returns aPackageElementrepresenting the package bearing the suppliedcanonicalName, ornullif there is no suchPackageElement.packageElement(ModuleElement asSeenFrom, CharSequence canonicalName) Returns aPackageElementrepresenting the package bearing the suppliedcanonicalNameas seen from the module represented by the suppliedModuleElement, ornullif there is no suchPackageElement.default ParameterizableReturns aParameterizablecorresponding to the supplied (reflective)GenericDeclaration.default booleanA convenience method that returnstrueif and only iftis aDeclaredType, has aTypeKindofDECLARED, and has an empty type arguments list.default PrimitiveTypeprimitiveType(CharSequence canonicalName) Returns the result of applying unboxing conversion to the (logical)TypeElementbearing the suppliedcanonicalName.default PrimitiveTypeReturns the result of applying unboxing conversion to the type declared by the suppliedTypeElement.primitiveType(TypeKind kind) Returns the result of applying unboxing conversion to the suppliedTypeMirror.default booleanraw(TypeMirror t) A convenience method that returnstrueif and only if the suppliedTypeMirroris a raw type according to the rules of the Java Language Specificationdefault TypeMirrorA convenience method that returns the raw type corresponding tot, ornulliftis incapable of yielding a raw type.Returns aRecordComponentElementcorresponding to the suppliedExecutableElement, ornullif there is no suchRecordComponentElement.booleansameType(TypeMirror t0, TypeMirror t1) Returnstrueif and only if the two arguments represent the same type.booleansubsignature(ExecutableType et0, ExecutableType et1) Returnstrueif and only ifet0is a subsignature ofet1.booleansubtype(TypeMirror candidateSubtype, TypeMirror supertype) Returnstrueif and only ifcandidateSubtypeis a subtype ofsupertype.default StringtoString(CharSequence name) Converts the suppliedCharSequence, which is often aName, into aString, and returns the conversion, locking when appropriate to serialize symbol completion.default TypeMirrorA convenience method that returns theTypeMirrorcorresponding to the supplied (reflective)Type.typeElement(CharSequence canonicalName) Returns aTypeElementrepresenting the element bearing the supplied canonical name, ornullif there is no suchTypeElement.typeElement(ModuleElement asSeenFrom, CharSequence canonicalName) Returns aTypeElementrepresenting the element bearing the supplied canonical name, as read or seen from the module represented by the suppliedModuleElement, ornullif there is no suchTypeElement.default TypeElementReturns aTypeElementrepresenting the result of applying boxing conversion to the primitive type represented by the suppliedPrimitiveTypeargument.default TypeElementtypeElement(TypeKind primitiveTypeKind) Returns aTypeElementrepresenting the result of applying boxing conversion to the primitive type represented by the suppliedTypeKindargument, if it is primitive.default TypeParameterElementReturns theTypeParameterElementcontained by the suppliedParameterizablewhose name is equal to the suppliedname, ornullif there is no suchTypeParameterElement.default TypeMirror[]A convenience method that returns an array ofTypeMirrors whose elements correspond, in order, to the elements in the suppliedTypearray.default TypeVariabletypeVariable(Parameterizable p, CharSequence name) A convenience method that returns theTypeVariabledeclared by theTypeParameterElementcontained by the suppliedParameterizablewhose name is equal to the suppliedname, ornullif there is no suchTypeParameterElementorTypeVariable.default VariableElementvariableElement(Element enclosingElement, CharSequence simpleName) A convenience method that returns the firstVariableElementwith a variableElementKindand bearing the suppliedsimpleNamethat the suppliedenclosingElementencloses, ornullif there is no suchVariableElement.default WildcardTypeA convenience method that returns a newWildcardTypewith aTypeKindofTypeKind.WILDCARD, an extends bound ofnull, and a super bound ofnull.wildcardType(TypeMirror extendsBound, TypeMirror superBound) Returns a newWildcardTypewith aTypeKindofTypeKind.WILDCARD, an extends bound of the suppliedextendsBound, and a super bound of the suppliedsuperBound.
-
Method Details
-
arrayTypeOf
- Parameters:
componentType- the component type; must not benull- Returns:
- a non-
nullArrayTypewhose component type is the same as the suppliedcomponentType - Throws:
NullPointerException- ifcomponentTypeisnullIllegalArgumentException- ifcomponentTypeis not a valid component type- See Also:
-
asMemberOf
Returns a non-nullTypeMirrorrepresenting the type of the suppliedElementwhen thatElementis viewed as a member of, or otherwise directly contained by, the suppliedcontainingType.For example, when viewed as a member of the parameterized type
Set<String>, theSet.add(Object)method (represented as anExecutableElement) has a type whose method parameter is of typeString(notString's erasure).- Parameters:
containingType- the containingDeclaredType; must not benulle- the memberElement; must not benull- Returns:
- a non-
nulltype representing the type of the suppliedElementwhen viewed as a member of the suppliedcontainingType; nevernull - Throws:
NullPointerException- if eithercontainingTypeoreisnullIllegalArgumentException- ifecannot be viewed as a member of the suppliedcontainingType(because it is the wrong kind, for example)- See Also:
-
assignable
Returnstrueif and only if the suppliedpayload(the first argument) is considered assignable to the suppliedreceiver(the second argument) according to the rules of the Java Language Specification.- Parameters:
payload- theTypeMirrorbeing assigned; must not benullreceiver- theTypeMirrorreceiving the assignment; must not benull- Returns:
trueif and only ifpayloadis assignable toreceiver- Throws:
NullPointerException- if eitherpayloadorreceiverisnullIllegalArgumentException- if eitherTypeMirroris not one that can take part in an assignment- See Also:
- External Specifications
-
binaryName
- Parameters:
e- aTypeElement; must not benull- Returns:
- a non-
nullName - Throws:
NullPointerException- ifeisnull- See Also:
- External Specifications
-
bridge
Returnstrueif and only if the suppliedExecutableElementrepresents a bridge method.- Parameters:
e- anExecutableElement; must not benull- Returns:
trueif and only if the suppliedExecutableElementrepresents a bridge method- Throws:
NullPointerException- ifeisnull- See Also:
- External Specifications
-
capture
- Parameters:
wildcard- aTypeMirror; must not benull; if not a wildcard type, then it will be returned unchanged- Returns:
- a non-
nullTypeMirrorrepresenting the result of capture conversion applied to the suppliedTypeMirror - Throws:
NullPointerException- ifwildcardisnull- See Also:
- External Specifications
-
contains
Returnstrueif and only ifcandidateContainercontainscandidate, according to the Java Language Specification, section 4.5.1.- Parameters:
candidateContainer- the putative containing type; normally a wildcard type; must not benullcandidate- the putative contained type; must not benull- Returns:
trueif and only ifcandidateContainercontainscandidate, according to the Java Language Specification, section 4.5.1;falseotherwise- Throws:
NullPointerException- if either argument isnullIllegalArgumentException- if either argument is either an executable type, a module type, or a package type- External Specifications
-
declaredType
A convenience method that returns theDeclaredTypeof aTypeElementthat bears the suppliedcanonicalName, ornullif there is no suchTypeElement(and therefore no suchDeclaredType).- Parameters:
canonicalName- a valid canonical name; must not benull- Returns:
- a
DeclaredTypewith aTypeKindofTypeKind.DECLARED, ornull - See Also:
- External Specifications
-
declaredType
Returns theDeclaredTypeof the suppliedTypeElementwith the suppliedTypeMirrorarguments (if any), yielding a parameterized type.Given a
TypeElementrepresenting the class namedjava.util.Setand aTypeMirrorrepresenting the type declared byjava.lang.String, for example, this method will return aDeclaredTyperepresenting the parameterized type corresponding tojava.util.Set<java.lang.String>.The number of supplied type arguments must either equal the number of the supplied
TypeElement's formal type parameters, or must be zero. If it is zero, and if the suppliedTypeElementis generic, then the suppliedTypeElement's raw type is returned.If a parameterized type is returned, its
TypeElementmust not be contained within a generic outer class. The parameterized typeOuter<String>.Inner<Number>, for example, may be constructed by first using this method to get the typeOuter<String>, and then invokingdeclaredType(DeclaredType, TypeElement, TypeMirror...).- Parameters:
typeElement- aTypeElement; must not benulltypeArguments- any type arguments (represented byTypeMirrors); must not benull- Returns:
- a non-
nullDeclaredTypewith aTypeKindofTypeKind.DECLARED - Throws:
NullPointerException- iftypeElementortypeArgumentsisnull- See Also:
- External Specifications
-
declaredType
DeclaredType declaredType(DeclaredType enclosingType, TypeElement typeElement, TypeMirror... typeArguments) Returns theDeclaredTypeof the suppliedTypeElementwith the suppliedTypeMirrorarguments (if any), given a containingDeclaredTypeof which it is a member, yielding a parameterized type.Given a
DeclaredTyperepresenting the parameterized type corresponding toOuter<String>(see thedeclaredType(TypeElement, TypeMirror...)method), aTypeElementrepresenting the class namedOuter.Innerand aDeclaredTyperepresenting the non-generic class corresponding toNumber, for example, this method will return aDeclaredTyperepresenting the parameterized type corresponding toOuter<String>.Inner<Number>.The number of supplied type arguments must either equal the number of the supplied
TypeElement's formal type parameters, or must be zero. If it is zero, and if the suppliedTypeElementis generic, then the suppliedTypeElement's raw type is returned.- Parameters:
enclosingType- aDeclaredTyperepresenting the containing type; must not benulltypeElement- aTypeElement; must not benulltypeArguments- any type arguments (represented byTypeMirrors); must not benull- Returns:
- a non-
nullDeclaredTypewith aTypeKindofTypeKind.DECLARED - Throws:
NullPointerException- ifenclosingType,typeElement, ortypeArgumentsisnull- See Also:
- External Specifications
-
directSupertypes
Returns a non-nullListof the direct supertypes of the suppliedTypeMirror, which is normally a declared type.- Parameters:
t- aTypeMirror; must not benull; must not be an executable type, a module type, or a package type- Returns:
- a non-
null, immutableListofTypeMirrors representing the direct supertypes - Throws:
NullPointerException- iftisnullIllegalArgumentException- if either argument is either an executable type, a module type, or a package type- See Also:
- External Specifications
-
element
Returns theElementresponsible for declaring the suppliedTypeMirror, which is most commonly aDeclaredType, aTypeVariable, aNoTypewith aTypeKindofTypeKind.MODULE, or aNoTypewith aTypeKindofTypeKind.PACKAGE, ornullif there is no suchElement.- Parameters:
t- aTypeMirror; must not benull- Returns:
- an
Element, ornull - Throws:
NullPointerException- iftisnull- See Also:
-
elementType
A convenience method that returns the element type of the suppliedTypeMirror.The element type of an array type is the element type of its component type.
.The element type of every other kind of type is the type itself. Note that the semantics of the prior sentence diverge deliberately, primarily for convenience, from those of the relevant section in the Java Language Specification.
- Parameters:
t- aTypeMirror; must not benull- Returns:
- the element type of the supplied
TypeMirror; nevernull - Throws:
NullPointerException- iftisnull- External Specifications
-
erasure
Returns the erasure of the suppliedTypeMirror.- Type Parameters:
T- aTypeMirrorspecialization- Parameters:
t- theTypeMirrorrepresenting the type whose erasure should be returned; must not benull- Returns:
- the erasure of the supplied
TypeMirror; nevernull - Throws:
NullPointerException- iftisnullIllegalArgumentException- iftis aNoTypewith aTypeKindofTypeKind.MODULE, or aNoTypewith aTypeKindofTypeKind.PACKAGE- See Also:
- External Specifications
-
executableElement
Returns anExecutableElementcorresponding to the suppliedExecutable.- Parameters:
e- anExecutable; must not benull- Returns:
- an
ExecutableElementcorresponding to the suppliedExecutable; nevernull - Throws:
NullPointerException- ifeisnullIllegalArgumentException- if somehoweis neither aConstructornor aMethod
-
executableElement
default ExecutableElement executableElement(TypeElement declaringElement, TypeMirror returnType, CharSequence name, TypeMirror... parameterTypes) A convenience method that returns anExecutableElementrepresenting the static initializer, constructor or method described by the supplied arguments, ornullif no suchExecutableElementexists.- Parameters:
declaringElement- aTypeElementrepresenting the class that declares the executable; must not benullreturnType- the return type of the executable; must not benullname- the name of the executable; must not benullparameterTypes-TypeMirrors that represent the executable's parameter types- Returns:
- an
ExecutableElementwith anElementKindofElementKind.CONSTRUCTOR,ElementKind.METHOD, orElementKind.STATIC_INIT, ornull - Throws:
NullPointerException- if any argument isnull
-
generic
A convenience method that returnstrueif and only if the suppliedElementis generic.- Parameters:
e- anElement; must not benull- Returns:
trueif and only if the suppliedElementis generic;falseotherwise- Throws:
NullPointerException- ifeisnull- See Also:
- External Specifications
-
generic
A convenience method that returnstrueif and only if the suppliedTypeMirroris declared by anElementthat is generic.- Parameters:
t- aTypeMirror; must not benull- Returns:
trueif and only if the suppliedTypeMirroris declared by anElementthat is generic- Throws:
NullPointerException- iftisnull- See Also:
- External Specifications
-
javaLangObject
A convenience method that returnstrueif and only if the suppliedElementrepresents the (essentially primordial)java.lang.ObjectElement.- Parameters:
e- anElement; must not benull- Returns:
trueif and only if the suppliedElementrepresents the (essentially primordial)java.lang.ObjectElement;falseotherwise- Throws:
NullPointerException- ifeisnull
-
javaLangObject
A convenience method that returnstrueif and only if the suppliedTypeMirrorrepresents theDeclaredTypedeclared by the (essentially primordial)java.lang.Objectelement.- Parameters:
t- aTypeMirror; must not benull- Returns:
truerepresents theDeclaredTypedeclared by the (essentially primordial)java.lang.Objectelement;falseotherwise- Throws:
NullPointerException- iftisnull- See Also:
-
javaLangObject
A convenience method that returns theTypeElementrepresenting the class namedjava.lang.Object.- Returns:
- a non-
nullTypeElementwhose qualified name is equal tojava.lang.Object - See Also:
-
lock
Semantically locks an opaque lock used to serialize symbol completion, and returns it in the form of anUnlockable.Implementations of this method must not return
null.- Returns:
- an
Unlockablein a semantically locked state; nevernull - See Also:
-
moduleElement
Returns aModuleElementrepresenting the module named by the suppliedqualifiedName, ornullif there is no suchModuleElement.- Parameters:
qualifiedName- a name suitable for naming a module; must not benull; may be empty, in which case aModuleElementrepresenting an unnamed module will be returned- Returns:
- a
ModuleElement, ornull - Throws:
NullPointerException- ifqualifiedNameisnull- See Also:
- External Specifications
-
name
Returns aNamerepresenting the suppliedCharSequence.- Parameters:
name- aCharSequence; must not benull- Returns:
- a non-
nullNamerepresenting the suppliedname(java.lang.CharSequence) - Throws:
NullPointerException- ifnameisnull- See Also:
-
noType
Returns aNoTypebearing the suppliedTypeKind, if the suppliedTypeKindis eitherTypeKind.NONEorTypeKind.VOID.- Parameters:
kind- aTypeKind; must be eitherTypeKind.NONEorTypeKind.VOID- Returns:
- a non-
nullNoTypebearing the suppliedTypeKind - Throws:
NullPointerException- ifkindisnullIllegalArgumentException- ifkindis non-nulland neitherTypeKind.NONEnorTypeKind.VOID- See Also:
- External Specifications
-
nullType
- Returns:
- a non-
nullNullType - See Also:
- External Specifications
-
origin
- Parameters:
e- a non-nullElement- Returns:
- a non-
nullElements.Origin - See Also:
-
packageElement
Returns aPackageElementrepresenting the package bearing the suppliedcanonicalName, ornullif there is no suchPackageElement.- Parameters:
canonicalName- a canonical name suitable for naming a package; must not benull; may be empty, in which case aModuleElementrepresenting an unnamed package will be returned- Returns:
- a
PackageElement, ornull - Throws:
NullPointerException- ifcanonicalNameisnull- See Also:
- External Specifications
-
packageElement
Returns aPackageElementrepresenting the package bearing the suppliedcanonicalNameas seen from the module represented by the suppliedModuleElement, ornullif there is no suchPackageElement.- Parameters:
asSeenFrom- aModuleElement; must not benullcanonicalName- a canonical name suitable for naming a package; must not benull; may be empty, in which case aModuleElementrepresenting an unnamed package will be returned- Returns:
- a
PackageElement, ornull - Throws:
NullPointerException- if eitherasSeenFromorcanonicalNameisnull- See Also:
- External Specifications
-
parameterizable
Returns aParameterizablecorresponding to the supplied (reflective)GenericDeclaration.- Parameters:
gd- aGenericDeclaration; must not benull- Returns:
- a
Parameterizablecorresponding to the suppliedGenericDeclaration; nevernull - Throws:
NullPointerException- ifgdisnullIllegalArgumentException- ifgdis neither aClassnor anExecutable
-
parameterized
A convenience method that returnstrueif and only iftis aDeclaredType, has aTypeKindofDECLARED, and has an empty type arguments list.- Parameters:
t- aTypeMirror; must not benull- Returns:
trueif and only iftis aDeclaredType, has aTypeKindofDECLARED, and has an empty type arguments list;falseotherwise- Throws:
NullPointerException- iftisnull
-
primitiveType
Returns the result of applying unboxing conversion to the (logical)TypeElementbearing the suppliedcanonicalName.- Parameters:
canonicalName- a canonical name of either a primitive type or a so-called "wrapper" type; must not benull- Returns:
- a non-
nullPrimitiveTypewith a primitiveTypeKind - Throws:
NullPointerException- ifcanonicalNameisnullIllegalArgumentException- ifcanonicalNameconverted to aStringis not equal toboolean,byte,char,double,float,int,long,short,java.lang.Boolean,java.lang.Byte,java.lang.Character,java.lang.Double,java.lang.Float,java.lang.Integer,java.lang.Long, orjava.lang.Short- See Also:
- External Specifications
-
primitiveType
Returns the result of applying unboxing conversion to the type declared by the suppliedTypeElement.- Parameters:
e- aTypeElement; must not benull- Returns:
- a non-
nullPrimitiveTypewith a primitiveTypeKind - Throws:
NullPointerException- ifeisnullIllegalArgumentException- if there is no unboxing conversion that can be applied to the type declared bye- See Also:
- External Specifications
-
primitiveType
- Parameters:
kind- a primitiveTypeKind; must not benull- Returns:
- a non-
nullPrimitiveTypewith a primitiveTypeKind - Throws:
NullPointerException- ifkindisnullIllegalArgumentException- ifkindis not primitive- See Also:
- External Specifications
-
primitiveType
Returns the result of applying unboxing conversion to the suppliedTypeMirror.- Parameters:
t- aTypeMirror; must not benull- Returns:
- a non-
nullPrimitiveTypewith a primitiveTypeKind - Throws:
NullPointerException- iftisnullIllegalArgumentException- if there is no unboxing conversion that can be applied tot- See Also:
- External Specifications
-
raw
A convenience method that returnstrueif and only if the suppliedTypeMirroris a raw type according to the rules of the Java Language Specification- Parameters:
t- aTypeMirror; must not benull- Returns:
trueif and only if the suppliedTypeMirroris a raw type according to the rules of the Java Language Specification- Throws:
NullPointerException- iftisnull- External Specifications
-
rawType
A convenience method that returns the raw type corresponding tot, ornulliftis incapable of yielding a raw type.Overrides of this method must conform to the requirements imposed by the relevant section of the relevant version of the Java Language Specification concerning raw types.
- Parameters:
t- aTypeMirror; must not benull- Returns:
- the raw type corresponding to the supplied
TypeMirror, ornulliftis incapable of yielding a raw type - Throws:
NullPointerException- iftisnull- External Specifications
-
recordComponentElement
Returns aRecordComponentElementcorresponding to the suppliedExecutableElement, ornullif there is no suchRecordComponentElement.- Parameters:
e- anExecutableElementenclosed by a record representing an accessor method; must not benull- Returns:
- a
RecordComponentElementcorresponding to the suppliedExecutableElement, ornull - Throws:
NullPointerException- ifeisnull- External Specifications
-
sameType
Returnstrueif and only if the two arguments represent the same type.This method differs from the
Types.isSameType(TypeMirror, TypeMirror)method in two ways:- Its arguments may be
null. If both arguments arenull,trueis returned. If only one argument isnull,falseis returned. - If the same Java object reference is passed as both arguments,
trueis returned (even if it has aTypeKindofTypeKind.WILDCARD).
- Parameters:
t0- the firstTypeMirror; may benullt1- the secondTypeMirror; may benull- Returns:
trueif and only if the two arguments represent the same type;falseotherwise- See Also:
- External Specifications
- Its arguments may be
-
subsignature
Returnstrueif and only ifet0is a subsignature ofet1.- Parameters:
et0- the firstExecutableType; must not benullet1- the secondExecutableType; must not benull- Returns:
trueif and only ifet0is a subsignature ofet1- Throws:
NullPointerException- if either argument isnullClassCastException- if this method is implemented in terms of theTypes.isSubsignature(ExecutableType, ExecutableType)method, and if each of the suppliedExecutableTypearguments does not have anEXECUTABLETypeKind; this exception type is undocumented by theTypes.isSubsignature(ExecutableType, ExecutableType)method and so is subject to change without prior notice- See Also:
- External Specifications
-
subtype
Returnstrueif and only ifcandidateSubtypeis a subtype ofsupertype.- Parameters:
candidateSubtype- the firstTypeMirror; must not benullsupertype- the secondTypeMirror; must not benull- Returns:
trueif and only ifcandidateSubtypeis a subtype ofsupertype- Throws:
NullPointerException- if either argument isnull- See Also:
- External Specifications
-
toString
Converts the suppliedCharSequence, which is often aName, into aString, and returns the conversion, locking when appropriate to serialize symbol completion.- Parameters:
name- theCharSequenceto convert; may benullin which casenullwill be returned- Returns:
- a
String, ornullifnamewasnull - See Also:
-
type
A convenience method that returns theTypeMirrorcorresponding to the supplied (reflective)Type.- Parameters:
t- aType; must not benull- Returns:
- the
TypeMirrorcorresponding to the suppliedType; nevernull - Throws:
NullPointerException- iftisnullIllegalArgumentException- iftis not aClass,GenericArrayType,ParameterizedType,TypeVariableorWildcardType
-
types
A convenience method that returns an array ofTypeMirrors whose elements correspond, in order, to the elements in the suppliedTypearray.- Parameters:
ts- an array ofTypes; must not benull- Returns:
- an array of
TypeMirrors whose elements correspond, in order, to the elements in the suppliedTypearray; nevernull - Throws:
NullPointerException- iftsisnullor containsnullelementsIllegalArgumentException- if any element oftsis deemed illegal by thetype(Type)method- See Also:
-
typeElement
Returns aTypeElementrepresenting the element bearing the supplied canonical name, ornullif there is no suchTypeElement.- Parameters:
canonicalName- a valid canonical name; must not benull- Returns:
- a
TypeElement, ornull - Throws:
NullPointerException- ifcanonicalNameisnull- See Also:
- External Specifications
-
typeElement
Returns aTypeElementrepresenting the element bearing the supplied canonical name, as read or seen from the module represented by the suppliedModuleElement, ornullif there is no suchTypeElement.- Parameters:
asSeenFrom- aModuleElement; must not benullcanonicalName- a valid canonical name; must not benull- Returns:
- a
TypeElement, ornull - Throws:
NullPointerException- if eitherasSeenFromorcanonicalNameisnull- See Also:
- External Specifications
-
typeElement
Returns aTypeElementrepresenting the result of applying boxing conversion to the primitive type represented by the suppliedPrimitiveTypeargument.The default implementation of this method calls the
typeElement(TypeKind)method with the suppliedPrimitiveType's affiliatedTypeKindand returns its result.- Parameters:
t- aPrimitiveTypewith aTypeKindthat is primitive; must not benull- Returns:
- a non-
nullTypeElementrepresenting the result of applying boxing conversion to the supplied argument - Throws:
NullPointerException- iftisnullClassCastException- if this method is implemented in terms of theTypes.boxedClass(PrimitiveType)method, and if the suppliedPrimitiveTypedoes not have a primitiveTypeKind; this exception type is undocumented by theTypes.boxedClass(PrimitiveType)method and so is subject to change without prior noticeIllegalArgumentException- ifprimitiveTypeKindis not primitive- See Also:
- External Specifications
-
typeElement
Returns aTypeElementrepresenting the result of applying boxing conversion to the primitive type represented by the suppliedTypeKindargument, if it is primitive.- Parameters:
primitiveTypeKind- aTypeKindthat is primitive; must not benull- Returns:
- a non-
nullTypeElementrepresenting the result of applying boxing conversion to the supplied argument - Throws:
IllegalArgumentException- ifprimitiveTypeKindis not primitive- See Also:
- External Specifications
-
typeParameterElement
Returns theTypeParameterElementcontained by the suppliedParameterizablewhose name is equal to the suppliedname, ornullif there is no suchTypeParameterElement.- Parameters:
p- aParameterizable; must not benullname- a name valid for a type parameter; must not benull- Returns:
- a
TypeParameterElement, ornull
-
typeVariable
A convenience method that returns theTypeVariabledeclared by theTypeParameterElementcontained by the suppliedParameterizablewhose name is equal to the suppliedname, ornullif there is no suchTypeParameterElementorTypeVariable.- Parameters:
p- aParameterizable; must not benullname- a name valid for a type parameter; must not benull- Returns:
- a
TypeVariable, ornull - See Also:
-
variableElement
A convenience method that returns the firstVariableElementwith a variableElementKindand bearing the suppliedsimpleNamethat the suppliedenclosingElementencloses, ornullif there is no suchVariableElement.- Parameters:
enclosingElement- anElement; must not benullsimpleName- aCharSequence; must not benull- Returns:
- a
VariableElement, ornull - Throws:
NullPointerException- if either argument isnull- See Also:
-
wildcardType
A convenience method that returns a newWildcardTypewith aTypeKindofTypeKind.WILDCARD, an extends bound ofnull, and a super bound ofnull.- Returns:
- a new, non-
nullWildcardType - See Also:
- External Specifications
-
wildcardType
Returns a newWildcardTypewith aTypeKindofTypeKind.WILDCARD, an extends bound of the suppliedextendsBound, and a super bound of the suppliedsuperBound.Any argument may be
null. Both arguments may not be non-null.- Parameters:
extendsBound- the upper bound of the newWildcardType; may benullsuperBound- the lower bound of the newWildcardType; may benull- Returns:
- a new, non-
nullWildcardType - Throws:
IllegalArgumentException- if both arguments are non-nullor otherwise unsuitable for being the bounds of aWildcardType- See Also:
- External Specifications
-