Package japa.parser.ast.type

Examples of japa.parser.ast.type.Type


                fullTypeParameters.add(currentTypeParam);
            }
        }

        // Compute the return type
        final Type rt = methodDeclaration.getType();
        returnType = JavaParserUtils.getJavaType(compilationUnitServices, rt,
                fullTypeParameters);

        // Compute the method name
        methodName = new JavaSymbolName(methodDeclaration.getName());

        // Get the body
        body = methodDeclaration.getBody() == null ? null : methodDeclaration
                .getBody().toString();
        if (body != null) {
            body = StringUtils.replace(body, "{", "", 1);
            body = body.substring(0, body.lastIndexOf("}"));
        }

        // Lookup the parameters and their names
        if (methodDeclaration.getParameters() != null) {
            for (final Parameter p : methodDeclaration.getParameters()) {
                final Type pt = p.getType();
                final JavaType parameterType = JavaParserUtils.getJavaType(
                        compilationUnitServices, pt, fullTypeParameters);
                final List<AnnotationExpr> annotationsList = p.getAnnotations();
                final List<AnnotationMetadata> annotations = new ArrayList<AnnotationMetadata>();
                if (annotationsList != null) {
View Full Code Here


            return new EnumAttributeValue(annotationName, enumDetails);
        }

        if (expression instanceof ClassExpr) {
            final ClassExpr clazz = (ClassExpr) expression;
            final Type nameToFind = clazz.getType();
            final JavaType javaType = JavaParserUtils.getJavaType(
                    compilationUnitServices, nameToFind, null);
            return new ClassAttributeValue(annotationName, javaType);
        }
View Full Code Here

  private void printTypeArgs(List<Type> args, Object arg) {
    if (args != null) {
      printer.print("&lt;");
      for (Iterator<Type> i = args.iterator(); i.hasNext();) {
        Type t = i.next();
        t.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
      printer.print("&gt;");
View Full Code Here

    for (BodyDeclaration b : members) {
      if (b instanceof FieldDeclaration) {
        FieldDeclaration f = (FieldDeclaration) b;
        if(includeStaticProperties || !Modifier.isStatic(f.getModifiers())) {
          for (VariableDeclarator d : f.getVariables()) {
            Type type = f.getType();
            String name = d.getId().getName();
            addInfosFor(properties, InfosTypes.FIELD, name, type);
          }
        }
      } else if (b instanceof MethodDeclaration) {
View Full Code Here

    private void printTypeArgs(List<Type> args, Object arg) {
        if (args != null) {
            printer.print("<");
            for (Iterator<Type> i = args.iterator(); i.hasNext();) {
                Type t = i.next();
                t.accept(this, arg);
                if (i.hasNext()) {
                    printer.print(", ");
                }
            }
            printer.print(">");
View Full Code Here

/*
* Type, name and expression syntax follows.
*/
    final public Type Type() throws ParseException {
        Type ret;
        if (jj_2_11(2)) {
            ret = ReferenceType();
        } else {
            switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case BOOLEAN:
View Full Code Here

        }
        throw new Error("Missing return statement in function");
    }

    final public ReferenceType ReferenceType() throws ParseException {
        Type type;
        int arrayCount = 0;
        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case BOOLEAN:
            case BYTE:
            case CHAR:
            case DOUBLE:
            case FLOAT:
            case INT:
            case LONG:
            case SHORT:
                type = PrimitiveType();
                label_19: while (true) {
                    jj_consume_token(LBRACKET);
                    jj_consume_token(RBRACKET);
                    arrayCount++;
                    if (jj_2_12(2)) {
                        ;
                    } else {
                        break label_19;
                    }
                }
                break;
            case IDENTIFIER:
                type = ClassOrInterfaceType();
                label_20: while (true) {
                    if (jj_2_13(2)) {
                        ;
                    } else {
                        break label_20;
                    }
                    jj_consume_token(LBRACKET);
                    jj_consume_token(RBRACKET);
                    arrayCount++;
                }
                break;
            default:
                jj_la1[51] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
        }
        {
            if (true) {
                return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount);
            }
        }
        throw new Error("Missing return statement in function");
    }
View Full Code Here

        throw new Error("Missing return statement in function");
    }

    final public List TypeArguments() throws ParseException {
        List ret = new LinkedList();
        Type type;
        jj_consume_token(LT);
        ret.add(new int[] { token.beginLine, token.beginColumn });
        type = TypeArgument();
        ret.add(type);
        label_22: while (true) {
View Full Code Here

        }
        throw new Error("Missing return statement in function");
    }

    final public Type TypeArgument() throws ParseException {
        Type ret;
        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case BOOLEAN:
            case BYTE:
            case CHAR:
            case DOUBLE:
View Full Code Here

        }
        throw new Error("Missing return statement in function");
    }

    final public Type ResultType() throws ParseException {
        Type ret;
        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case VOID:
                jj_consume_token(VOID);
                ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn);
                break;
View Full Code Here

TOP

Related Classes of japa.parser.ast.type.Type

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.