use of org.objectweb.asm.signature.SignatureWriter in project cdap by caskdata.
the class Signatures method getFieldSignature.
public static String getFieldSignature(TypeToken<?> fieldType) {
SignatureWriter signWriter = new SignatureWriter();
signWriter.visitClassType(Type.getInternalName(fieldType.getRawType()));
if (fieldType.getType() instanceof ParameterizedType) {
for (java.lang.reflect.Type paramType : ((ParameterizedType) fieldType.getType()).getActualTypeArguments()) {
signWriter.visitTypeArgument(SignatureVisitor.INSTANCEOF);
visitTypeSignature(fieldType.resolveType(paramType), signWriter);
}
}
signWriter.visitEnd();
return signWriter.toString();
}
use of org.objectweb.asm.signature.SignatureWriter 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();
}
use of org.objectweb.asm.signature.SignatureWriter 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.SignatureWriter in project platform_frameworks_base by android.
the class AbstractClassAdapter method renameTypeSignature.
/**
* Renames the ClassSignature handled by ClassVisitor.visit
* or the MethodTypeSignature handled by ClassVisitor.visitMethod.
*/
String renameTypeSignature(String sig) {
if (sig == null) {
return null;
}
SignatureReader reader = new SignatureReader(sig);
SignatureWriter writer = new SignatureWriter();
reader.accept(new RenameSignatureAdapter(writer));
sig = writer.toString();
return sig;
}
use of org.objectweb.asm.signature.SignatureWriter in project android_frameworks_base by ParanoidAndroid.
the class RenameClassAdapter method renameTypeSignature.
/**
* Renames the ClassSignature handled by ClassVisitor.visit
* or the MethodTypeSignature handled by ClassVisitor.visitMethod.
*/
String renameTypeSignature(String sig) {
if (sig == null) {
return null;
}
SignatureReader reader = new SignatureReader(sig);
SignatureWriter writer = new SignatureWriter();
reader.accept(new RenameSignatureAdapter(writer));
sig = writer.toString();
return sig;
}
Aggregations