Package javax.lang.model.element

Examples of javax.lang.model.element.Name


      category = ONE_OFF, maturity = EXPERIMENTAL, severity = ERROR, summary = "")
  private static class SuperCallMatcher extends BugChecker implements MethodInvocationTreeMatcher {
    @Override
    public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
      Tree select = tree.getMethodSelect();
      Name name;
      if (select instanceof MemberSelectTree) {
        name = ((MemberSelectTree) select).getIdentifier();
      } else if (select instanceof IdentifierTree) {
        name = ((IdentifierTree) select).getName();
      } else {
        return Description.NO_MATCH;
      }
      return name.contentEquals("super")
          ? describeMatch(tree)
          : Description.NO_MATCH;
    }
View Full Code Here



                }
                else if(element.getAnnotation(NoGatekeeper.class)==null)
                {
                    Name simpleName = element.getEnclosingElement()!=null ? element.getEnclosingElement().getSimpleName() : element.getSimpleName();
                    System.out.println(simpleName +"(#"+nameToken.value()+")" +" is missing @AccessControl annotation!");
                }
            }
        }
    }
View Full Code Here

    }
  }

  private Set<TypeMirror> getAllowedTypesForBuiltInConstraint(Class<? extends Annotation> annotation) {

    Name key = elementUtils.getName( annotation.getSimpleName() );
    Set<TypeMirror> allowedTypes = builtInConstraints.get( key );

    // create a mapping for the given annotation type if required
    if ( allowedTypes == null ) {
      allowedTypes = CollectionHelper.newHashSet();
View Full Code Here

                        bootstrapOperations.add(op);
                    }


                } else if (element.getAnnotation(NoGatekeeper.class) == null) {
                    Name simpleName = element.getEnclosingElement() != null ? element.getEnclosingElement()
                            .getSimpleName() : element.getSimpleName();
                    System.out.println(
                            simpleName + "(#" + nameToken.value() + ")" + " is missing @AccessControl annotation!");
                }
            }
View Full Code Here

                paramType="Query";
            }
            else if (ap!=null)
                name = ap.name();
            else {
                Name nameElement = paramElement.getSimpleName();
                name = nameElement.toString();
            }

            element.setAttribute("name", name);
            element.setAttribute("paramType",paramType);
            ApiParam apiParam = paramElement.getAnnotation(ApiParam.class);
View Full Code Here

  public Void visitExecutable(ExecutableElement clientMethodElement, State state) {
    if (shouldIgnore(clientMethodElement, state)) {
      return null;
    }
    // Ignore overrides of stableId() in proxies
    Name name = clientMethodElement.getSimpleName();
    if (currentTypeIsProxy && name.contentEquals("stableId")
        && clientMethodElement.getParameters().isEmpty()) {
      return null;
    }

    ExecutableType clientMethod = viewIn(checkedElement, clientMethodElement, state);
View Full Code Here


        for (Element eachBuildableClass : buildables) {
            TypeElement eachBuildableTypeElement = (TypeElement) eachBuildableClass;

            Name simpleClassName = eachBuildableTypeElement.getSimpleName();
            Name qualifiedClassName = eachBuildableTypeElement.getQualifiedName();
            String packageName = getPackageNameFrom(qualifiedClassName);

            try {
                final Buildable theBuildable = eachBuildableTypeElement.getAnnotation(Buildable.class);
                final JavaFileObject javaFileObject = processingEnv.getFiler().createSourceFile(packageName + "." +
View Full Code Here

        if (foundBuilderForVariable) {

            final String packageNameOVariableBuilder = getPackageNameFrom(((TypeElement) variableClassElement)
                    .getQualifiedName());
            final Name classNameOfVariableBuilder = variableClassElement.getSimpleName();
            final Buildable variableBuildable = variableClassElement.getAnnotation(Buildable.class);

            line(format("\tpublic %s %s(%s %s) {", builderName, methodName,
                    packageNameOVariableBuilder + "." + createBuilderName(variableBuildable, classNameOfVariableBuilder),
                    field.getSimpleName() + "Builder"), out);
View Full Code Here

    // <editor-fold defaultstate="collapsed" desc="HTML elements">

    @Override
    public Void visitStartElement(StartElementTree tree, Void ignore) {
        final Name treeName = tree.getName();
        final HtmlTag t = HtmlTag.get(treeName);
        if (t == null) {
            env.messages.error(HTML, tree, "dc.tag.unknown", treeName);
        } else {
            boolean done = false;
View Full Code Here

                tagStack.pop();
        }
    }

    private void checkStructure(StartElementTree tree, HtmlTag t) {
        Name treeName = tree.getName();
        TagStackItem top = tagStack.peek();
        switch (t.blockType) {
            case BLOCK:
                if (top == null || top.tag.accepts(t))
                    return;

                switch (top.tree.getKind()) {
                    case START_ELEMENT: {
                        if (top.tag.blockType == HtmlTag.BlockType.INLINE) {
                            Name name = ((StartElementTree) top.tree).getName();
                            env.messages.error(HTML, tree, "dc.tag.not.allowed.inline.element",
                                    treeName, name);
                            return;
                        }
                    }
View Full Code Here

TOP

Related Classes of javax.lang.model.element.Name

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.