Package javax.lang.model.element

Examples of javax.lang.model.element.ElementKind


     * @param p {@inheritDoc}
     * @return  the result of the kind-specific visit method
     */
    @Override
    public R visitVariable(VariableElement e, P p) {
        ElementKind k = e.getKind();
        switch(k) {
        case ENUM_CONSTANT:
            return visitVariableAsEnumConstant(e, p);

        case EXCEPTION_PARAMETER:
View Full Code Here


     * @param p {@inheritDoc}
     * @return  the result of the kind-specific visit method
     */
    @Override
    public R visitExecutable(ExecutableElement e, P p) {
        ElementKind k = e.getKind();
        switch(k) {
        case CONSTRUCTOR:
            return visitExecutableAsConstructor(e, p);

        case INSTANCE_INIT:
View Full Code Here

        return claimed;
    }

    private void parse(Element element, Function<TypeElement, Type> storage) throws UnsupportedUsageException {
        final ElementKind kind = element.getKind();

        final Map<ElementKind, Parser> parsers = ImmutableMap.<ElementKind, Parser>of(
                ElementKind.METHOD, new MethodParser(processingEnv)
        );
View Full Code Here

    return defaultAccessType;
  }

  private static AccessType getAccessTypeOfIdAnnotation(Element element) {
    AccessType accessType = null;
    final ElementKind kind = element.getKind();
    if ( kind == ElementKind.FIELD || kind == ElementKind.METHOD ) {
      accessType = kind == ElementKind.FIELD ? AccessType.FIELD : AccessType.PROPERTY;
    }
    return accessType;
  }
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.