JBoss Application Server: Build 7.1.2.Final
javax.validation

Interface Configuration<T extends Configuration<T>>

    • Method Detail

      • ignoreXmlConfiguration

        T ignoreXmlConfiguration()
        Ignore data from the META-INF/validation.xml file if this method is called. This method is typically useful for containers that parse META-INF/validation.xml themselves and pass the information via the Configuration methods.
        Returns:
        this following the chaining method pattern.
      • messageInterpolator

        T messageInterpolator(MessageInterpolator interpolator)
        Defines the message interpolator used. Has priority over the configuration based message interpolator. If null is passed, the default message interpolator is used (defined in XML or the specification default).
        Parameters:
        interpolator - message interpolator implementation.
        Returns:
        this following the chaining method pattern.
      • traversableResolver

        T traversableResolver(TraversableResolver resolver)
        Defines the traversable resolver used. Has priority over the configuration based traversable resolver. If null is passed, the default traversable resolver is used (defined in XML or the specification default).
        Parameters:
        resolver - traversable resolver implementation.
        Returns:
        this following the chaining method pattern.
      • constraintValidatorFactory

        T constraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory)
        Defines the constraint validator factory. Has priority over the configuration based constraint factory. If null is passed, the default constraint validator factory is used (defined in XML or the specification default).
        Parameters:
        constraintValidatorFactory - constraint factory inmplementation.
        Returns:
        this following the chaining method pattern.
      • addMapping

        T addMapping(InputStream stream)
        Add a stream describing constraint mapping in the Bean Validation XML format.

        The stream should be closed by the client API after the ValidatorFactory has been built. The Bean Validation provider must not close the stream.

        Parameters:
        stream - XML mapping stream.
        Returns:
        this following the chaining method pattern.
        Throws:
        IllegalArgumentException - if stream is null
      • addProperty

        T addProperty(String name,
                    String value)
        Add a provider specific property. This property is equivalent to XML configuration properties. If the underlying provider does not know how to handle the property, it must silently ignore it.

        Note: Using this non type-safe method is generally not recommended.

        It is more appropriate to use, if available, the type-safe equivalent provided by a specific provider via its Configuration subclass. ValidatorFactory factory = Validation.byProvider(ACMEPrivoder.class) .configure() .providerSpecificProperty(ACMEState.FAST) .buildValidatorFactory(); This method is typically used by containers parsing META-INF/validation.xml themselves and injecting the state to the Configuration object.

        If a property with a given name is defined both via this method and in the XML configuration, the value set programmatically has priority. If null is passed as a value, the value defined in XML is used. If no value is defined in XML, the property is considered unset.

        Parameters:
        name - property name.
        value - property value.
        Returns:
        this following the chaining method pattern.
        Throws:
        IllegalArgumentException - if name is null
      • getDefaultMessageInterpolator

        MessageInterpolator getDefaultMessageInterpolator()
        Return an implementation of the MessageInterpolator interface following the default MessageInterpolator defined in the specification:
        • use the ValidationMessages resource bundle to load keys
        • use Locale.getDefault()
        Returns:
        default MessageInterpolator implementation compliant with the specification
      • getDefaultTraversableResolver

        TraversableResolver getDefaultTraversableResolver()
        Return an implementation of the TraversableResolver interface following the default TraversableResolver defined in the specification:
        • if Java Persistence is available in the runtime environment, a property is considered reachable if Java Persistence considers the property as loaded
        • if Java Persistence is not available in the runtime environment, all properties are considered reachable
        • all properties are considered cascadable.
        Returns:
        default TraversableResolver implementation compliant with the specification
      • getDefaultConstraintValidatorFactory

        ConstraintValidatorFactory getDefaultConstraintValidatorFactory()
        Return an implementation of the ConstraintValidatorFactory interface following the default ConstraintValidatorFactory defined in the specification:
        • uses the public no-arg constructor of the ConstraintValidator
        Returns:
        default ConstraintValidatorFactory implementation compliant with the specification
      • buildValidatorFactory

        ValidatorFactory buildValidatorFactory()
        Build a ValidatorFactory implementation.
        Returns:
        ValidatorFactory
        Throws:
        ValidationException - if the ValidatorFactory cannot be built
JBoss Application Server: Build 7.1.2.Final

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.