Interface Signature.ClassTypeSig
- All Superinterfaces:
Signature, Signature.RefTypeSig, Signature.ThrowableSig
- Enclosing interface:
Signature
public static sealed interface Signature.ClassTypeSig extends Signature.RefTypeSig, Signature.ThrowableSig
These are examples of class type signatures:
-
Lcom/example/Outer;forOuter
Has class namecom/example/Outerand no outer type or type argument. -
Lcom/example/Outer$Nested<TA;>;forOuter.Nested<A>
Has class namecom/example/Outer$Nestedrepresenting a nested class, no outer type, and a single type argument of type variableA. -
Lcom/example/GenericOuter<TA;>.Inner;forGenericOuter<A>.Inner
Has class nameInner, a simple class name, outer typeLcom/example/GenericOuter<TA;>;forGenericOuter<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 ..
- See Java Virtual Machine Specification:
- 4.7.9.1 Signatures
- Since:
- 24
- See Also:
Nested Class Summary
Nested classes/interfaces declared in interface Signature
Signature.ArrayTypeSig, Signature.BaseTypeSig, Signature.ClassTypeSig, Signature.RefTypeSig, Signature.ThrowableSig, Signature.TypeArg, Signature.TypeParam, Signature.TypeVarSig | Modifier and Type | Interface | Description |
|---|---|---|
static interface |
Signature.ArrayTypeSig |
Models the signature of an array type. |
static interface |
Signature.BaseTypeSig |
Models the signature of a primitive type (JLS §4.2) or void. |
static interface |
Signature.ClassTypeSig |
Models the signature of a possibly-parameterized class or interface type. |
static interface |
Signature.RefTypeSig |
Models the signature of a reference type, which may be a class, interface, type variable, or array type. |
static interface |
Signature.ThrowableSig |
Marker interface for a signature for a throwable type. |
static interface |
Signature.TypeArg |
Models a type argument, an argument to a type parameter. |
static interface |
Signature.TypeParam |
Models a signature for a type parameter of a generic class, interface, method, or constructor, which introduces a type variable. |
static interface |
Signature.TypeVarSig |
Models the signature of a type variable. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
default ClassDesc |
classDesc() |
Returns this class or interface, as a symbolic descriptor. |
String |
className() |
Returns the class or interface name; includes the slash-separated package name if there is no outer type. |
static Signature.ClassTypeSig |
of |
Deprecated, for removal: This API element is subject to removal in a future version. |
static Signature.ClassTypeSig |
of |
Returns a class type signature. |
static Signature.ClassTypeSig |
of |
Returns a class or interface signature without an outer type. |
static Signature.ClassTypeSig |
of |
Returns a class or interface signature without an outer type. |
Optional |
outerType() |
Returns the signature of the class that this class is a member of, only if this is a member class. |
List |
typeArgs() |
Returns the type arguments of this class or interface. |
Methods declared in interface Signature
signatureString | Modifier and Type | Method | Description |
|---|---|---|
String |
signatureString() |
Returns the raw signature string. |
Method Details
outerType
Optional<Signature.ClassTypeSig> outerType()
- Returns:
- the signature of the class that this class is a member of, only if this is a member class
- See Java Language Specification:
- 4.5 Parameterized Types
className
String className()
$ separators if there is no parameterized enclosing type.- Returns:
- the class or interface name; includes the slash-separated package name if there is no outer type
classDesc
default ClassDesc classDesc()
- Returns:
- this class or interface, as a symbolic descriptor
typeArgs
List<Signature.TypeArg> typeArgs()
- Returns:
- the type arguments of this class or interface
- See Java Language Specification:
- 4.5 Parameterized Types
of
static Signature.ClassTypeSig of(ClassDesc className, Signature.TypeArg... typeArgs)
- Parameters:
-
className- the name of the class or interface -
typeArgs- the type arguments - Returns:
- a class or interface signature without an outer type
- Throws:
-
IllegalArgumentException- ifclassNamedoes not represent a class or interface, or if it cannot be denoted
of
@Deprecated(since="26", forRemoval=true) static Signature.ClassTypeSig of(Signature.ClassTypeSig outerType, ClassDesc className, Signature.TypeArg... typeArgs)
className when outerType is not null. Use of(ClassTypeSig, String, TypeArg...) instead.- Parameters:
-
outerType- signature of the outer type, may benull -
className- the name of this class or interface -
typeArgs- the type arguments - Returns:
- a class or interface signature
- Throws:
-
IllegalArgumentException- ifclassNamedoes not represent a class or interface, or if it cannot be denoted
of
static Signature.ClassTypeSig of(String className, Signature.TypeArg... typeArgs)
- Parameters:
-
className- the name of the class or interface, may use/to separate -
typeArgs- the type arguments - Returns:
- a class or interface signature without an outer type
- Throws:
-
IllegalArgumentException- ifclassNamecannot be denoted
of
static Signature.ClassTypeSig of(Signature.ClassTypeSig outerType, String className, Signature.TypeArg... typeArgs)
- Parameters:
-
outerType- signature of the outer type, may benull -
className- the name of this class or interface, may use/to separate if outer type is absent -
typeArgs- the type arguments - Returns:
- a class type signature
- Throws:
-
IllegalArgumentException- ifclassNamecannot be denoted
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
classNamewhenouterTypeis not null.