Author: hardy.ferentschik
Date: 2009-03-24 14:19:27 -0400 (Tue, 24 Mar 2009)
New Revision: 16209
Added:
validator/trunk/hibernate-validator/src/main/xjb/
validator/trunk/hibernate-validator/src/main/xjb/binding-customization.xjb
validator/trunk/hibernate-validator/src/main/xsd/
validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd
validator/trunk/hibernate-validator/src/main/xsd/validation-mapping-1.0.xsd
Modified:
validator/trunk/hibernate-validator/pom.xml
Log:
checking in a jaxb setup for xml parsing.Not sure whether we stick with it yet.
Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml 2009-03-23 18:35:19 UTC (rev 16208)
+++ validator/trunk/hibernate-validator/pom.xml 2009-03-24 18:19:27 UTC (rev 16209)
@@ -1,4 +1,6 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
@@ -27,9 +29,19 @@
</dependency>
<dependency>
<groupId>com.googlecode.jtype</groupId>
- <artifactId>jtype</artifactId>
- <version>0.1.0</version>
+ <artifactId>jtype</artifactId>
+ <version>0.1.0</version>
</dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.3</version>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -69,6 +81,21 @@
</resources>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxb2-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>xjc</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <packageName>org.hibernate.validation.xml</packageName>
+
<outputDirectory>${basedir}/target/generated-sources</outputDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
@@ -90,7 +117,9 @@
</relocation>
</relocations>
<transformers>
- <transformer
implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer"
/>
+ <transformer
+
implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer"
+ />
</transformers>
</configuration>
</execution>
@@ -166,7 +195,7 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>
</plugins>
</build>
<reporting>
Added: validator/trunk/hibernate-validator/src/main/xjb/binding-customization.xjb
===================================================================
--- validator/trunk/hibernate-validator/src/main/xjb/binding-customization.xjb
(rev 0)
+++ validator/trunk/hibernate-validator/src/main/xjb/binding-customization.xjb 2009-03-24
18:19:27 UTC (rev 16209)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jxb:bindings version="1.0"
+
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
+ <jxb:bindings schemaLocation="../xsd/validation-mapping-1.0.xsd"
node="/xs:schema">
+ <jxb:bindings
node="//xs:complexType[8]/xs:sequence[1]/xs:element[1]">
+ <jxb:property name="classType"/>
+ </jxb:bindings>
+ </jxb:bindings>
+</jxb:bindings>
+
\ No newline at end of file
Added: validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd
===================================================================
--- validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd
(rev 0)
+++
validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd 2009-03-24
18:19:27 UTC (rev 16209)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
+ elementFormDefault="qualified"
+
targetNamespace="http://jboss.org/xml/ns/javax/validation/configurat...
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
+ version="1.0">
+ <xs:element name="validation-config"
type="validation-configType"/>
+ <xs:complexType name="validation-configType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="default-provider"
minOccurs="0"/>
+ <xs:element type="xs:string"
name="message-interpolator" minOccurs="0"/>
+ <xs:element type="xs:string"
name="traversable-resolver" minOccurs="0"/>
+ <xs:element type="xs:string"
name="constraint-validator-factory" minOccurs="0"/>
+ <xs:element type="xs:string" name="constraint-mapping"
maxOccurs="unbounded" minOccurs="0"/>
+ <xs:element type="propertyType" name="property"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="propertyType">
+ <xs:attribute name="name" use="required"
type="xs:string"/>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Added: validator/trunk/hibernate-validator/src/main/xsd/validation-mapping-1.0.xsd
===================================================================
--- validator/trunk/hibernate-validator/src/main/xsd/validation-mapping-1.0.xsd
(rev 0)
+++ validator/trunk/hibernate-validator/src/main/xsd/validation-mapping-1.0.xsd 2009-03-24
18:19:27 UTC (rev 16209)
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
+ elementFormDefault="qualified"
+
targetNamespace="http://jboss.org/xml/ns/javax/validation/mapping"
+
xmlns="http://jboss.org/xml/ns/javax/validation/mapping"
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ version="1.0">
+ <xs:element name="constraint-mappings"
+ type="map:constraint-mappingsType"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+
+ <xs:complexType name="groupsType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="value"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="groupSequenceType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="value"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="constraint-mappingsType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="default-package"
minOccurs="0"/>
+ <xs:element type="map:beanType"
+ name="bean"
+ maxOccurs="unbounded"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ <xs:element type="map:constraint-definitionType"
+ name="constraint-definition"
+ maxOccurs="unbounded"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="validated-byType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="value"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute type="xs:boolean"
name="include-existing-validators" use="optional"/>
+ </xs:complexType>
+ <xs:complexType name="constraintType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="message"
minOccurs="0"/>
+ <xs:element type="map:groupsType"
+ name="groups"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ <xs:element type="map:elementType"
+ name="element"
+ maxOccurs="unbounded"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ <xs:attribute type="xs:string" name="annotation"
use="required"/>
+ </xs:complexType>
+ <xs:complexType name="elementType" mixed="true">
+ <xs:sequence>
+ <xs:element type="xs:string" name="value"
maxOccurs="unbounded" minOccurs="0"/>
+ <xs:element type="map:annotationType"
+ name="annotation"
+ maxOccurs="unbounded"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ <xs:attribute type="xs:string" name="name"
use="required"/>
+ </xs:complexType>
+ <xs:complexType name="classType">
+ <xs:sequence>
+ <xs:element type="groupSequenceType"
name="group-sequence" minOccurs="0"/>
+ <xs:element type="map:constraintType"
+ name="constraint"
+ maxOccurs="unbounded"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ <xs:attribute type="xs:boolean" name="ignore-annotations"
use="optional"/>
+ </xs:complexType>
+ <xs:complexType name="beanType">
+ <xs:sequence>
+ <xs:element type="map:classType"
+ name="class"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping">
+ </xs:element>
+ <xs:element type="map:fieldType"
+ name="field"
+ minOccurs="0"
+ maxOccurs="unbounded"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ <xs:element type="map:getterType"
+ name="getter"
+ minOccurs="0"
+ maxOccurs="unbounded"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ <xs:attribute type="xs:string" name="class"
use="required"/>
+ <xs:attribute type="xs:boolean" name="ignore-annotations"
use="optional"/>
+ </xs:complexType>
+ <xs:complexType name="annotationType">
+ <xs:sequence>
+ <xs:element type="map:elementType"
+ name="element"
+ maxOccurs="unbounded"
+ minOccurs="0"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="getterType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="valid"
minOccurs="0" fixed=""/>
+ <xs:element type="map:constraintType"
+ name="constraint"
+ minOccurs="0"
+ maxOccurs="unbounded"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ <xs:attribute type="xs:string" name="name"
use="required"/>
+ <xs:attribute type="xs:boolean" name="ignore-annotations"
use="optional"/>
+ </xs:complexType>
+ <xs:complexType name="constraint-definitionType">
+ <xs:sequence>
+ <xs:element type="map:validated-byType"
+ name="validated-by"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ <xs:attribute type="xs:string" name="annotation"
use="required"/>
+ </xs:complexType>
+ <xs:complexType name="fieldType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="valid"
minOccurs="0" fixed=""/>
+ <xs:element type="map:constraintType"
+ name="constraint"
+ minOccurs="0"
+ maxOccurs="unbounded"
+
xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"/>
+ </xs:sequence>
+ <xs:attribute type="xs:string" name="name"
use="required"/>
+ <xs:attribute type="xs:boolean" name="ignore-annotations"
use="optional"/>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file