jdk.internal.org.objectweb.asm.signature.SignatureVisitor Java Examples

The following examples show how to use jdk.internal.org.objectweb.asm.signature.SignatureVisitor. 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: TraceSignatureVisitor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public SignatureVisitor visitTypeArgument(final char tag) {
    if (argumentStack % 2 == 0) {
        ++argumentStack;
        declaration.append('<');
    } else {
        declaration.append(", ");
    }

    if (tag == EXTENDS) {
        declaration.append("? extends ");
    } else if (tag == SUPER) {
        declaration.append("? super ");
    }

    startType();
    return this;
}
 
Example #2
Source File: TraceSignatureVisitor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public SignatureVisitor visitTypeArgument(final char tag) {
    if (argumentStack % 2 == 0) {
        ++argumentStack;
        declaration.append('<');
    } else {
        declaration.append(", ");
    }

    if (tag == EXTENDS) {
        declaration.append("? extends ");
    } else if (tag == SUPER) {
        declaration.append("? super ");
    }

    startType();
    return this;
}
 
Example #3
Source File: TraceSignatureVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitExceptionType() {
    if (exceptions == null) {
        exceptions = new StringBuffer();
    } else {
        exceptions.append(", ");
    }
    // startType();
    return new TraceSignatureVisitor(exceptions);
}
 
Example #4
Source File: CheckSignatureAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitInterfaceBound() {
    if (state != FORMAL && state != BOUND) {
        throw new IllegalArgumentException();
    }
    SignatureVisitor v = sv == null ? null : sv.visitInterfaceBound();
    return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
 
Example #5
Source File: TraceSignatureVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitExceptionType() {
    if (exceptions == null) {
        exceptions = new StringBuffer();
    } else {
        exceptions.append(", ");
    }
    // startType();
    return new TraceSignatureVisitor(exceptions);
}
 
Example #6
Source File: CheckSignatureAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #7
Source File: CheckSignatureAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitExceptionType() {
    if (state != RETURN) {
        throw new IllegalStateException();
    }
    SignatureVisitor v = sv == null ? null : sv.visitExceptionType();
    return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
 
Example #8
Source File: CheckSignatureAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #9
Source File: TraceSignatureVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitInterface() {
    separator = seenInterface ? ", " : isInterface ? " extends "
            : " implements ";
    seenInterface = true;
    startType();
    return this;
}
 
Example #10
Source File: TraceSignatureVisitor.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitInterface() {
    separator = seenInterface ? ", " : isInterface ? " extends "
            : " implements ";
    seenInterface = true;
    startType();
    return this;
}
 
Example #11
Source File: TraceSignatureVisitor.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitParameterType() {
    endFormals();
    if (seenParameter) {
        declaration.append(", ");
    } else {
        seenParameter = true;
        declaration.append('(');
    }
    startType();
    return this;
}
 
Example #12
Source File: TraceSignatureVisitor.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitReturnType() {
    endFormals();
    if (seenParameter) {
        seenParameter = false;
    } else {
        declaration.append('(');
    }
    declaration.append(')');
    returnType = new StringBuffer();
    return new TraceSignatureVisitor(returnType);
}
 
Example #13
Source File: TraceSignatureVisitor.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitExceptionType() {
    if (exceptions == null) {
        exceptions = new StringBuffer();
    } else {
        exceptions.append(", ");
    }
    // startType();
    return new TraceSignatureVisitor(exceptions);
}
 
Example #14
Source File: CheckSignatureAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitTypeArgument(final char wildcard) {
    if (state != CLASS_TYPE) {
        throw new IllegalStateException();
    }
    if ("+-=".indexOf(wildcard) == -1) {
        throw new IllegalArgumentException();
    }
    SignatureVisitor v = sv == null ? null : sv.visitTypeArgument(wildcard);
    return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
 
Example #15
Source File: CheckSignatureAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #16
Source File: TraceSignatureVisitor.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitSuperclass() {
    endFormals();
    separator = " extends ";
    startType();
    return this;
}
 
Example #17
Source File: TraceSignatureVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitSuperclass() {
    endFormals();
    separator = " extends ";
    startType();
    return this;
}
 
Example #18
Source File: TraceSignatureVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitInterface() {
    separator = seenInterface ? ", " : isInterface ? " extends "
            : " implements ";
    seenInterface = true;
    startType();
    return this;
}
 
Example #19
Source File: TraceSignatureVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitParameterType() {
    endFormals();
    if (seenParameter) {
        declaration.append(", ");
    } else {
        seenParameter = true;
        declaration.append('(');
    }
    startType();
    return this;
}
 
Example #20
Source File: TraceSignatureVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitSuperclass() {
    endFormals();
    separator = " extends ";
    startType();
    return this;
}
 
Example #21
Source File: TraceSignatureVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitInterfaceBound() {
    separator = seenInterfaceBound ? ", " : " extends ";
    seenInterfaceBound = true;
    startType();
    return this;
}
 
Example #22
Source File: CheckSignatureAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitTypeArgument(final char wildcard) {
    if (state != CLASS_TYPE) {
        throw new IllegalStateException();
    }
    if ("+-=".indexOf(wildcard) == -1) {
        throw new IllegalArgumentException();
    }
    SignatureVisitor v = sv == null ? null : sv.visitTypeArgument(wildcard);
    return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
 
Example #23
Source File: Remapper.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 * @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();
}
 
Example #24
Source File: CheckSignatureAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitTypeArgument(final char wildcard) {
    if (state != CLASS_TYPE) {
        throw new IllegalStateException();
    }
    if ("+-=".indexOf(wildcard) == -1) {
        throw new IllegalArgumentException();
    }
    SignatureVisitor v = sv == null ? null : sv.visitTypeArgument(wildcard);
    return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
 
Example #25
Source File: CheckSignatureAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitExceptionType() {
    if (state != RETURN) {
        throw new IllegalStateException();
    }
    SignatureVisitor v = sv == null ? null : sv.visitExceptionType();
    return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
 
Example #26
Source File: CheckSignatureAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #27
Source File: CheckSignatureAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitInterfaceBound() {
    if (state != FORMAL && state != BOUND) {
        throw new IllegalArgumentException();
    }
    SignatureVisitor v = sv == null ? null : sv.visitInterfaceBound();
    return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
}
 
Example #28
Source File: CheckSignatureAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #29
Source File: TraceSignatureVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitInterfaceBound() {
    separator = seenInterfaceBound ? ", " : " extends ";
    seenInterfaceBound = true;
    startType();
    return this;
}
 
Example #30
Source File: CheckSignatureAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SignatureVisitor visitReturnType() {
    if (type != METHOD_SIGNATURE
            || (state & (EMPTY | FORMAL | BOUND | PARAM)) == 0) {
        throw new IllegalArgumentException();
    }
    state = RETURN;
    SignatureVisitor v = sv == null ? null : sv.visitReturnType();
    CheckSignatureAdapter cv = new CheckSignatureAdapter(TYPE_SIGNATURE, v);
    cv.canBeVoid = true;
    return cv;
}