Package javax.lang.model.element

Examples of javax.lang.model.element.VariableElement.asType()


            } else if (embedded(field)) {
              System.out.println("embedded");
              System.out.println("field = " + field);
              embeds.add(new Field(encodeEmbedName(field), field.getSimpleName().toString()));
            } else if (reference(field)) {
              references.add(new Field(field.asType().toString(), field.getSimpleName().toString()));
            }
          }
        }
      }
      typeElement = (TypeElement) processingEnv.getTypeUtils().asElement(typeElement.getSuperclass());
View Full Code Here


      List<? extends Element> enclosedElements = typeElement.getEnclosedElements();
      for (Element enclosedElement : enclosedElements) {
        if (enclosedElement instanceof VariableElement) {
          VariableElement field = (VariableElement) enclosedElement;
          if (validField(field)) {
            fields.add(new Field(field.asType().toString(), field.getSimpleName().toString()));
          }
        }
      }
      TypeMirror superclass = typeElement.getSuperclass();
      typeElement = (TypeElement) env.getTypeUtils().asElement(superclass);
View Full Code Here

    }

    private Argument findInput(List<? extends VariableElement> parameters) {
        if (parameters.size() == 1) {
            final VariableElement firstParameter = parameters.get(0);
            return new Argument(box(firstParameter.asType()), firstParameter, true);
        } else {
            for (VariableElement parameter : parameters) {
                if (parameter.getAnnotation(Input.class) != null) {
                    return new Argument(box(parameter.asType()), parameter);
                }
View Full Code Here

    private boolean typesMatch(List<? extends VariableElement> lefts, ImmutableList<Parameter> rights) {
        for (int i = 0; i < lefts.size(); i++) {
            final VariableElement left = lefts.get(i);
            final Parameter right = rights.get(i);

            final boolean typesMatch = left.asType().toString().equals(right.getClass().getName());

            if (typesMatch) {
                continue;
            }
View Full Code Here

    private boolean typesMatch(List<? extends VariableElement> lefts, ImmutableList<Parameter> rights) {
        for (int i = 0; i < lefts.size(); i++) {
            final VariableElement left = lefts.get(i);
            final Parameter right = rights.get(i);

            final boolean typesMatch = left.asType().toString().equals(right.getClass().getName());

            if (typesMatch) {
                continue;
            }
View Full Code Here

    private boolean typesMatch(List<? extends VariableElement> parameters, ImmutableList<Parameter> invokableParameters) {
        for (int i = 0; i < parameters.size(); i++) {
            final VariableElement left = parameters.get(i);
            final Parameter right = invokableParameters.get(i);

            final boolean typesMatch = left.asType().toString().equals(right.getClass().getName());

            if (typesMatch) {
                continue;
            }
View Full Code Here

        final Name parameterType;

        if (isStatic) {
            final VariableElement firstParameter = method.getParameters().get(0);
            parameterType = new Name(firstParameter.asType().toString());
        } else {
            parameterType = new Name(typeElement.getQualifiedName().toString());
        }

        final Closure closure;
View Full Code Here

    private boolean typesMatch(List<? extends VariableElement> lefts, ImmutableList<Parameter> rights) {
        for (int i = 0; i < lefts.size(); i++) {
            final VariableElement left = lefts.get(i);
            final Parameter right = rights.get(i);

            final boolean typesMatch = left.asType().toString().equals(right.getClass().getName());

            if (typesMatch) {
                continue;
            }
View Full Code Here

       List<VariableElement> methodParams = (List<VariableElement>) methodDecl.getParameters();
       List ptypes = new ArrayList();
       List ps = new ArrayList();
       for(Iterator<VariableElement> i=methodParams.iterator(); i.hasNext(); ) {
         VariableElement m = i.next();
         TypeMirror tm = m.asType();
         ptypes.add(tm.toString());
         ps.add(m.getSimpleName().toString());
       }
       final String asyncCallbackClassname = "IAsyncCallback";
       if (resultType == null) {
View Full Code Here

       List<VariableElement> methodParams = (List<VariableElement>) methodDecl.getParameters();
       List ptypes = new ArrayList();
       List ps = new ArrayList();
       for(Iterator<VariableElement> i=methodParams.iterator(); i.hasNext(); ) {
         VariableElement m = i.next();
         TypeMirror tm = m.asType();
         ptypes.add(tm.toString());
         ps.add(m.getSimpleName().toString());
       }
       formatter.printText("@SuppressWarnings(\"rawtypes\")");
       formatter.openMethod(false, AccessSpecifier.PUBLIC, "IFuture", methodDecl.getSimpleName()+IAsyncRemoteServiceProxy.ASYNC_METHOD_SUFFIX, (String[]) ptypes.toArray(new String[] {}), (String[]) ps.toArray(new String[] {}), false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.