1 /*
2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4 * Schema.
5 * $Id$
6 */
7
8 package org.exolab.castor.xml.schema.annotations.jdo;
9
10 /**
11 * Class PrimaryKey.
12 *
13 * @version $Revision$ $Date$
14 */
15 @SuppressWarnings("serial")
16 public class PrimaryKey extends PkType
17 implements java.io.Serializable
18 {
19
20
21 //----------------/
22 //- Constructors -/
23 //----------------/
24
25 public PrimaryKey() {
26 super();
27 }
28
29
30 //-----------/
31 //- Methods -/
32 //-----------/
33
34 /**
35 * Method isValid.
36 *
37 * @return true if this object is valid according to the schema
38 */
39 public boolean isValid(
40 ) {
41 try {
42 validate();
43 } catch (org.exolab.castor.xml.ValidationException vex) {
44 return false;
45 }
46 return true;
47 }
48
49 /**
50 *
51 *
52 * @param out
53 * @throws org.exolab.castor.xml.MarshalException if object is
54 * null or if any SAXException is thrown during marshaling
55 * @throws org.exolab.castor.xml.ValidationException if this
56 * object is an invalid instance according to the schema
57 */
58 public void marshal(
59 final java.io.Writer out)
60 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
61 org.exolab.castor.xml.Marshaller.marshal(this, out);
62 }
63
64 /**
65 *
66 *
67 * @param handler
68 * @throws java.io.IOException if an IOException occurs during
69 * marshaling
70 * @throws org.exolab.castor.xml.ValidationException if this
71 * object is an invalid instance according to the schema
72 * @throws org.exolab.castor.xml.MarshalException if object is
73 * null or if any SAXException is thrown during marshaling
74 */
75 public void marshal(
76 final org.xml.sax.ContentHandler handler)
77 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
78 org.exolab.castor.xml.Marshaller.marshal(this, handler);
79 }
80
81 /**
82 * Method unmarshal.
83 *
84 * @param reader
85 * @throws org.exolab.castor.xml.MarshalException if object is
86 * null or if any SAXException is thrown during marshaling
87 * @throws org.exolab.castor.xml.ValidationException if this
88 * object is an invalid instance according to the schema
89 * @return the unmarshaled
90 * org.exolab.castor.xml.schema.annotations.jdo.PrimaryKey
91 */
92 public static org.exolab.castor.xml.schema.annotations.jdo.PrimaryKey unmarshal(
93 final java.io.Reader reader)
94 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
95 return (org.exolab.castor.xml.schema.annotations.jdo.PrimaryKey) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.xml.schema.annotations.jdo.PrimaryKey.class, reader);
96 }
97
98 /**
99 *
100 *
101 * @throws org.exolab.castor.xml.ValidationException if this
102 * object is an invalid instance according to the schema
103 */
104 public void validate(
105 )
106 throws org.exolab.castor.xml.ValidationException {
107 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
108 validator.validate(this);
109 }
110
111 }