Package org.jboss.jandex

Examples of org.jboss.jandex.AnnotationInstance


  private AnnotationInstance parserNamedQueries(Collection<JaxbNamedQuery> namedQueries) {
    AnnotationValue[] values = new AnnotationValue[namedQueries.size()];
    int i = 0;
    for ( Iterator<JaxbNamedQuery> iterator = namedQueries.iterator(); iterator.hasNext(); ) {
      AnnotationInstance annotationInstance = parserNamedQuery( iterator.next() );
      values[i++] = MockHelper.nestedAnnotationValue(
          "", annotationInstance
      );
    }
    return create(
View Full Code Here


  private void nestedQueryHintList(String name, List<JaxbQueryHint> constraints, List<AnnotationValue> annotationValueList) {
    if ( MockHelper.isNotEmpty( constraints ) ) {
      AnnotationValue[] values = new AnnotationValue[constraints.size()];
      for ( int i = 0; i < constraints.size(); i++ ) {
        AnnotationInstance annotationInstance = parserQueryHint( constraints.get( i ) );
        values[i] = MockHelper.nestedAnnotationValue(
            "", annotationInstance
        );
      }
      MockHelper.addToCollectionIfNotNull(
View Full Code Here

  protected AnnotationValue[] nestedSecondaryTableList(String name, List<JaxbSecondaryTable> secondaryTableList, List<AnnotationValue> annotationValueList) {
    if ( MockHelper.isNotEmpty( secondaryTableList ) ) {
      AnnotationValue[] values = new AnnotationValue[secondaryTableList.size()];
      for ( int i = 0; i < secondaryTableList.size(); i++ ) {
        AnnotationInstance annotationInstance = parserSecondaryTable( secondaryTableList.get( i ), null );
        values[i] = MockHelper.nestedAnnotationValue(
            "", annotationInstance
        );
      }
      MockHelper.addToCollectionIfNotNull(
View Full Code Here

  private void mockTableIfNonExist(Map<DotName, List<AnnotationInstance>> annotationsMap, DotName annName) {
    if ( annName == JPADotNames.TABLE && !annotationsMap.containsKey( JPADotNames.TABLE ) && annotationsMap
        .containsKey( JPADotNames.ENTITY ) ) {
      //if an entity doesn't have a @Table, we create one here
      AnnotationInstance entity = JandexHelper.getSingleAnnotation( annotationsMap, JPADotNames.ENTITY );
      AnnotationInstance table = MockHelper.create(
          JPADotNames.TABLE, entity.target(), MockHelper.EMPTY_ANNOTATION_VALUE_ARRAY
      );
      List<AnnotationInstance> annotationInstanceList = new ArrayList<AnnotationInstance>( 1 );
      annotationInstanceList.add( table );
      annotationsMap.put( JPADotNames.TABLE, annotationInstanceList );
View Full Code Here

        cascadeValue = AnnotationValue.createArrayValue( "cascade", cascades );

      }
      newAnnotationValueList.add( cascadeValue );

      AnnotationInstance newAnnotationInstance = MockHelper.create(
          annotationInstance.name(),
          annotationInstance.target(),
          MockHelper.toArray( newAnnotationValueList )
      );
      newAnnotationInstanceList.add( newAnnotationInstance );
View Full Code Here

              secondaryTableAnnotationInstanceArray[i],
              defaults
          )
          );
        }
        AnnotationInstance secondaryTablesAnnotationInstance = MockHelper.create(
            annName,
            annotationInstance.target(),
            new AnnotationValue[] {
                AnnotationValue.createArrayValue( "value", newAnnotationValueArray )
            }
View Full Code Here

  @Override
  protected void process(DotName annName, AnnotationInstance annotationInstance, List<AnnotationInstance> indexedAnnotationInstanceList) {
    AnnotationTarget target = annotationInstance.target();

    for ( Iterator<AnnotationInstance> iter = indexedAnnotationInstanceList.iterator(); iter.hasNext(); ) {
      AnnotationInstance ann = iter.next();
      if ( MockHelper.targetEquals( target, ann.target() ) ) {
        iter.remove();
      }
    }
  }
View Full Code Here

          break;
        case ATTRIBUTE:
          List<AnnotationInstance> indexedAnnotationInstanceList = map.get( entityAnnName );
          Iterator<AnnotationInstance> iter = indexedAnnotationInstanceList.iterator();
          while ( iter.hasNext() ) {
            AnnotationInstance ann = iter.next();
            if ( MockHelper.targetEquals( target, ann.target() ) ) {
              iter.remove();
            }
          }
          break;
      }
View Full Code Here

        metadataSources.annotatedMappingClassNames.add( className );
        continue;
      }

      // logic here assumes an entity is not also a converter...
      AnnotationInstance converterAnnotation = JandexHelper.getSingleAnnotation(
          classInfo.annotations(),
          JPADotNames.CONVERTER
      );
      if ( converterAnnotation != null ) {
        metadataSources.converterDescriptors.add(
View Full Code Here

    this.embeddedAttributeName = embeddedAttributeName;
    this.parentReferencingAttributeName = checkParentAnnotation();
  }

  private String checkParentAnnotation() {
    AnnotationInstance parentAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(),
        HibernateDotNames.PARENT
    );
    if ( parentAnnotation == null ) {
      return null;
    }
    else {
      return JandexHelper.getPropertyName( parentAnnotation.target() );
    }
  }
View Full Code Here

TOP

Related Classes of org.jboss.jandex.AnnotationInstance

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.