Examples of asEnum()


Examples of org.jboss.jandex.AnnotationValue.asEnum()

  public static <T extends Enum<T>> T getEnumValue(AnnotationInstance annotation, String element, Class<T> type) {
    AnnotationValue val = annotation.value( element );
    if ( val == null ) {
      return (T) getDefaultValue( annotation, element );
    }
    return Enum.valueOf( type, val.asEnum() );
  }

  /**
   * Expects a method or field annotation target and returns the property name for this target
   *
 
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

    AnnotationInstance basicAnnotation = JandexHelper.getSingleAnnotation( annotations(), JPADotNames.BASIC );
    if ( basicAnnotation != null ) {
      FetchType fetchType = FetchType.LAZY;
      AnnotationValue fetchValue = basicAnnotation.value( "fetch" );
      if ( fetchValue != null ) {
        fetchType = Enum.valueOf( FetchType.class, fetchValue.asEnum() );
      }
      this.isLazy = fetchType == FetchType.LAZY;

      AnnotationValue optionalValue = basicAnnotation.value( "optional" );
      if ( optionalValue != null ) {
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

    if ( generatedAnnotation != null ) {
      this.isInsertable = false;

      AnnotationValue generationTimeValue = generatedAnnotation.value();
      if ( generationTimeValue != null ) {
        GenerationTime genTime = Enum.valueOf( GenerationTime.class, generationTimeValue.asEnum() );
        if ( GenerationTime.ALWAYS.equals( genTime ) ) {
          this.isUpdatable = false;
          this.propertyGeneration = PropertyGeneration.parse( genTime.toString().toLowerCase() );
        }
      }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

        HibernateDotNames.NOT_FOUND
    );
    if ( notFoundAnnotation != null ) {
      AnnotationValue actionValue = notFoundAnnotation.value( "action" );
      if ( actionValue != null ) {
        action = Enum.valueOf( NotFoundAction.class, actionValue.asEnum() );
      }
    }

    return NotFoundAction.IGNORE.equals( action );
  }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

  private boolean determineFetchType(AnnotationInstance associationAnnotation) {
    boolean lazy = false;
    AnnotationValue fetchValue = associationAnnotation.value( "fetch" );
    if ( fetchValue != null ) {
      FetchType fetchType = Enum.valueOf( FetchType.class, fetchValue.asEnum() );
      if ( FetchType.LAZY.equals( fetchType ) ) {
        lazy = true;
      }
    }
    return lazy;
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

    protected ConcurrencyManagementType fromAnnotation(final AnnotationInstance annotationInstance) {
        final AnnotationValue value = annotationInstance.value();
        if(value == null) {
            return ConcurrencyManagementType.CONTAINER;
        }
        return ConcurrencyManagementType.valueOf(value.asEnum());
    }
}
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

    protected StatefulTimeoutInfo fromAnnotation(final AnnotationInstance annotationInstance) {
        final long value = annotationInstance.value().asLong();
        final AnnotationValue unitValue = annotationInstance.value("unit");
        final TimeUnit unit;
        if (unitValue != null) {
            unit = TimeUnit.valueOf(unitValue.asEnum());
        } else {
            unit = TimeUnit.MINUTES;
        }
        return new StatefulTimeoutInfo(value, unit);
    }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

    @Override
    protected Integer fromAnnotation(final AnnotationInstance annotationInstance) {
        final long timeout = annotationInstance.value().asLong();
        AnnotationValue unitAnnVal = annotationInstance.value("unit");
        final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.SECONDS;
        return (int) unit.toSeconds(timeout);
    }
}
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

    protected TransactionManagementType fromAnnotation(final AnnotationInstance annotationInstance) {
        final AnnotationValue value = annotationInstance.value();
        if(value == null) {
            return TransactionManagementType.CONTAINER;
        }
        return TransactionManagementType.valueOf(value.asEnum());
    }
}
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue.asEnum()

    @Override
    protected AccessTimeoutDetails fromAnnotation(final AnnotationInstance annotationInstance) {
        final long timeout = annotationInstance.value().asLong();
        AnnotationValue unitAnnVal = annotationInstance.value("unit");
        final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.MILLISECONDS;
        return new AccessTimeoutDetails(timeout, unit);
    }
}
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.