Examples of asEnum()


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 AccessTimeout getAccessTimeout(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 AccessTimeout() {
            @Override
            public long value() {
                return timeout;
            }
View Full Code Here

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

  public static <T extends Enum<T>> T getValueAsEnum(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() );
  }

  /**
   * Retrieves a jandex annotation element value as an Integer.  If the value is <code>null</code>, the default value specified in
   * the annotation class is retrieved instead.
View Full Code Here

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

    }

    ResultCheckStyle checkStyle = ResultCheckStyle.NONE;
    AnnotationValue checkStyleValue = customSQLAnnotation.value( "check" );
    if ( checkStyleValue != null ) {
      checkStyle = Enum.valueOf( ResultCheckStyle.class, checkStyleValue.asEnum() );
    }

    return new CustomSQL(
        sql,
        isCallable,
View Full Code Here

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

    AnnotationInstance basicAnnotation = getIfExists( 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()

    NotFoundAction action = NotFoundAction.EXCEPTION;
    AnnotationInstance notFoundAnnotation = getIfExists( 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()

  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
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.