Package org.hibernate.validator.internal.xml

Examples of org.hibernate.validator.internal.xml.XmlMappingParser


   */
  public XmlConfigurationMetaDataProvider(ConstraintHelper constraintHelper, Set<InputStream> mappingStreams) {

    super( constraintHelper );

    XmlMappingParser mappingParser = new XmlMappingParser( constraintHelper );
    mappingParser.parse( mappingStreams );

    for ( Class<?> clazz : mappingParser.getXmlConfiguredClasses() ) {

      Map<ConstraintLocation, Set<MetaConstraint<?>>> constraintsByLocation = partition(
          mappingParser.getConstraintsForClass( clazz ), byLocation()
      );
      Set<BeanConstraintLocation> cascades = getCascades( mappingParser, clazz );

      Set<ConstrainedElement> constrainedElements = getConstrainedElements( constraintsByLocation, cascades );

      configuredBeans.put(
          clazz,
          createBeanConfiguration(
              ConfigurationSource.XML,
              clazz,
              constrainedElements,
              mappingParser.getDefaultSequenceForClass( clazz ),
              null
          )
      );
    }

    annotationIgnores = mappingParser.getAnnotationIgnores();
  }
View Full Code Here


   * @param mappingStreams the input stream for the xml configuration
   */
  public XmlMetaDataProvider(ConstraintHelper constraintHelper, Set<InputStream> mappingStreams) {
    super( constraintHelper );

    XmlMappingParser mappingParser = new XmlMappingParser( constraintHelper );
    mappingParser.parse( mappingStreams );

    for ( Class<?> clazz : mappingParser.getXmlConfiguredClasses() ) {

      Map<ConstraintLocation, Set<MetaConstraint<?>>> constraintsByLocation = partition(
          mappingParser.getConstraintsForClass( clazz ), byLocation()
      );
      Set<ConstraintLocation> cascades = getCascades( mappingParser, clazz );

      Set<ConstrainedElement> constrainedElements = getConstrainedElements( constraintsByLocation, cascades );

      addBeanConfiguration(
          clazz,
          createBeanConfiguration(
              ConfigurationSource.XML,
              clazz,
              constrainedElements,
              mappingParser.getDefaultSequenceForClass( clazz ),
              null
          )
      );
    }

    annotationProcessingOptions = mappingParser.getAnnotationProcessingOptions();
  }
View Full Code Here

   * @param mappingStreams the input stream for the xml configuration
   */
  public XmlMetaDataProvider(ConstraintHelper constraintHelper, Set<InputStream> mappingStreams) {
    super( constraintHelper );

    XmlMappingParser mappingParser = new XmlMappingParser( constraintHelper );
    mappingParser.parse( mappingStreams );

    for ( Class<?> clazz : mappingParser.getXmlConfiguredClasses() ) {

      Map<ConstraintLocation, Set<MetaConstraint<?>>> constraintsByLocation = partition(
          mappingParser.getConstraintsForClass( clazz ), byLocation()
      );
      Set<ConstraintLocation> cascades = getCascades( mappingParser, clazz );

      Set<ConstrainedElement> constrainedElements = getConstrainedElements( constraintsByLocation, cascades );

      addBeanConfiguration(
          clazz,
          createBeanConfiguration(
              ConfigurationSource.XML,
              clazz,
              constrainedElements,
              mappingParser.getDefaultSequenceForClass( clazz ),
              null
          )
      );
    }

    annotationProcessingOptions = mappingParser.getAnnotationProcessingOptions();
  }
View Full Code Here

  private ConstraintHelper constraintHelper;

  @BeforeMethod
  public void setupParserHelper() {
    constraintHelper = new ConstraintHelper();
    xmlMappingParser = new XmlMappingParser( constraintHelper, new DefaultParameterNameProvider() );
  }
View Full Code Here

  public XmlMetaDataProvider(ConstraintHelper constraintHelper,
                 ParameterNameProvider parameterNameProvider,
                 Set<InputStream> mappingStreams) {
    super( constraintHelper );

    XmlMappingParser mappingParser = new XmlMappingParser( constraintHelper, parameterNameProvider );
    mappingParser.parse( mappingStreams );

    for ( Class<?> clazz : mappingParser.getXmlConfiguredClasses() ) {
      Set<ConstrainedElement> constrainedElements = mappingParser.getConstrainedElementsForClass( clazz );

      BeanConfiguration<?> beanConfiguration = createBeanConfiguration(
          ConfigurationSource.XML,
          clazz,
          constrainedElements,
          mappingParser.getDefaultSequenceForClass( clazz ),
          null
      );
      addBeanConfiguration(
          clazz,
          beanConfiguration
      );
    }

    annotationProcessingOptions = mappingParser.getAnnotationProcessingOptions();
  }
View Full Code Here

  public XmlMetaDataProvider(ConstraintHelper constraintHelper,
                 ParameterNameProvider parameterNameProvider,
                 Set<InputStream> mappingStreams) {
    super( constraintHelper );

    XmlMappingParser mappingParser = new XmlMappingParser( constraintHelper, parameterNameProvider );
    mappingParser.parse( mappingStreams );

    for ( Class<?> clazz : mappingParser.getXmlConfiguredClasses() ) {
      Set<ConstrainedElement> constrainedElements = mappingParser.getConstrainedElementsForClass( clazz );

      BeanConfiguration<?> beanConfiguration = createBeanConfiguration(
          ConfigurationSource.XML,
          clazz,
          constrainedElements,
          mappingParser.getDefaultSequenceForClass( clazz ),
          null
      );
      addBeanConfiguration(
          clazz,
          beanConfiguration
      );
    }

    annotationProcessingOptions = mappingParser.getAnnotationProcessingOptions();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.internal.xml.XmlMappingParser

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.