Examples of GroupConversionDescriptorImpl


Examples of org.apache.bval.jsr.groups.GroupConversionDescriptorImpl

        final Collection<Annotation> annotations = prop.getFeature(JsrFeatures.Property.ANNOTATIONS_TO_PROCESS);
        if (annotations != null) {
            for (final Annotation a : annotations) {
                if (ConvertGroup.List.class.isInstance(a)) {
                    for (final ConvertGroup convertGroup : ConvertGroup.List.class.cast(a).value()) {
                        edesc.addGroupConversion(new GroupConversionDescriptorImpl(new Group(convertGroup.from()), new Group(convertGroup.to())));
                    }
                }

                if (ConvertGroup.class.isInstance(a)) {
                    final ConvertGroup convertGroup = ConvertGroup.class.cast(a);
                    edesc.addGroupConversion(new GroupConversionDescriptorImpl(new Group(convertGroup.from()), new Group(convertGroup.to())));
                }
            }
            annotations.clear();
        }
View Full Code Here

Examples of org.apache.bval.jsr.groups.GroupConversionDescriptorImpl

    private static void processConvertGroup(final ElementDescriptorImpl edesc, final AccessibleObject accessible) {
        final ConvertGroup.List convertGroupList = accessible.getAnnotation(ConvertGroup.List.class);
        if (convertGroupList != null) {
            for (final ConvertGroup convertGroup : convertGroupList.value()) {
                edesc.addGroupConversion(new GroupConversionDescriptorImpl(new Group(convertGroup.from()), new Group(convertGroup.to())));
            }
        }

        final ConvertGroup convertGroup = accessible.getAnnotation(ConvertGroup.class);
        if (convertGroup != null) {
            edesc.addGroupConversion(new GroupConversionDescriptorImpl(new Group(convertGroup.from()), new Group(convertGroup.to())));
        }
    }
View Full Code Here

Examples of org.apache.bval.jsr.groups.GroupConversionDescriptorImpl

                    paramDesc.setCascaded(true);
                } // else keep previous config
            }
            if (paramDesc.isCascaded() && from != null) {
                for (int i = 0; i < from.length; i++) {
                    paramDesc.addGroupConversion(new GroupConversionDescriptorImpl(from[i], to[i]));
                }
            } else if (from != null) {
                throw new ConstraintDeclarationException("Group conversion is only relevant for @Valid cases");
            }
View Full Code Here

Examples of org.apache.bval.jsr.groups.GroupConversionDescriptorImpl

            if (annotation instanceof Valid || annotation instanceof Validate) {
                desc.setCascaded(true);
            } else if (ConvertGroup.class.isInstance(annotation) && ReturnAccess.class.isInstance(access)) { // access is just tested to ensure to not read it twice with cross parameter
                final ConvertGroup cg = ConvertGroup.class.cast(annotation);
                desc.addGroupConversion(new GroupConversionDescriptorImpl(new Group(cg.from()), new Group(cg.to())));
            } else if (ConvertGroup.List.class.isInstance(annotation) && ReturnAccess.class.isInstance(access)) {
                final ConvertGroup.List cgl = ConvertGroup.List.class.cast(annotation);
                for (final ConvertGroup cg : cgl.value()) {
                    desc.addGroupConversion(new GroupConversionDescriptorImpl(new Group(cg.from()), new Group(cg.to())));
                }
            } else {
                processConstraint(annotation, desc, access, validations);
            }
        }
View Full Code Here

Examples of org.apache.bval.jsr.groups.GroupConversionDescriptorImpl

        this.index = index;
    }

    @Override
    public void addGroupMapping(final Group from, final Group to) {
        groupConversions.add(new GroupConversionDescriptorImpl(from, to));
        super.addGroupMapping(from, to);
    }
View Full Code Here

Examples of org.hibernate.validator.internal.metadata.descriptor.GroupConversionDescriptorImpl

  public Set<GroupConversionDescriptor> asDescriptors() {
    Set<GroupConversionDescriptor> descriptors = newHashSet( groupConversions.size() );

    for ( Entry<Class<?>, Class<?>> conversion : groupConversions.entrySet() ) {
      descriptors.add(
          new GroupConversionDescriptorImpl(
              conversion.getKey(),
              conversion.getValue()
          )
      );
    }
View Full Code Here

Examples of org.hibernate.validator.internal.metadata.descriptor.GroupConversionDescriptorImpl

  public Set<GroupConversionDescriptor> asDescriptors() {
    Set<GroupConversionDescriptor> descriptors = newHashSet( groupConversions.size() );

    for ( Entry<Class<?>, Class<?>> conversion : groupConversions.entrySet() ) {
      descriptors.add(
          new GroupConversionDescriptorImpl(
              conversion.getKey(),
              conversion.getValue()
          )
      );
    }
View Full Code Here

Examples of org.hibernate.validator.internal.metadata.descriptor.GroupConversionDescriptorImpl

  public Set<GroupConversionDescriptor> asDescriptors() {
    Set<GroupConversionDescriptor> descriptors = newHashSet( groupConversions.size() );

    for ( Entry<Class<?>, Class<?>> conversion : groupConversions.entrySet() ) {
      descriptors.add(
          new GroupConversionDescriptorImpl(
              conversion.getKey(),
              conversion.getValue()
          )
      );
    }
View Full Code Here

Examples of org.hibernate.validator.internal.metadata.descriptor.GroupConversionDescriptorImpl

  public Set<GroupConversionDescriptor> asDescriptors() {
    Set<GroupConversionDescriptor> descriptors = newHashSet( groupConversions.size() );

    for ( Entry<Class<?>, Class<?>> conversion : groupConversions.entrySet() ) {
      descriptors.add(
          new GroupConversionDescriptorImpl(
              conversion.getKey(),
              conversion.getValue()
          )
      );
    }
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.