Fields Summary |
---|
private final StringBuilder | mBufBuffer used to construct the signature. |
private final StringBuilder | mFormalsBufBuffer used to construct the formals signature. |
private boolean | mWritingFormalsIndicates if the signature is currently processing formal type parameters. |
private int | mArgumentStackStack used to keep track of class types that have arguments. Each element
of this stack is a boolean encoded in one bit. The top of the stack is
the lowest order bit. Pushing false = *2, pushing true = *2+1, popping =
/2. |
private SignatureSourcer | mReturnType{@link SignatureSourcer} generated when parsing the return type of this
signature. Initially null. |
private SignatureSourcer | mSuperClass{@link SignatureSourcer} generated when parsing the super class of this
signature. Initially null. |
private ArrayList | mParameters{@link SignatureSourcer}s for each parameters generated when parsing the method parameters
of this signature. Initially empty but not null. |
Methods Summary |
---|
private void | endArguments()Ends the type arguments of a class or inner class type.
if (mArgumentStack % 2 != 0) {
getBuf().append('>");
}
mArgumentStack /= 2;
|
private void | endFormals()Ends the formal type parameters section of the signature.
if (mWritingFormals) {
getBuf().append('>");
mWritingFormals = false;
}
|
public java.lang.String | formalsToString()
return mFormalsBuf.toString();
|
private java.lang.StringBuilder | getBuf()
if (mWritingFormals) {
return mFormalsBuf;
} else {
return mBuf;
}
|
public java.util.ArrayList | getParameters()Will be non-empty if a parameters were processed
by {@link SignatureReader#accept(SignatureVisitor)}
return mParameters;
|
public com.android.mkstubs.sourcer.SignatureSourcer | getReturnType()Will be non-null if a return type was processed
by {@link SignatureReader#accept(SignatureVisitor)}
return mReturnType;
|
public com.android.mkstubs.sourcer.SignatureSourcer | getSuperClass()Will be non-null if a super class was processed
by {@link SignatureReader#accept(SignatureVisitor)}
return mSuperClass;
|
public boolean | hasFormalsContent()True if the signature contains formal type parameters, which are available
via {@link #formalsToString()} after calling {@link SignatureReader#accept(SignatureVisitor)}
return mFormalsBuf.length() > 0;
|
public java.lang.String | toString()Contains the whole signature type when called by
{@link SignatureReader#acceptType(SignatureVisitor)} or just the formals if
called by {@link SignatureReader#accept(SignatureVisitor)}.
return mBuf.toString();
|
public org.objectweb.asm.signature.SignatureVisitor | visitArrayType()
getBuf().append('[");
return this;
|
public void | visitBaseType(char descriptor)
getBuf().append(Type.getType(Character.toString(descriptor)).getClassName());
|
public org.objectweb.asm.signature.SignatureVisitor | visitClassBound()
// we don't differentiate between visiting a sub class or interface type
return this;
|
public void | visitClassType(java.lang.String name)
getBuf().append(name.replace('/", '."));
mArgumentStack *= 2;
|
public void | visitEnd()
endArguments();
|
public org.objectweb.asm.signature.SignatureVisitor | visitExceptionType()
getBuf().append('^");
return this;
|
public void | visitFormalTypeParameter(java.lang.String name)
if (!mWritingFormals) {
mWritingFormals = true;
getBuf().append('<");
} else {
getBuf().append(", ");
}
getBuf().append(name);
getBuf().append(" extends ");
|
public void | visitInnerClassType(java.lang.String name)
endArguments();
getBuf().append('.");
getBuf().append(name.replace('/", '."));
mArgumentStack *= 2;
|
public org.objectweb.asm.signature.SignatureVisitor | visitInterface()
return this;
|
public org.objectweb.asm.signature.SignatureVisitor | visitInterfaceBound()
// we don't differentiate between visiting a sub class or interface type
return this;
|
public org.objectweb.asm.signature.SignatureVisitor | visitParameterType()
endFormals();
SignatureSourcer sourcer = new SignatureSourcer();
mParameters.add(sourcer);
return sourcer;
|
public org.objectweb.asm.signature.SignatureVisitor | visitReturnType()
endFormals();
SignatureSourcer sourcer = new SignatureSourcer();
assert mReturnType == null;
mReturnType = sourcer;
return sourcer;
|
public org.objectweb.asm.signature.SignatureVisitor | visitSuperclass()
endFormals();
SignatureSourcer sourcer = new SignatureSourcer();
assert mSuperClass == null;
mSuperClass = sourcer;
return sourcer;
|
public void | visitTypeArgument()
if (mArgumentStack % 2 == 0) {
++mArgumentStack;
getBuf().append('<");
} else {
getBuf().append(", ");
}
getBuf().append('*");
|
public org.objectweb.asm.signature.SignatureVisitor | visitTypeArgument(char wildcard)
if (mArgumentStack % 2 == 0) {
++mArgumentStack;
getBuf().append('<");
} else {
getBuf().append(", ");
}
if (wildcard != '=") {
if (wildcard == '+") {
getBuf().append("? extends ");
} else if (wildcard == '-") {
getBuf().append("? super ");
} else {
// can this happen?
getBuf().append(wildcard);
}
}
return this;
|
public void | visitTypeVariable(java.lang.String name)
getBuf().append(name.replace('/", '."));
|