Package javassist.bytecode
Class SignatureAttribute
java.lang.Object
javassist.bytecode.AttributeInfo
javassist.bytecode.SignatureAttribute
Signature_attribute
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Array types.static class
Primitive types.static class
Class signature.static class
Class types.static class
Method type signature.static class
Nested class types.static class
Class types, array types, and type variables.static class
Primitive types and object types.static class
Type argument.static class
Formal type parameters.static class
Type variables. -
Field Summary
-
Constructor Summary
ConstructorDescriptionSignatureAttribute
(ConstPool cp, String signature) Constructs aSignature
attribute. -
Method Summary
Modifier and TypeMethodDescriptionMakes a copy.Returns the generic signature indicated bysignature_index
.void
setSignature
(String sig) Setssignature_index
to the index of the given generic signature, which is added to a constant pool.toClassSignature
(String sig) Parses the given signature string as a class signature.toFieldSignature
(String sig) Parses the given signature string as a field type signature.toMethodSignature
(String sig) Parses the given signature string as a method type signature.static SignatureAttribute.Type
toTypeSignature
(String sig) Parses the given signature string as a type signature.Methods inherited from class javassist.bytecode.AttributeInfo
get, getConstPool, getName, length, set
-
Field Details
-
tag
The name of this attribute"Signature"
.- See Also:
-
-
Constructor Details
-
SignatureAttribute
Constructs aSignature
attribute.- Parameters:
cp
- a constant pool table.signature
- the signature represented by this attribute.
-
-
Method Details
-
getSignature
Returns the generic signature indicated bysignature_index
. -
setSignature
Setssignature_index
to the index of the given generic signature, which is added to a constant pool.- Parameters:
sig
- new signature.- Since:
- 3.11
-
copy
Makes a copy. Class names are replaced according to the givenMap
object.- Overrides:
copy
in classAttributeInfo
- Parameters:
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted class names.
-
toClassSignature
Parses the given signature string as a class signature.- Parameters:
sig
- the signature obtained from theSignatureAttribute
of aClassFile
.- Returns:
- a tree-like data structure representing a class signature. It provides convenient accessor methods.
- Throws:
BadBytecode
- thrown when a syntactical error is found.- Since:
- 3.5
- See Also:
-
toMethodSignature
Parses the given signature string as a method type signature.- Parameters:
sig
- the signature obtained from theSignatureAttribute
of aMethodInfo
.- Returns:
- Throws:
BadBytecode
- thrown when a syntactical error is found.- Since:
- 3.5
- See Also:
-
toFieldSignature
Parses the given signature string as a field type signature.- Parameters:
sig
- the signature string obtained from theSignatureAttribute
of aFieldInfo
.- Returns:
- the field type signature.
- Throws:
BadBytecode
- thrown when a syntactical error is found.- Since:
- 3.5
- See Also:
-
toTypeSignature
Parses the given signature string as a type signature. The type signature is either the field type signature or a base type descriptor includingvoid
type.- Throws:
BadBytecode
- thrown when a syntactical error is found.- Since:
- 3.18
-