|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.claritysys.jvm.disassembler.Signature
public final class Signature
A parser for type and method signatures.
Single threaded, reuse to save memory.
Create a new Signature, then call setSignature (String sig) to set the active signature. This will result in the passed signature being parsed and stored into local fields.
isMethod returns true if the signature was a method signature, if so call getReturnType, getParameterCount, and getParameter (int param) to access the different pieces.
If isMethod returns false it was a simple type declaration. If so call getType to access the type.
As it parses it will encounter object types, such as java/lang/String, and it needs to know how to format these. You can register a single NameFormatListener for such a purpose.
| Nested Class Summary | |
|---|---|
static interface |
Signature.TypeFormatter
A listener interface. |
| Constructor Summary | |
|---|---|
Signature(Signature.TypeFormatter formatter)
Create a new Signature parse using the given (possibly null) type formatter. |
|
| Method Summary | |
|---|---|
java.lang.String |
getParameter(int n)
Get the nth parameter. |
int |
getParameterCount()
How many parameters does the method take? |
java.lang.String |
getType()
What is the field type or method return type? |
boolean |
hasMore()
Return true if there is more signature to parse. |
boolean |
isMethod()
Is it a method? |
void |
parseType()
Parse a single type declaration. |
void |
setSignature(java.lang.String sig)
Set the signature and parse into pieces. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Signature(Signature.TypeFormatter formatter)
| Method Detail |
|---|
public void setSignature(java.lang.String sig)
public void parseType()
public boolean hasMore()
public boolean isMethod()
public java.lang.String getType()
public int getParameterCount()
public java.lang.String getParameter(int n)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||