Package com.cedarsoft.unit.prefix

Examples of com.cedarsoft.unit.prefix.Prefix


  private Prefixed() {
  }


  public static double getFactor( @Nonnull Class<? extends Annotation> unit ) {
    Prefix prefixAnnotation = getPrefixAnnotation( unit );
    if ( prefixAnnotation == null ) {
      throw new IllegalArgumentException( unit.getName() + " is not annotated with " + Prefix.class.getName() );
    }

    return prefixAnnotation.value();
  }
View Full Code Here


    return prefixAnnotation.value();
  }

  public static boolean isPrefixed( @Nonnull Class<? extends Annotation> unit ) {
    Prefix prefixAnnotation = getPrefixAnnotation( unit );
    return prefixAnnotation != null;
  }
View Full Code Here

  }

  @Nullable
  public static Prefix getPrefixAnnotation( @Nonnull AnnotatedElement unit ) {
    {
      Prefix prefix = unit.getAnnotation( Prefix.class );
      if ( prefix != null ) {
        return prefix;
      }
    }

    for ( Annotation annotation : unit.getAnnotations() ) {
      Prefix prefix = annotation.annotationType().getAnnotation( Prefix.class );
      if ( prefix != null ) {
        return prefix;
      }
    }
View Full Code Here

TOP

Related Classes of com.cedarsoft.unit.prefix.Prefix

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.