Package javax.lang.model.element

Examples of javax.lang.model.element.ElementKind


    //renv.getRootElements()返回的Element并不是都有@Controller的
    //按理说用@SupportedAnnotationTypes指明我的Processor只处理哪些注解,javac就应该返回带有@Controller注解的Element,
    //但是实际情况并不是这样,所以这里要再判断一下。
    for (Element element : renv.getRootElements()) {
      ElementKind kind = element.getKind();
      if (kind != ElementKind.CLASS) //有可能是package-info.java中指定的PackageElement(也就是PackageSymbol)
        continue;
      //只处理最顶层的类
      NestingKind nestingKind = ((TypeElement) element).getNestingKind();
      if (nestingKind != NestingKind.TOP_LEVEL)
View Full Code Here


    private boolean isFirstAction = true;

    @Override
    public ControllerElementVisitor visitExecutable(ExecutableElement e, Void v) {
      ElementKind kind = e.getKind();
      if (kind != ElementKind.METHOD)
        return this;

      Set<Modifier> modifiers = e.getModifiers();
      if (!modifiers.contains(Modifier.PUBLIC) || modifiers.contains(Modifier.STATIC))
View Full Code Here

    }

    private void validateMemberNames(TypeElement type) {
        Map<String, Element> saw = Maps.create();
        for (Element member : type.getEnclosedElements()) {
            ElementKind kind = member.getKind();
            if (kind != ElementKind.METHOD
                    && kind.isClass() == false
                    && kind.isInterface() == false) {
                continue;
            }
            if (member.getModifiers().contains(Modifier.PUBLIC) == false) {
                continue;
            }
View Full Code Here

          //FIXME consider XML
          if ( TypeUtils.isAnnotationMirrorOfType( annotationMirror, Id.class )
              || TypeUtils.isAnnotationMirrorOfType( annotationMirror, EmbeddedId.class ) ) {
            context.logMessage( Diagnostic.Kind.OTHER, "Found id on" + searchedElement );
            final ElementKind kind = subElement.getKind();
            if ( kind == ElementKind.FIELD || kind == ElementKind.METHOD ) {
              accessType = kind == ElementKind.FIELD ? AccessType.FIELD : AccessType.PROPERTY;
              //FIXME enlever in niveau
              if ( defaultAccessTypeForHierarchy == null ) {
                this.defaultAccessTypeForHierarchy = context.getDefaultAccessTypeForHerarchy(
View Full Code Here

  }

  private void parseAttributes(Attributes attributes) {
    XmlMetaSingleAttribute attribute;
    for ( Id id : attributes.getId() ) {
      ElementKind elementKind = getElementKind( id.getAccess() );
      String type = getType( id.getName(), null, elementKind );
      if ( type != null ) {
        attribute = new XmlMetaSingleAttribute( this, id.getName(), type );
        members.add( attribute );
      }
View Full Code Here

  }

  private boolean parseElementCollection(ElementCollection collection) {
    String[] types;
    XmlMetaCollection metaCollection;
    ElementKind elementKind = getElementKind( collection.getAccess() );
    String explicitTargetClass = determineExplicitTargetEntity( collection.getTargetClass() );
    String explicitMapKey = determineExplicitMapKeyClass( collection.getMapKeyClass() );
    try {
      types = getCollectionTypes(
          collection.getName(), explicitTargetClass, explicitMapKey, elementKind
View Full Code Here

  }

  private boolean parseOneToMany(OneToMany oneToMany) {
    String[] types;
    XmlMetaCollection metaCollection;
    ElementKind elementKind = getElementKind( oneToMany.getAccess() );
    String explicitTargetClass = determineExplicitTargetEntity( oneToMany.getTargetEntity() );
    String explicitMapKey = determineExplicitMapKeyClass( oneToMany.getMapKeyClass() );
    try {
      types = getCollectionTypes( oneToMany.getName(), explicitTargetClass, explicitMapKey, elementKind );
    }
View Full Code Here

  }

  private boolean parseManyToMany(ManyToMany manyToMany) {
    String[] types;
    XmlMetaCollection metaCollection;
    ElementKind elementKind = getElementKind( manyToMany.getAccess() );
    String explicitTargetClass = determineExplicitTargetEntity( manyToMany.getTargetEntity() );
    String explicitMapKey = determineExplicitMapKeyClass( manyToMany.getMapKeyClass() );
    try {
      types = getCollectionTypes(
          manyToMany.getName(), explicitTargetClass, explicitMapKey, elementKind
View Full Code Here

    return false;
  }

  private void parseOneToOne(OneToOne oneToOne) {
    XmlMetaSingleAttribute attribute;
    ElementKind elementKind = getElementKind( oneToOne.getAccess() );
    String type = getType( oneToOne.getName(), oneToOne.getTargetEntity(), elementKind );
    if ( type != null ) {
      attribute = new XmlMetaSingleAttribute( this, oneToOne.getName(), type );
      members.add( attribute );
    }
View Full Code Here

    }
  }

  private void parseManyToOne(ManyToOne manyToOne) {
    XmlMetaSingleAttribute attribute;
    ElementKind elementKind = getElementKind( manyToOne.getAccess() );
    String type = getType( manyToOne.getName(), manyToOne.getTargetEntity(), elementKind );
    if ( type != null ) {
      attribute = new XmlMetaSingleAttribute( this, manyToOne.getName(), type );
      members.add( attribute );
    }
View Full Code Here

TOP

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

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.