org.objectweb.asm.util.TraceSignatureVisitor Java Examples

The following examples show how to use org.objectweb.asm.util.TraceSignatureVisitor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaUtils.java    From jaxrs-analyzer with Apache License 2.0 5 votes vote down vote up
/**
 * Converts the given type signature to a human readable type string.
 * <p>
 * Example: {@code Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>; -> java.util.Map<java.lang.String, java.lang.String>}
 */
public static String toReadableType(final String type) {
    final SignatureReader reader = new SignatureReader(type);
    final TraceSignatureVisitor visitor = new TraceSignatureVisitor(0);
    reader.acceptType(visitor);
    return visitor.getDeclaration();
}
 
Example #2
Source File: ExtraTextifier.java    From TickDynamic with MIT License 5 votes vote down vote up
@Override
public void visitLocalVariable(final String name, final String desc,
        final String signature, final Label start, final Label end,
        final int index) {
    buf.setLength(0);
    
    if (signature != null) {
        buf.append(tab2);
        appendDescriptor(FIELD_SIGNATURE, signature);

        TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
        SignatureReader r = new SignatureReader(signature);
        r.acceptType(sv);
        buf.append(tab2).append("// declaration: ")
                .append(sv.getDeclaration()).append('\n');
    }
    
    buf.append(tab2).append("LOCALVARIABLE ").append(name).append(' ');
    appendDescriptor(FIELD_DESCRIPTOR, desc);
    buf.append(' ');
    appendLabel(start);
    buf.append(' ');
    appendLabel(end);
    buf.append(' ').append(index).append('\n');

    text.add(buf.toString());
}
 
Example #3
Source File: MethodRecord.java    From pitest-descartes with GNU Lesser General Public License v3.0 4 votes vote down vote up
public String getDeclaration() {

        TraceSignatureVisitor visitor = new TraceSignatureVisitor(0);
        new SignatureReader(getDesc()).accept(visitor);
        return getName() + visitor.getDeclaration();
    }
 
Example #4
Source File: MethodRecord.java    From pitest-descartes with GNU Lesser General Public License v3.0 4 votes vote down vote up
public String getReturnType() {
    TraceSignatureVisitor visitor = new TraceSignatureVisitor(0);
    new SignatureReader(getDesc()).accept(visitor);
    return visitor.getReturnType();
}