Package javassist.bytecode
Class SignatureAttribute.TypeArgument
- java.lang.Object
-
- javassist.bytecode.SignatureAttribute.TypeArgument
-
- Enclosing class:
- SignatureAttribute
public static class SignatureAttribute.TypeArgument extends java.lang.Object
Type argument.- See Also:
SignatureAttribute.TypeParameter
-
-
Field Summary
Fields Modifier and Type Field Description (package private) SignatureAttribute.ObjectType
arg
(package private) char
wildcard
-
Constructor Summary
Constructors Constructor Description TypeArgument()
Constructs aTypeArgument
representing<?>
.TypeArgument(SignatureAttribute.ObjectType t)
Constructs aTypeArgument
.TypeArgument(SignatureAttribute.ObjectType a, char w)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
encode(java.lang.StringBuilder sb, SignatureAttribute.TypeArgument[] args)
char
getKind()
Returns the kind of this type argument.SignatureAttribute.ObjectType
getType()
Returns the type represented by this argument if the argument is not a wildcard type.boolean
isWildcard()
Returns true if this type argument is a wildcard type such as?
,? extends String
, or? super Integer
.static SignatureAttribute.TypeArgument
subclassOf(SignatureAttribute.ObjectType t)
A factory method constructing aTypeArgument
with an upper bound.static SignatureAttribute.TypeArgument
superOf(SignatureAttribute.ObjectType t)
A factory method constructing aTypeArgument
with an lower bound.java.lang.String
toString()
Returns the string representation.
-
-
-
Field Detail
-
arg
SignatureAttribute.ObjectType arg
-
wildcard
char wildcard
-
-
Constructor Detail
-
TypeArgument
TypeArgument(SignatureAttribute.ObjectType a, char w)
-
TypeArgument
public TypeArgument(SignatureAttribute.ObjectType t)
Constructs aTypeArgument
. A type argument is<String>
,<int[]>
, or a type variable<T>
, etc.- Parameters:
t
- a class type, an array type, or a type variable.
-
TypeArgument
public TypeArgument()
Constructs aTypeArgument
representing<?>
.
-
-
Method Detail
-
subclassOf
public static SignatureAttribute.TypeArgument subclassOf(SignatureAttribute.ObjectType t)
A factory method constructing aTypeArgument
with an upper bound. It represents<? extends ... >
- Parameters:
t
- an upper bound type.
-
superOf
public static SignatureAttribute.TypeArgument superOf(SignatureAttribute.ObjectType t)
A factory method constructing aTypeArgument
with an lower bound. It represents<? super ... >
- Parameters:
t
- an lower bbound type.
-
getKind
public char getKind()
Returns the kind of this type argument.- Returns:
' '
(not-wildcard),'*'
(wildcard),'+'
(wildcard with upper bound), or'-'
(wildcard with lower bound).
-
isWildcard
public boolean isWildcard()
Returns true if this type argument is a wildcard type such as?
,? extends String
, or? super Integer
.
-
getType
public SignatureAttribute.ObjectType getType()
Returns the type represented by this argument if the argument is not a wildcard type. Otherwise, this method returns the upper bound (if the kind is '+'), the lower bound (if the kind is '-'), or null (if the upper or lower bound is not specified).
-
toString
public java.lang.String toString()
Returns the string representation.- Overrides:
toString
in classjava.lang.Object
-
encode
static void encode(java.lang.StringBuilder sb, SignatureAttribute.TypeArgument[] args)
-
-