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-null
TypeMirror
representing the type of the suppliedElement
when thatElement
is viewed as a member of, or otherwise directly contained by, the suppliedcontainingType
.boolean
assignable
(TypeMirror payload, TypeMirror receiver) Returnstrue
if 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.capture
(TypeMirror wildcard) boolean
contains
(TypeMirror candidateContainer, TypeMirror candidate) Returnstrue
if and only ifcandidateContainer
containscandidate
, according to the Java Language Specification, section 4.5.1.default DeclaredType
declaredType
(CharSequence canonicalName) A convenience method that returns theDeclaredType
of aTypeElement
that bears the suppliedcanonicalName
, ornull
if there is no suchTypeElement
(and therefore no suchDeclaredType
).declaredType
(TypeElement typeElement, TypeMirror... typeArguments) Returns theDeclaredType
of the suppliedTypeElement
with the suppliedTypeMirror
arguments (if any), yielding a parameterized type.declaredType
(DeclaredType enclosingType, TypeElement typeElement, TypeMirror... typeArguments) Returns theDeclaredType
of the suppliedTypeElement
with the suppliedTypeMirror
arguments (if any), given a containingDeclaredType
of which it is a member, yielding a parameterized type.List
<? extends TypeMirror> Returns a non-null
List
of the direct supertypes of the suppliedTypeMirror
, which is normally a declared type.Returns theElement
responsible for declaring the suppliedTypeMirror
, which is most commonly aDeclaredType
, aTypeVariable
, aNoType
with aTypeKind
ofTypeKind.MODULE
, or aNoType
with aTypeKind
ofTypeKind.PACKAGE
, ornull
if there is no suchElement
.default TypeMirror
A convenience method that returns the element type of the suppliedTypeMirror
.<T extends TypeMirror>
Terasure
(T t) Returns the erasure of the suppliedTypeMirror
.default ExecutableElement
executableElement
(TypeElement declaringElement, TypeMirror returnType, CharSequence name, TypeMirror... parameterTypes) A convenience method that returns anExecutableElement
representing the static initializer, constructor or method described by the supplied arguments, ornull
if no suchExecutableElement
exists.default boolean
A convenience method that returnstrue
if and only if the suppliedElement
is generic.default boolean
A convenience method that returnstrue
if and only if the suppliedTypeMirror
is declared by anElement
that is generic.default TypeElement
A convenience method that returns theTypeElement
representing the class namedjava.lang.Object
.default boolean
default boolean
A convenience method that returnstrue
if and only if the suppliedTypeMirror
represents theDeclaredType
declared by the (essentially primordial)java.lang.Object
element.lock()
Semantically locks an opaque lock used to serialize symbol completion, and returns it in the form of anUnlockable
.moduleElement
(CharSequence qualifiedName) Returns aModuleElement
representing the module named by the suppliedqualifiedName
, ornull
if there is no suchModuleElement
.name
(CharSequence name) Returns aName
representing the suppliedCharSequence
.Returns aNoType
bearing the suppliedTypeKind
, if the suppliedTypeKind
is eitherTypeKind.NONE
orTypeKind.VOID
.nullType()
packageElement
(CharSequence canonicalName) Returns aPackageElement
representing the package bearing the suppliedcanonicalName
, ornull
if there is no suchPackageElement
.packageElement
(ModuleElement asSeenFrom, CharSequence canonicalName) Returns aPackageElement
representing the package bearing the suppliedcanonicalName
as seen from the module represented by the suppliedModuleElement
, ornull
if there is no suchPackageElement
.default boolean
A convenience method that returnstrue
if and only ift
is aDeclaredType
, has aTypeKind
ofDECLARED
, and has an empty type arguments list.default PrimitiveType
primitiveType
(CharSequence canonicalName) Returns the result of applying unboxing conversion to the (logical)TypeElement
bearing the suppliedcanonicalName
.default PrimitiveType
Returns 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 boolean
raw
(TypeMirror t) A convenience method that returnstrue
if and only if the suppliedTypeMirror
is a raw type according to the rules of the Java Language Specificationdefault TypeMirror
A convenience method that returns the raw type corresponding tot
, ornull
ift
is incapable of yielding a raw type.Returns aRecordComponentElement
corresponding to the suppliedExecutableElement
, ornull
if there is no suchRecordComponentElement
.boolean
sameType
(TypeMirror t0, TypeMirror t1) Returnstrue
if and only if the two arguments represent the same type.boolean
subsignature
(ExecutableType et0, ExecutableType et1) Returnstrue
if and only ifet0
is a subsignature ofet1
.boolean
subtype
(TypeMirror candidateSubtype, TypeMirror supertype) Returnstrue
if and only ifcandidateSubtype
is a subtype ofsupertype
.default String
toString
(CharSequence name) Converts the suppliedCharSequence
, which is often aName
, into aString
, and returns the conversion, locking when appropriate to serialize symbol completion.typeElement
(CharSequence canonicalName) Returns aTypeElement
representing the element bearing the supplied canonical name, ornull
if there is no suchTypeElement
.typeElement
(ModuleElement asSeenFrom, CharSequence canonicalName) Returns aTypeElement
representing the element bearing the supplied canonical name, as read or seen from the module represented by the suppliedModuleElement
, ornull
if there is no suchTypeElement
.default TypeElement
Returns aTypeElement
representing the result of applying boxing conversion to the primitive type represented by the suppliedPrimitiveType
argument.default TypeElement
typeElement
(TypeKind primitiveTypeKind) Returns aTypeElement
representing the result of applying boxing conversion to the primitive type represented by the suppliedTypeKind
argument, if it is primitive.default TypeParameterElement
Returns theTypeParameterElement
contained by the suppliedParameterizable
whose name is equal to the suppliedname
, ornull
if there is no suchTypeParameterElement
.default TypeVariable
typeVariable
(Parameterizable p, CharSequence name) A convenience method that returns theTypeVariable
declared by theTypeParameterElement
contained by the suppliedParameterizable
whose name is equal to the suppliedname
, ornull
if there is no suchTypeParameterElement
orTypeVariable
.default VariableElement
variableElement
(Element enclosingElement, CharSequence simpleName) A convenience method that returns the firstVariableElement
with a variableElementKind
and bearing the suppliedsimpleName
that the suppliedenclosingElement
encloses, ornull
if there is no suchVariableElement
.default WildcardType
A convenience method that returns a newWildcardType
with aTypeKind
ofTypeKind.WILDCARD
, an extends bound ofnull
, and a super bound ofnull
.wildcardType
(TypeMirror extendsBound, TypeMirror superBound) Returns a newWildcardType
with aTypeKind
ofTypeKind.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-
null
ArrayType
whose component type is the same as the suppliedcomponentType
- Throws:
NullPointerException
- ifcomponentType
isnull
IllegalArgumentException
- ifcomponentType
is not a valid component type- See Also:
-
asMemberOf
Returns a non-null
TypeMirror
representing the type of the suppliedElement
when thatElement
is 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 benull
e
- the memberElement
; must not benull
- Returns:
- a non-
null
type representing the type of the suppliedElement
when viewed as a member of the suppliedcontainingType
; nevernull
- Throws:
NullPointerException
- if eithercontainingType
ore
isnull
IllegalArgumentException
- ife
cannot be viewed as a member of the suppliedcontainingType
(because it is the wrong kind, for example)- See Also:
-
assignable
Returnstrue
if 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
- theTypeMirror
being assigned; must not benull
receiver
- theTypeMirror
receiving the assignment; must not benull
- Returns:
true
if and only ifpayload
is assignable toreceiver
- Throws:
NullPointerException
- if eitherpayload
orreceiver
isnull
IllegalArgumentException
- if eitherTypeMirror
is not one that can take part in an assignment- See Also:
- External Specifications
-
binaryName
- Parameters:
e
- aTypeElement
; must not benull
- Returns:
- a non-
null
Name
- 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-
null
TypeMirror
representing the result of capture conversion applied to the suppliedTypeMirror
- Throws:
NullPointerException
- ifwildcard
isnull
- See Also:
- External Specifications
-
contains
Returnstrue
if and only ifcandidateContainer
containscandidate
, according to the Java Language Specification, section 4.5.1.- Parameters:
candidateContainer
- the putative containing type; normally a wildcard type; must not benull
candidate
- the putative contained type; must not benull
- Returns:
true
if and only ifcandidateContainer
containscandidate
, according to the Java Language Specification, section 4.5.1;false
otherwise- Throws:
NullPointerException
- if either argument isnull
IllegalArgumentException
- if either argument is either an executable type, a module type, or a package type- External Specifications
-
declaredType
A convenience method that returns theDeclaredType
of aTypeElement
that bears the suppliedcanonicalName
, ornull
if there is no suchTypeElement
(and therefore no suchDeclaredType
).- Parameters:
canonicalName
- a valid canonical name; must not benull
- Returns:
- a
DeclaredType
with aTypeKind
ofTypeKind.DECLARED
, ornull
- See Also:
- External Specifications
-
declaredType
Returns theDeclaredType
of the suppliedTypeElement
with the suppliedTypeMirror
arguments (if any), yielding a parameterized type.Given a
TypeElement
representing the class namedjava.util.Set
and aTypeMirror
representing the type declared byjava.lang.String
, for example, this method will return aDeclaredType
representing 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 suppliedTypeElement
is generic
, then the suppliedTypeElement
's raw type is returned.If a parameterized type is returned, its
TypeElement
must 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 benull
typeArguments
- any type arguments (represented byTypeMirror
s); must not benull
- Returns:
- a non-
null
DeclaredType
with aTypeKind
ofTypeKind.DECLARED
- Throws:
NullPointerException
- iftypeElement
ortypeArguments
isnull
- See Also:
- External Specifications
-
declaredType
DeclaredType declaredType(DeclaredType enclosingType, TypeElement typeElement, TypeMirror... typeArguments) Returns theDeclaredType
of the suppliedTypeElement
with the suppliedTypeMirror
arguments (if any), given a containingDeclaredType
of which it is a member, yielding a parameterized type.Given a
DeclaredType
representing the parameterized type corresponding toOuter<
String
>
(see thedeclaredType(TypeElement, TypeMirror...)
method), aTypeElement
representing the class namedOuter.Inner
and aDeclaredType
representing the non-generic class corresponding toNumber
, for example, this method will return aDeclaredType
representing 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 suppliedTypeElement
is generic
, then the suppliedTypeElement
's raw type is returned.- Parameters:
enclosingType
- aDeclaredType
representing the containing type; must not benull
typeElement
- aTypeElement
; must not benull
typeArguments
- any type arguments (represented byTypeMirror
s); must not benull
- Returns:
- a non-
null
DeclaredType
with aTypeKind
ofTypeKind.DECLARED
- Throws:
NullPointerException
- ifenclosingType
,typeElement
, ortypeArguments
isnull
- See Also:
- External Specifications
-
directSupertypes
Returns a non-null
List
of 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
, immutableList
ofTypeMirror
s representing the direct supertypes - Throws:
NullPointerException
- ift
isnull
IllegalArgumentException
- if either argument is either an executable type, a module type, or a package type- See Also:
- External Specifications
-
element
Returns theElement
responsible for declaring the suppliedTypeMirror
, which is most commonly aDeclaredType
, aTypeVariable
, aNoType
with aTypeKind
ofTypeKind.MODULE
, or aNoType
with aTypeKind
ofTypeKind.PACKAGE
, ornull
if there is no suchElement
.- Parameters:
t
- aTypeMirror
; must not benull
- Returns:
- an
Element
, ornull
- Throws:
NullPointerException
- ift
isnull
- 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
- ift
isnull
- External Specifications
-
erasure
Returns the erasure of the suppliedTypeMirror
.- Type Parameters:
T
- aTypeMirror
specialization- Parameters:
t
- theTypeMirror
representing the type whose erasure should be returned; must not benull
- Returns:
- the erasure of the supplied
TypeMirror
; nevernull
- Throws:
NullPointerException
- ift
isnull
IllegalArgumentException
- ift
is aNoType
with aTypeKind
ofTypeKind.MODULE
, or aNoType
with aTypeKind
ofTypeKind.PACKAGE
- See Also:
- External Specifications
-
executableElement
default ExecutableElement executableElement(TypeElement declaringElement, TypeMirror returnType, CharSequence name, TypeMirror... parameterTypes) A convenience method that returns anExecutableElement
representing the static initializer, constructor or method described by the supplied arguments, ornull
if no suchExecutableElement
exists.- Parameters:
declaringElement
- aTypeElement
representing the class that declares the executable; must not benull
returnType
- the return type of the executable; must not benull
name
- the name of the executable; must not benull
parameterTypes
-TypeMirror
s that represent the executable's parameter types- Returns:
- an
ExecutableElement
with anElementKind
ofElementKind.CONSTRUCTOR
,ElementKind.METHOD
, orElementKind.STATIC_INIT
, ornull
- Throws:
NullPointerException
- if any argument isnull
-
generic
A convenience method that returnstrue
if and only if the suppliedElement
is generic.- Parameters:
e
- anElement
; must not benull
- Returns:
true
if and only if the suppliedElement
is generic;false
otherwise- Throws:
NullPointerException
- ife
isnull
- See Also:
- External Specifications
-
generic
A convenience method that returnstrue
if and only if the suppliedTypeMirror
is declared by anElement
that is generic.- Parameters:
t
- aTypeMirror
; must not benull
- Returns:
true
if and only if the suppliedTypeMirror
is declared by anElement
that is generic- Throws:
NullPointerException
- ift
isnull
- See Also:
- External Specifications
-
javaLangObject
A convenience method that returnstrue
if and only if the suppliedElement
represents the (essentially primordial)java.lang.Object
Element
.- Parameters:
e
- anElement
; must not benull
- Returns:
true
if and only if the suppliedElement
represents the (essentially primordial)java.lang.Object
Element
;false
otherwise- Throws:
NullPointerException
- ife
isnull
-
javaLangObject
A convenience method that returnstrue
if and only if the suppliedTypeMirror
represents theDeclaredType
declared by the (essentially primordial)java.lang.Object
element.- Parameters:
t
- aTypeMirror
; must not benull
- Returns:
true
represents theDeclaredType
declared by the (essentially primordial)java.lang.Object
element;false
otherwise- Throws:
NullPointerException
- ift
isnull
- See Also:
-
javaLangObject
A convenience method that returns theTypeElement
representing the class namedjava.lang.Object
.- Returns:
- a non-
null
TypeElement
whose 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
Unlockable
in a semantically locked state; nevernull
- See Also:
-
moduleElement
Returns aModuleElement
representing the module named by the suppliedqualifiedName
, ornull
if there is no suchModuleElement
.- Parameters:
qualifiedName
- a name suitable for naming a module; must not benull
; may be empty, in which case aModuleElement
representing an unnamed module will be returned- Returns:
- a
ModuleElement
, ornull
- Throws:
NullPointerException
- ifqualifiedName
isnull
- See Also:
- External Specifications
-
name
Returns aName
representing the suppliedCharSequence
.- Parameters:
name
- aCharSequence
; must not benull
- Returns:
- a non-
null
Name
representing the suppliedname(java.lang.CharSequence)
- Throws:
NullPointerException
- ifname
isnull
- See Also:
-
noType
Returns aNoType
bearing the suppliedTypeKind
, if the suppliedTypeKind
is eitherTypeKind.NONE
orTypeKind.VOID
.- Parameters:
kind
- aTypeKind
; must be eitherTypeKind.NONE
orTypeKind.VOID
- Returns:
- a non-
null
NoType
bearing the suppliedTypeKind
- Throws:
NullPointerException
- ifkind
isnull
IllegalArgumentException
- ifkind
is non-null
and neitherTypeKind.NONE
norTypeKind.VOID
- See Also:
- External Specifications
-
nullType
- Returns:
- a non-
null
NullType
- See Also:
- External Specifications
-
packageElement
Returns aPackageElement
representing the package bearing the suppliedcanonicalName
, ornull
if there is no suchPackageElement
.- Parameters:
canonicalName
- a canonical name suitable for naming a package; must not benull
; may be empty, in which case aModuleElement
representing an unnamed package will be returned- Returns:
- a
PackageElement
, ornull
- Throws:
NullPointerException
- ifcanonicalName
isnull
- See Also:
- External Specifications
-
packageElement
Returns aPackageElement
representing the package bearing the suppliedcanonicalName
as seen from the module represented by the suppliedModuleElement
, ornull
if there is no suchPackageElement
.- Parameters:
asSeenFrom
- aModuleElement
; must not benull
canonicalName
- a canonical name suitable for naming a package; must not benull
; may be empty, in which case aModuleElement
representing an unnamed package will be returned- Returns:
- a
PackageElement
, ornull
- Throws:
NullPointerException
- if eitherasSeenFrom
orcanonicalName
isnull
- See Also:
- External Specifications
-
parameterized
A convenience method that returnstrue
if and only ift
is aDeclaredType
, has aTypeKind
ofDECLARED
, and has an empty type arguments list.- Parameters:
t
- aTypeMirror
; must not benull
- Returns:
true
if and only ift
is aDeclaredType
, has aTypeKind
ofDECLARED
, and has an empty type arguments list;false
otherwise- Throws:
NullPointerException
- ift
isnull
-
primitiveType
Returns the result of applying unboxing conversion to the (logical)TypeElement
bearing the suppliedcanonicalName
.- Parameters:
canonicalName
- a canonical name of either a primitive type or a so-called "wrapper" type; must not benull
- Returns:
- a non-
null
PrimitiveType
with a primitiveTypeKind
- Throws:
NullPointerException
- ifcanonicalName
isnull
IllegalArgumentException
- ifcanonicalName
converted to aString
is 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-
null
PrimitiveType
with a primitiveTypeKind
- Throws:
NullPointerException
- ife
isnull
IllegalArgumentException
- 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-
null
PrimitiveType
with a primitiveTypeKind
- Throws:
NullPointerException
- ifkind
isnull
IllegalArgumentException
- ifkind
is 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-
null
PrimitiveType
with a primitiveTypeKind
- Throws:
NullPointerException
- ift
isnull
IllegalArgumentException
- if there is no unboxing conversion that can be applied tot
- See Also:
- External Specifications
-
raw
A convenience method that returnstrue
if and only if the suppliedTypeMirror
is a raw type according to the rules of the Java Language Specification- Parameters:
t
- aTypeMirror
; must not benull
- Returns:
true
if and only if the suppliedTypeMirror
is a raw type according to the rules of the Java Language Specification- Throws:
NullPointerException
- ift
isnull
- External Specifications
-
rawType
A convenience method that returns the raw type corresponding tot
, ornull
ift
is 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
, ornull
ift
is incapable of yielding a raw type - Throws:
NullPointerException
- ift
isnull
- External Specifications
-
recordComponentElement
Returns aRecordComponentElement
corresponding to the suppliedExecutableElement
, ornull
if there is no suchRecordComponentElement
.- Parameters:
e
- anExecutableElement
enclosed by a record representing an accessor method; must not benull
- Returns:
- a
RecordComponentElement
corresponding to the suppliedExecutableElement
, ornull
- Throws:
NullPointerException
- ife
isnull
- External Specifications
-
sameType
Returnstrue
if 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
,true
is returned. If only one argument isnull
,false
is returned. - If the same Java object reference is passed as both arguments,
true
is returned (even if it has aTypeKind
ofTypeKind.WILDCARD
).
- Parameters:
t0
- the firstTypeMirror
; may benull
t1
- the secondTypeMirror
; may benull
- Returns:
true
if and only if the two arguments represent the same type;false
otherwise- See Also:
- External Specifications
- Its arguments may be
-
subsignature
Returnstrue
if and only ifet0
is a subsignature ofet1
.- Parameters:
et0
- the firstExecutableType
; must not benull
et1
- the secondExecutableType
; must not benull
- Returns:
true
if and only ifet0
is a subsignature ofet1
- Throws:
NullPointerException
- if either argument isnull
ClassCastException
- if this method is implemented in terms of theTypes.isSubsignature(ExecutableType, ExecutableType)
method, and if each of the suppliedExecutableType
arguments does not have anEXECUTABLE
TypeKind
; 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
Returnstrue
if and only ifcandidateSubtype
is a subtype ofsupertype
.- Parameters:
candidateSubtype
- the firstTypeMirror
; must not benull
supertype
- the secondTypeMirror
; must not benull
- Returns:
true
if and only ifcandidateSubtype
is 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
- theCharSequence
to convert; may benull
in which casenull
will be returned- Returns:
- a
String
, ornull
ifname
wasnull
- See Also:
-
typeElement
Returns aTypeElement
representing the element bearing the supplied canonical name, ornull
if there is no suchTypeElement
.- Parameters:
canonicalName
- a valid canonical name; must not benull
- Returns:
- a
TypeElement
, ornull
- Throws:
NullPointerException
- ifcanonicalName
isnull
- See Also:
- External Specifications
-
typeElement
Returns aTypeElement
representing the element bearing the supplied canonical name, as read or seen from the module represented by the suppliedModuleElement
, ornull
if there is no suchTypeElement
.- Parameters:
asSeenFrom
- aModuleElement
; must not benull
canonicalName
- a valid canonical name; must not benull
- Returns:
- a
TypeElement
, ornull
- Throws:
NullPointerException
- if eitherasSeenFrom
orcanonicalName
isnull
- See Also:
- External Specifications
-
typeElement
Returns aTypeElement
representing the result of applying boxing conversion to the primitive type represented by the suppliedPrimitiveType
argument.The default implementation of this method calls the
typeElement(TypeKind)
method with the suppliedPrimitiveType
's affiliatedTypeKind
and returns its result.- Parameters:
t
- aPrimitiveType
with aTypeKind
that is primitive; must not benull
- Returns:
- a non-
null
TypeElement
representing the result of applying boxing conversion to the supplied argument - Throws:
NullPointerException
- ift
isnull
ClassCastException
- if this method is implemented in terms of theTypes.boxedClass(PrimitiveType)
method, and if the suppliedPrimitiveType
does not have a primitiveTypeKind
; this exception type is undocumented by theTypes.boxedClass(PrimitiveType)
method and so is subject to change without prior noticeIllegalArgumentException
- ifprimitiveTypeKind
is not primitive- See Also:
- External Specifications
-
typeElement
Returns aTypeElement
representing the result of applying boxing conversion to the primitive type represented by the suppliedTypeKind
argument, if it is primitive.- Parameters:
primitiveTypeKind
- aTypeKind
that is primitive; must not benull
- Returns:
- a non-
null
TypeElement
representing the result of applying boxing conversion to the supplied argument - Throws:
IllegalArgumentException
- ifprimitiveTypeKind
is not primitive- See Also:
- External Specifications
-
typeParameterElement
Returns theTypeParameterElement
contained by the suppliedParameterizable
whose name is equal to the suppliedname
, ornull
if there is no suchTypeParameterElement
.- Parameters:
p
- aParameterizable
; must not benull
name
- a name valid for a type parameter; must not benull
- Returns:
- a
TypeParameterElement
, ornull
-
typeVariable
A convenience method that returns theTypeVariable
declared by theTypeParameterElement
contained by the suppliedParameterizable
whose name is equal to the suppliedname
, ornull
if there is no suchTypeParameterElement
orTypeVariable
.- Parameters:
p
- aParameterizable
; must not benull
name
- a name valid for a type parameter; must not benull
- Returns:
- a
TypeVariable
, ornull
- See Also:
-
variableElement
A convenience method that returns the firstVariableElement
with a variableElementKind
and bearing the suppliedsimpleName
that the suppliedenclosingElement
encloses, ornull
if there is no suchVariableElement
.- Parameters:
enclosingElement
- anElement
; must not benull
simpleName
- aCharSequence
; must not benull
- Returns:
- a
VariableElement
, ornull
- Throws:
NullPointerException
- if either argument isnull
- See Also:
-
wildcardType
A convenience method that returns a newWildcardType
with aTypeKind
ofTypeKind.WILDCARD
, an extends bound ofnull
, and a super bound ofnull
.- Returns:
- a new, non-
null
WildcardType
- See Also:
- External Specifications
-
wildcardType
Returns a newWildcardType
with aTypeKind
ofTypeKind.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 benull
superBound
- the lower bound of the newWildcardType
; may benull
- Returns:
- a new, non-
null
WildcardType
- Throws:
IllegalArgumentException
- if both arguments are non-null
or otherwise unsuitable for being the bounds of aWildcardType
- See Also:
- External Specifications
-