use of org.objectweb.asm.signature.SignatureVisitor in project bytecode-viewer by Konloch.
the class Remapper method mapSignature.
/**
*
* @param typeSignature
* true if signature is a FieldTypeSignature, such as the
* signature parameter of the ClassVisitor.visitField or
* MethodVisitor.visitLocalVariable methods
*/
public String mapSignature(String signature, boolean typeSignature) {
if (signature == null) {
return null;
}
SignatureReader r = new SignatureReader(signature);
SignatureWriter w = new SignatureWriter();
SignatureVisitor a = createRemappingSignatureAdapter(w);
if (typeSignature) {
r.acceptType(a);
} else {
r.accept(a);
}
return w.toString();
}
use of org.objectweb.asm.signature.SignatureVisitor in project bytecode-viewer by Konloch.
the class CheckSignatureAdapter method visitParameterType.
// method signatures
@Override
public SignatureVisitor visitParameterType() {
if (type != METHOD_SIGNATURE || (state & (EMPTY | FORMAL | BOUND | PARAM)) == 0) {
throw new IllegalArgumentException();
}
state = PARAM;
SignatureVisitor v = sv == null ? null : sv.visitParameterType();
return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
use of org.objectweb.asm.signature.SignatureVisitor in project bytecode-viewer by Konloch.
the class CheckSignatureAdapter method visitSuperclass.
// class signatures
@Override
public SignatureVisitor visitSuperclass() {
if (type != CLASS_SIGNATURE || (state & (EMPTY | FORMAL | BOUND)) == 0) {
throw new IllegalArgumentException();
}
state = SUPER;
SignatureVisitor v = sv == null ? null : sv.visitSuperclass();
return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
use of org.objectweb.asm.signature.SignatureVisitor in project bytecode-viewer by Konloch.
the class CheckSignatureAdapter method visitClassBound.
@Override
public SignatureVisitor visitClassBound() {
if (state != FORMAL) {
throw new IllegalStateException();
}
state = BOUND;
SignatureVisitor v = sv == null ? null : sv.visitClassBound();
return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
use of org.objectweb.asm.signature.SignatureVisitor in project cdap by caskdata.
the class FieldAccessorGenerator method getterSignature.
/**
* @return the getter signature {@code <T> T get(Object object)}
*/
private String getterSignature() {
SignatureWriter writer = new SignatureWriter();
writer.visitFormalTypeParameter("T");
SignatureVisitor sv = writer.visitClassBound();
sv.visitClassType(Type.getInternalName(Object.class));
sv.visitEnd();
sv = writer.visitParameterType();
sv.visitClassType(Type.getInternalName(Object.class));
sv.visitEnd();
sv = sv.visitReturnType();
sv.visitTypeVariable("T");
return writer.toString();
}
Aggregations