[hibernate-commits] Hibernate SVN: r18984 - validator/trunk/hibernate-validator/src/main/docbook/en-US/modules.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Thu Mar 11 15:13:02 EST 2010
Author: hardy.ferentschik
Date: 2010-03-11 15:13:01 -0500 (Thu, 11 Mar 2010)
New Revision: 18984
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml
Log:
HV-289
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml 2010-03-11 19:41:54 UTC (rev 18983)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml 2010-03-11 20:13:01 UTC (rev 18984)
@@ -64,6 +64,24 @@
</listitem>
</itemizedlist>
+ <note>
+ <para>Hibernate Validator uses JAXB for XML parsing. JAXB is part of the
+ Java Class Library since Java 6 which means that if you run Hibernate
+ Validator with Java 5 you will have to add additional JAXB dependecies.
+ Using maven you have to add the following dependencies:<programlisting><dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2</version>
+</dependency>
+<dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.12</version>
+</dependency>
+</programlisting> if you are using the SourceForge package you find the
+ necessary libraries in the <filename>lib/jdk5</filename> directory.</para>
+ </note>
+
<section id="validator-gettingstarted-createproject">
<title>Setting up a new Maven project</title>
@@ -102,9 +120,9 @@
class <classname>Car</classname>:</para>
<example id="example-class-car">
- <title>Class Car annotated with constraints</title>
+ <title>Class Car annotated with constraints</title>
- <programlisting role="JAVA" language="JAVA">package com.mycompany;
+ <programlisting language="JAVA" role="JAVA">package com.mycompany;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
@@ -130,9 +148,11 @@
//getters and setters ...
}</programlisting>
- </example><para><classname>@NotNull</classname>, <classname>@Size</classname>
- and <classname>@Min</classname> are so-called constraint annotations, that
- we use to declare constraints, which shall be applied to the fields of a
+ </example>
+
+ <para><classname>@NotNull</classname>, <classname>@Size</classname> and
+ <classname>@Min</classname> are so-called constraint annotations, that we
+ use to declare constraints, which shall be applied to the fields of a
<classname>Car</classname> instance:</para>
<itemizedlist>
@@ -161,7 +181,7 @@
<example>
<title>Class CarTest showing validation examples</title>
- <programlisting role="JAVA" language="JAVA">package com.mycompany;
+ <programlisting language="JAVA" role="JAVA">package com.mycompany;
import static org.junit.Assert.*;
@@ -274,10 +294,10 @@
<title>Where to go next?</title>
<para>That concludes our 5 minute tour through the world of Hibernate
- Validator. Continue exploring the code or look at further examples
- referenced in <xref linkend="chapter-further-reading" />. To get a deeper
- understanding of the Bean Validation just continue reading.<xref
- linkend="validator-usingvalidator" />. In case your application has
+ Validator. Continue exploring the code examples or look at further
+ examples referenced in <xref linkend="chapter-further-reading" />. To
+ deepen your understanding of Hibernate Validator just continue reading
+ <xref linkend="validator-usingvalidator" />. In case your application has
specific validation requirements have a look at <xref
linkend="validator-customconstraints" />.</para>
</section>
More information about the hibernate-commits
mailing list