コード例 #1
0
 public SignatureVisitor visitExceptionType() {
   if (state != RETURN) {
     throw new IllegalStateException();
   }
   SignatureVisitor v = sv == null ? null : sv.visitExceptionType();
   return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
 }
コード例 #2
0
 public SignatureVisitor visitInterfaceBound() {
   if (state != FORMAL && state != BOUND) {
     throw new IllegalArgumentException();
   }
   SignatureVisitor v = sv == null ? null : sv.visitInterfaceBound();
   return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
 }
コード例 #3
0
 public void visitTypeArgument() {
   if (state != CLASS_TYPE) {
     throw new IllegalStateException();
   }
   if (sv != null) {
     sv.visitTypeArgument();
   }
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 public SignatureVisitor visitClassBound() {
   if (state != FORMAL) {
     throw new IllegalStateException();
   }
   state = BOUND;
   SignatureVisitor v = sv == null ? null : sv.visitClassBound();
   return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
 }
コード例 #8
0
 public void visitEnd() {
   if (state != CLASS_TYPE) {
     throw new IllegalStateException();
   }
   state = END;
   if (sv != null) {
     sv.visitEnd();
   }
 }
コード例 #9
0
 public void visitInnerClassType(final String name) {
   if (state != CLASS_TYPE) {
     throw new IllegalStateException();
   }
   CheckMethodAdapter.checkIdentifier(name, "inner class name");
   if (sv != null) {
     sv.visitInnerClassType(name);
   }
 }
コード例 #10
0
 public void visitFormalTypeParameter(final String name) {
   if (type == TYPE_SIGNATURE || (state != EMPTY && state != FORMAL && state != BOUND)) {
     throw new IllegalStateException();
   }
   CheckMethodAdapter.checkIdentifier(name, "formal type parameter");
   state = FORMAL;
   if (sv != null) {
     sv.visitFormalTypeParameter(name);
   }
 }
コード例 #11
0
 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);
 }
コード例 #12
0
 public void visitClassType(final String name) {
   if (type != TYPE_SIGNATURE || state != EMPTY) {
     throw new IllegalStateException();
   }
   CheckMethodAdapter.checkInternalName(name, "class name");
   state = CLASS_TYPE;
   if (sv != null) {
     sv.visitClassType(name);
   }
 }
コード例 #13
0
 public void visitTypeVariable(final String name) {
   if (type != TYPE_SIGNATURE || state != EMPTY) {
     throw new IllegalStateException();
   }
   CheckMethodAdapter.checkIdentifier(name, "type variable");
   state = SIMPLE_TYPE;
   if (sv != null) {
     sv.visitTypeVariable(name);
   }
 }
コード例 #14
0
 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;
 }
コード例 #15
0
 public void visitBaseType(final char descriptor) {
   if (type != TYPE_SIGNATURE || state != EMPTY) {
     throw new IllegalStateException();
   }
   if (descriptor == 'V') {
     if (!canBeVoid) {
       throw new IllegalArgumentException();
     }
   } else {
     if ("ZCBSIFJD".indexOf(descriptor) == -1) {
       throw new IllegalArgumentException();
     }
   }
   state = SIMPLE_TYPE;
   if (sv != null) {
     sv.visitBaseType(descriptor);
   }
 }