Package org.objectweb.asm.signature
Class SignatureReader
java.lang.Object
org.objectweb.asm.signature.SignatureReader
A parser for signature literals, as defined in the Java Virtual Machine Specification (JVMS), to
visit them with a SignatureVisitor.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intMaximum recursion level forparseType(java.lang.String, int, org.objectweb.asm.signature.SignatureVisitor, int).private final StringThe JVMS signature to be read. -
Constructor Summary
ConstructorsConstructorDescriptionSignatureReader(String signature) Constructs aSignatureReaderfor the given signature. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(SignatureVisitor signatureVistor) Makes the given visitor visit the signature of thisSignatureReader.voidacceptType(SignatureVisitor signatureVisitor) Makes the given visitor visit the signature of thisSignatureReader.private static intparseType(String signature, int offset, SignatureVisitor visitor, int depthLimit) Parses a JavaTypeSignature and makes the given visitor visit it.
-
Field Details
-
MAX_DEPTH
private static final int MAX_DEPTHMaximum recursion level forparseType(java.lang.String, int, org.objectweb.asm.signature.SignatureVisitor, int).- See Also:
-
signatureValue
The JVMS signature to be read.
-
-
Constructor Details
-
SignatureReader
Constructs aSignatureReaderfor the given signature.- Parameters:
signature- A JavaTypeSignature, ClassSignature or MethodSignature.
-
-
Method Details
-
accept
Makes the given visitor visit the signature of thisSignatureReader. This signature is the one specified in the constructor (seeSignatureReader(java.lang.String)). This method is intended to be called on aSignatureReaderthat was created using a ClassSignature (such as thesignatureparameter of theClassVisitor.visit(int, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[])method) or a MethodSignature (such as thesignatureparameter of theClassVisitor.visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[])method).- Parameters:
signatureVistor- the visitor that must visit this signature.- Throws:
LimitExceededException- if there are more than 256 levels of nested type arguments.
-
acceptType
Makes the given visitor visit the signature of thisSignatureReader. This signature is the one specified in the constructor (seeSignatureReader(java.lang.String)). This method is intended to be called on aSignatureReaderthat was created using a JavaTypeSignature, such as thesignatureparameter of theClassVisitor.visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object)orMethodVisitor.visitLocalVariable(java.lang.String, java.lang.String, java.lang.String, org.objectweb.asm.Label, org.objectweb.asm.Label, int)methods.- Parameters:
signatureVisitor- the visitor that must visit this signature.- Throws:
LimitExceededException- if there are more than 256 levels of nested type arguments.
-
parseType
private static int parseType(String signature, int offset, SignatureVisitor visitor, int depthLimit) Parses a JavaTypeSignature and makes the given visitor visit it.- Parameters:
signature- a string containing the signature that must be parsed.offset- index of the first character of the signature to parsed.visitor- the visitor that must visit this signature.depthLimit- the maximum allowed depth for further recursive calls.- Returns:
- the index of the first character after the parsed signature.
-