Package org.objectweb.asm.signature

Examples of org.objectweb.asm.signature.SignatureVisitor


    @Override
    public SignatureVisitor visitInterface() {
        if (state != SUPER) {
            throw new IllegalStateException();
        }
        SignatureVisitor v = sv == null ? null : sv.visitInterface();
        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
    }
View Full Code Here


        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);
    }
View Full Code Here

        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;
    }
View Full Code Here

    @Override
    public SignatureVisitor visitExceptionType() {
        if (state != RETURN) {
            throw new IllegalStateException();
        }
        SignatureVisitor v = sv == null ? null : sv.visitExceptionType();
        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
    }
View Full Code Here

    public SignatureVisitor visitArrayType() {
        if (type != TYPE_SIGNATURE || state != EMPTY) {
            throw new IllegalStateException();
        }
        state = SIMPLE_TYPE;
        SignatureVisitor v = sv == null ? null : sv.visitArrayType();
        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
    }
View Full Code Here

            throw new IllegalStateException();
        }
        if ("+-=".indexOf(wildcard) == -1) {
            throw new IllegalArgumentException();
        }
        SignatureVisitor v = sv == null ? null : sv.visitTypeArgument(wildcard);
        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
    }
View Full Code Here

   */
  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();
  }
View Full Code Here

        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);
        }
View Full Code Here

   * @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();
  }
View Full Code Here

   * @return the setter signature {@code <T> void set(Object object, T value)}
   */
  private String setterSignature() {
    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 = writer.visitParameterType();
    sv.visitTypeVariable("T");

    sv.visitReturnType().visitBaseType('V');

    return writer.toString();
  }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.signature.SignatureVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.