Names in signatures are identifiers, which must
not be empty and must not contain any of the ASCII characters . ; [ / < > :. Top-level class and interface names are denoted by
slash-separated identifiers.
Type, SignatureAttribute
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Signature.
Models the signature of an array type. |
| public static interface | Signature.
Models the signature of a primitive type (JLS 4.2) or void. |
| public static interface | Signature.
Models the signature of a possibly-parameterized class or interface type. |
| public static interface | Signature.
Models the signature of a reference type, which may be a class, interface, type variable, or array type. |
| public static interface | Signature.
Marker interface for a signature for a throwable type. |
| public static interface | Signature.
Models a type argument, an argument to a type parameter. |
| public static interface | Signature.
Models a signature for a type parameter of a generic class, interface, method, or constructor, which introduces a type variable. |
| public static interface | Signature.
Models the signature of a type variable. |
| Modifier and Type | Method and Description |
|---|---|
| public static Signature | |
| public static Signature | |
| public String |
| of | back to summary |
|---|---|
| public static Signature of(ClassDesc classDesc) Returns a Java type signature from a field descriptor. The returned signature represents a reifiable type (JLS 4.7).
| |
| parseFrom | back to summary |
|---|---|
| public static Signature parseFrom(String javaTypeSignature) Parses a Java type signature from a raw string.
| |
| signatureString | back to summary |
|---|---|
| public String signatureString() Returns the raw signature string.
| |
Type, GenericArrayType
| Modifier and Type | Method and Description |
|---|---|
| public Signature | Returns: the signature of the component typeReturns the signature of the component type. |
| public static Signature. | |
| public static Signature. |
| componentSignature | back to summary |
|---|---|
| public Signature componentSignature() Returns the signature of the component type.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns an array type with the given component type.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a signature for an array type.
| |
| Modifier and Type | Method and Description |
|---|---|
| public char | Returns: the single-letter descriptor for the base typeReturns the single-letter descriptor for the base type. |
| public static Signature. | Returns: the signature of a primitive type or voida symbolic descriptor for the base type, must correspond
to a primitive type classDesc)Hides java. Returns the signature of a primitive type or void. |
| public static Signature. | Returns: the signature of a primitive type or voidthe single-letter descriptor for the base type baseType)Returns the signature of a primitive type or void. |
| baseType | back to summary |
|---|---|
| public char baseType() Returns the single-letter descriptor for the base type.
| |
| of | back to summary |
|---|---|
| public static Signature. Hides java. Returns the signature of a primitive type or void.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns the signature of a primitive type or void.
| |
These are examples of class type signatures:
Lcom/example/Outer; for Outer
com/example/Outer and no outer type or type
argument.
Lcom/example/Outer$Nested<TA;>; for Outer.Nested<A>
com/example/Outer$Nested representing a nested
class, no outer type, and a single type argument of type variable
A.
Lcom/example/GenericOuter<TA;>.Inner; for GenericOuter<A>.Inner
Inner, a simple class name, outer type
Lcom/example/GenericOuter<TA;>; for GenericOuter<A>,
and no type argument.
If the outer type exists, the class name is the simple name of the nested type.
Otherwise, it is a binary name in
internal form (separated by /).
If a nested type does not have any enclosing parameterization, it may
be represented without an outer type and as an internal binary name,
in which nesting is represented by $ instead of ..
Type, ParameterizedType
| Modifier and Type | Method and Description |
|---|---|
| public default ClassDesc | Returns: this class or interface, as a symbolic descriptorReturns this class or interface, as a symbolic descriptor. |
| public String | Returns: the class or interface name; includes the slash-separated package name if there is no outer typeReturns the class or interface name; includes the slash-separated package name if there is no outer type. |
| public static Signature. | |
| public static Signature. | Returns: a class or interface signaturesignature of the outer type, may be outerType,nullthe name of this class or interface className, Signature.the type arguments typeArgs
Deprecated
for removal since 26. The resulting signature does not denote the class represented by
className when outerType is not null.
Returns a class or interface signature. |
| public static Signature. | |
| public static Signature. | |
| public Optional | Returns: the signature of the class that this class is a member of, only if this is a member classReturns the signature of the class that this class is a member of, only if this is a member class. |
| public List | Returns: the type arguments of this class or interfaceReturns the type arguments of this class or interface. |
| classDesc | back to summary |
|---|---|
| public default ClassDesc classDesc() Returns this class or interface, as a symbolic descriptor.
| |
| className | back to summary |
|---|---|
| public String className() Returns the class or interface name; includes the slash-separated package name if there is no
outer type. Note this may indicate a nested class name with
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a class or interface signature without an outer type.
| |
| of | back to summary |
|---|---|
| public static Signature. Deprecated for removal since 26. The resulting signature does not denote the class represented by
Returns a class or interface signature.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a class or interface signature without an outer type.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a class type signature.
| |
| outerType | back to summary |
|---|---|
| public Optional Returns the signature of the class that this class is a member of, only if this is a member class. Note that the outer class may be absent if this is a member class without any parameterized enclosing type.
| |
| typeArgs | back to summary |
|---|---|
| public List Returns the type arguments of this class or interface. Note that the outer type may have more type arguments.
| |
Type, WildcardType
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Signature.
Models a type argument with an explicit bound type. |
| public static interface | Signature.
Models an unbounded wildcard type argument |
| Modifier and Type | Method and Description |
|---|---|
| public static Signature. | Returns: a bounded type argumentthe wildcard indicator wildcard,the bound type boundTypeReturns a bounded type argument. |
| public static Signature. | Returns: an upper-bounded wildcard type argumentthe upper bound boundTypeReturns an upper-bounded wildcard type argument. |
| public static Signature. | Returns: a type argument of a reference typethe reference type boundTypeReturns a type argument of a reference type. |
| public static Signature. | Returns: a lower-bounded wildcard type argumentthe lower bound boundTypeReturns a lower-bounded wildcard type argument. |
| public static Signature. | Returns: an unbounded wildcard type argument*Returns an unbounded wildcard type argument |
| bounded | back to summary |
|---|---|
| public static Signature. Returns a bounded type argument.
| |
| extendsOf | back to summary |
|---|---|
| public static Signature. Returns an upper-bounded wildcard type argument.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a type argument of a reference type.
| |
| superOf | back to summary |
|---|---|
| public static Signature. Returns a lower-bounded wildcard type argument.
| |
| unbounded | back to summary |
|---|---|
| public static Signature. Returns an unbounded wildcard type argument | |
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Signature.
Models a type argument's wildcard indicator. |
| Modifier and Type | Method and Description |
|---|---|
| public Signature. | |
| public Signature. |
| boundType | back to summary |
|---|---|
| public Signature. Returns the signature of the type bound.
| |
| wildcardIndicator | back to summary |
|---|---|
| public Signature. Returns the kind of wildcard.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Signature. | EXTENDS
Upper-bound indicator |
| public static final Signature. | NONE
No wildcard (empty), an exact type. |
| public static final Signature. | SUPER
Lower-bound indicator |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Signature. | |
| public static Signature. |
| EXTENDS | back to summary |
|---|---|
| public static final Signature. Upper-bound indicator
| |
| NONE | back to summary |
|---|---|
| public static final Signature. No wildcard (empty), an exact type. Also known as invariant. This is the direct use of a reference type in Java programs.
| |
| SUPER | back to summary |
|---|---|
| public static final Signature. Lower-bound indicator
| |
| WildcardIndicator | back to summary |
|---|---|
| private WildcardIndicator() | |
| valueOf | back to summary |
|---|---|
| public static Signature. | |
| values | back to summary |
|---|---|
| public static Signature. | |
*, or ? in Java programs. This type argument has an implicit upper
bound of Object.
WildcardType#getUpperBounds()
GenericDeclaration#getTypeParameters(), TypeVariable, TypeVarSig
| Modifier and Type | Method and Description |
|---|---|
| public Optional | Returns: the class bound of the type parameterReturns the class bound of the type parameter. |
| public String | |
| public List | Returns: the interface bounds of the type parameterReturns the interface bounds of the type parameter. |
| public static Signature. | Returns: a signature for a type parameterthe name of the type parameter identifier, Signature.the class bound of the type parameter, may be classBound,nullthe interface bounds of the type parameter interfaceBoundsReturns a signature for a type parameter. |
| public static Signature. | Returns: a signature for a type parameterthe name of the type parameter identifier, Optional<Signature.the optional class bound of the type parameter classBound,the interface bounds of the type parameter interfaceBoundsReturns a signature for a type parameter. |
| classBound | back to summary |
|---|---|
| public Optional Returns the class bound of the type parameter. This may be empty if this type parameter only has interface bounds.
| |
| identifier | back to summary |
|---|---|
| public String identifier() Returns the name of the type parameter.
| |
| interfaceBounds | back to summary |
|---|---|
| public List Returns the interface bounds of the type parameter. This may be empty.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a signature for a type parameter.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a signature for a type parameter.
| |
TypeVariable, TypeParam
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public static Signature. |
| identifier | back to summary |
|---|---|
| public String identifier() Returns the name of the type variable.
| |
| of | back to summary |
|---|---|
| public static Signature. Returns a signature for a type variable.
| |