Package org.aspectj.util.GenericSignature

Examples of org.aspectj.util.GenericSignature.SimpleClassTypeSignature


    }
  }

  // L PackageSpecifier* SimpleClassTypeSignature ClassTypeSignature* ;
  private ClassTypeSignature parseClassTypeSignature() {
    SimpleClassTypeSignature outerType = null;
    SimpleClassTypeSignature[] nestedTypes = new SimpleClassTypeSignature[0];
    StringBuffer ret = new StringBuffer();
    String identifier = eatIdentifier();
    ret.append(identifier);
    while (maybeEat("/")) {
      ret.append("/"); // dont forget this...
      ret.append(eatIdentifier());
    }
    identifier = ret.toString();
    // now we have either a "." indicating the start of a nested type,
    // or a "<" indication type arguments, or ";" and we are done.
    while (!maybeEat(";")) {
      if (maybeEat(".")) {
        // outer type completed
        outerType = new SimpleClassTypeSignature(identifier);
        List nestedTypeList = new ArrayList();
        do {
          ret.append(".");
          SimpleClassTypeSignature sig = parseSimpleClassTypeSignature();
          ret.append(sig.toString());
          nestedTypeList.add(sig);
        } while (maybeEat("."));
        nestedTypes = new SimpleClassTypeSignature[nestedTypeList.size()];
        nestedTypeList.toArray(nestedTypes);
      } else if (tokenStream[tokenIndex].equals("<")) {
        ret.append("<");
        TypeArgument[] tArgs = maybeParseTypeArguments();
        for (int i = 0; i < tArgs.length; i++) {
          ret.append(tArgs[i].toString());
        }
        ret.append(">");
        outerType = new SimpleClassTypeSignature(identifier, tArgs);
        // now parse possible nesteds...
        List nestedTypeList = new ArrayList();
        while (maybeEat(".")) {
          ret.append(".");
          SimpleClassTypeSignature sig = parseSimpleClassTypeSignature();
          ret.append(sig.toString());
          nestedTypeList.add(sig);
        }
        nestedTypes = new SimpleClassTypeSignature[nestedTypeList.size()];
        nestedTypeList.toArray(nestedTypes);
      } else {
        throw new IllegalStateException("Expecting .,<, or ;, but found " + tokenStream[tokenIndex] + " while unpacking "
            + inputString);
      }
    }
    ret.append(";");
    if (outerType == null)
      outerType = new SimpleClassTypeSignature(ret.toString());
    return new ClassTypeSignature(ret.toString(), outerType, nestedTypes);
  }
View Full Code Here


  private SimpleClassTypeSignature parseSimpleClassTypeSignature() {
    String identifier = eatIdentifier();
    TypeArgument[] tArgs = maybeParseTypeArguments();
    if (tArgs != null) {
      return new SimpleClassTypeSignature(identifier, tArgs);
    } else {
      return new SimpleClassTypeSignature(identifier);
    }
  }
View Full Code Here

    }
    sig.append(";");

    // now look for any type parameters.
    // I *think* we only need to worry about the 'right-most' type...
    SimpleClassTypeSignature innerType = aClassTypeSignature.outerType;
    if (aClassTypeSignature.nestedTypes.length > 0) {
      innerType = aClassTypeSignature.nestedTypes[aClassTypeSignature.nestedTypes.length - 1];
    }
    if (innerType.typeArguments.length > 0) {
      // we have to create a parameterized type
View Full Code Here

    }
  }

  // L PackageSpecifier* SimpleClassTypeSignature ClassTypeSignature* ;
  private ClassTypeSignature parseClassTypeSignature() {
    SimpleClassTypeSignature outerType = null;
    SimpleClassTypeSignature[] nestedTypes = new SimpleClassTypeSignature[0];
    StringBuffer ret = new StringBuffer();
    String identifier = eatIdentifier();
    ret.append(identifier);
    while (maybeEat("/")) {
      ret.append("/"); // dont forget this...
      ret.append(eatIdentifier());
    }
    identifier = ret.toString();
    // now we have either a "." indicating the start of a nested type,
    // or a "<" indication type arguments, or ";" and we are done.
    while (!maybeEat(";")) {
      if (maybeEat(".")) {
        // outer type completed
        outerType = new SimpleClassTypeSignature(identifier);
        List<SimpleClassTypeSignature> nestedTypeList = new ArrayList<SimpleClassTypeSignature>();
        do {
          ret.append(".");
          SimpleClassTypeSignature sig = parseSimpleClassTypeSignature();
          ret.append(sig.toString());
          nestedTypeList.add(sig);
        } while (maybeEat("."));
        nestedTypes = new SimpleClassTypeSignature[nestedTypeList.size()];
        nestedTypeList.toArray(nestedTypes);
      } else if (tokenStream[tokenIndex].equals("<")) {
        ret.append("<");
        TypeArgument[] tArgs = maybeParseTypeArguments();
        for (int i = 0; i < tArgs.length; i++) {
          ret.append(tArgs[i].toString());
        }
        ret.append(">");
        outerType = new SimpleClassTypeSignature(identifier, tArgs);
        // now parse possible nesteds...
        List<SimpleClassTypeSignature> nestedTypeList = new ArrayList<SimpleClassTypeSignature>();
        while (maybeEat(".")) {
          ret.append(".");
          SimpleClassTypeSignature sig = parseSimpleClassTypeSignature();
          ret.append(sig.toString());
          nestedTypeList.add(sig);
        }
        nestedTypes = new SimpleClassTypeSignature[nestedTypeList.size()];
        nestedTypeList.toArray(nestedTypes);
      } else {
        throw new IllegalStateException("Expecting .,<, or ;, but found " + tokenStream[tokenIndex] + " while unpacking "
            + inputString);
      }
    }
    ret.append(";");
    if (outerType == null)
      outerType = new SimpleClassTypeSignature(ret.toString());
    return new ClassTypeSignature(ret.toString(), outerType, nestedTypes);
  }
View Full Code Here

  private SimpleClassTypeSignature parseSimpleClassTypeSignature() {
    String identifier = eatIdentifier();
    TypeArgument[] tArgs = maybeParseTypeArguments();
    if (tArgs != null) {
      return new SimpleClassTypeSignature(identifier, tArgs);
    } else {
      return new SimpleClassTypeSignature(identifier);
    }
  }
View Full Code Here

    }
    sig.append(";");

    // now look for any type parameters.
    // I *think* we only need to worry about the 'right-most' type...
    SimpleClassTypeSignature innerType = aClassTypeSignature.outerType;
    if (aClassTypeSignature.nestedTypes.length > 0) {
      innerType = aClassTypeSignature.nestedTypes[aClassTypeSignature.nestedTypes.length - 1];
    }
    if (innerType.typeArguments.length > 0) {
      // we have to create a parameterized type
View Full Code Here

TOP

Related Classes of org.aspectj.util.GenericSignature.SimpleClassTypeSignature

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.