Package java.lang.annotation

Examples of java.lang.annotation.ElementType


            message = messageTemplate;
            if (propPath == null)
                propPath = PathImpl.createPathFromString(context.getPropertyName());
            descriptor = null;
        }
        ElementType elementType = (context.getAccess() != null) ? context.getAccess().getElementType() : null;
        ConstraintViolationImpl<T> ic = new ConstraintViolationImpl<T>(messageTemplate,
              message, rootBean, context.getBean(), propPath, value, descriptor, rootBeanType, elementType);
        constraintViolations.add(ic);
    }
View Full Code Here


    properties.put( "foo", "ANNOTATION_TYPE" );
    properties.put( "bar", ElementType.FIELD );

    ConfigurationPropertyReader reader = new ConfigurationPropertyReader( properties );

    ElementType value = reader.property( "foo", ElementType.class ).getValue();
    assertThat( value ).isEqualTo( ElementType.ANNOTATION_TYPE );

    value = reader.property( "bar", ElementType.class ).getValue();
    assertThat( value ).isEqualTo( ElementType.FIELD );
  }
View Full Code Here

  public void shouldRetrieveEnumPropertyWithDefaultValue() {
    Map<String, Object> properties = new HashMap<String, Object>();

    ConfigurationPropertyReader reader = new ConfigurationPropertyReader( properties );

    ElementType value = reader.property( "foo", ElementType.class )
        .withDefault( ElementType.ANNOTATION_TYPE )
        .getValue();
    assertThat( value ).isEqualTo( ElementType.ANNOTATION_TYPE );
  }
View Full Code Here

    return isReachable;
  }

  private boolean isCascadeRequired(GlobalExecutionContext globalContext, LocalExecutionContext localContext, Member member) {
    final ElementType type = member instanceof Field ? ElementType.FIELD : ElementType.METHOD;
    boolean isReachable;
    boolean isCascadable;

    Path pathToObject = localContext.getPropertyPath().getPathWithoutLeafNode();
    if ( pathToObject == null ) {
View Full Code Here

     *            a parameter (0 == first parameter)
     * @return Collection of resolved TypeQualifierAnnotations
     */
    private static Collection<TypeQualifierAnnotation> getApplicableScopedApplications(XMethod o, int parameter) {
        Set<TypeQualifierAnnotation> result = new HashSet<TypeQualifierAnnotation>();
        ElementType e = ElementType.PARAMETER;
        getApplicableScopedApplications(result, o, e);
        getDirectApplications(result, o, parameter);
        return result;
    }
View Full Code Here

        if (o.isSynthetic())
        {
            return null; // synthetic objects don't get default annotations
        }

        ElementType elementType = o.getElementType();
        while (true) {
            o = o.getContainingScope();
            if (o == null) {
                return null;
            }
View Full Code Here

    return isReachable;
  }

  private boolean isCascadeRequired(ValidationContext<?, ?> validationContext, ValueContext<?, ?> valueContext, Member member) {
    final ElementType type = member instanceof Field ? ElementType.FIELD : ElementType.METHOD;
    boolean isReachable;
    boolean isCascadable;

    PathImpl path = valueContext.getPropertyPath();
    Path pathToObject = path.getPathWithoutLeafNode();
View Full Code Here

    return isReachable;
  }

  private boolean isCascadeRequired(GlobalExecutionContext globalContext, LocalExecutionContext localContext, Member member) {
    final ElementType type = member instanceof Field ? ElementType.FIELD : ElementType.METHOD;
    boolean isReachable;
    boolean isCascadable;

    Path pathToObject = localContext.getPropertyPath().getPathWithoutLeafNode();
    if ( pathToObject == null ) {
View Full Code Here

    for ( Cascadable cascadable : validatable.getCascadables() ) {
      valueContext.appendNode( cascadable );
      valueContext.setCurrentGroup( cascadable.convertGroup( originalGroup ) );

      ElementType elementType = cascadable.getElementType();
      if ( isCascadeRequired(
          validationContext,
          valueContext.getCurrentBean(),
          valueContext.getPropertyPath(),
          elementType
View Full Code Here

    return isReachable;
  }

  private boolean isCascadeRequired(ValidationContext<?, ?> validationContext, ValueContext<?, ?> valueContext, Member member) {
    final ElementType type = member instanceof Field ? ElementType.FIELD : ElementType.METHOD;
    boolean isReachable;
    boolean isCascadable;

    PathImpl path = valueContext.getPropertyPath();
    Path pathToObject = path.getPathWithoutLeafNode();
View Full Code Here

TOP

Related Classes of java.lang.annotation.ElementType

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.