use of org.objectweb.asm.signature.SignatureWriter in project buck by facebook.
the class SignatureFactory method getSignature.
/**
* Returns the type signature of the given element. If none is required by the VM spec, returns
* null.
*/
@Nullable
public String getSignature(Element element) {
SignatureWriter writer = new SignatureWriter();
element.accept(elementVisitorAdapter, writer);
String result = writer.toString();
return result.isEmpty() ? null : result;
}
use of org.objectweb.asm.signature.SignatureWriter in project android_frameworks_base by ParanoidAndroid.
the class RenameClassAdapter method renameFieldSignature.
/**
* Renames the FieldTypeSignature handled by ClassVisitor.visitField
* or MethodVisitor.visitLocalVariable.
*/
String renameFieldSignature(String sig) {
if (sig == null) {
return null;
}
SignatureReader reader = new SignatureReader(sig);
SignatureWriter writer = new SignatureWriter();
reader.acceptType(new RenameSignatureAdapter(writer));
sig = writer.toString();
return sig;
}
use of org.objectweb.asm.signature.SignatureWriter in project android_frameworks_base by ResurrectionRemix.
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 AOSPA.
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 cdap by caskdata.
the class HttpHandlerGenerator method getClassSignature.
/**
* Generates the class signature of the generate class. The generated class is not parameterized, however
* it extends from {@link AbstractHttpHandlerDelegator} with parameterized type of the user http handler.
*
* @param delegateType Type of the user http handler
* @return The signature string
*/
private String getClassSignature(TypeToken<?> delegateType) {
SignatureWriter writer = new SignatureWriter();
// Construct the superclass signature as "AbstractHttpHandlerDelegator<UserHandlerClass>"
SignatureVisitor sv = writer.visitSuperclass();
sv.visitClassType(Type.getInternalName(AbstractHttpHandlerDelegator.class));
SignatureVisitor tv = sv.visitTypeArgument('=');
tv.visitClassType(Type.getInternalName(delegateType.getRawType()));
tv.visitEnd();
sv.visitEnd();
return writer.toString();
}
Aggregations