View Javadoc
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.builder.binding.xml;
9   
10  /**
11   * Mappings between a namespace and a java package can directly 
12   *  be defined in the binding file. This element allows also the
13   * mapping
14   *  between a package and a schemaLocation.
15   *  
16   * 
17   * @version $Revision$ $Date$
18   */
19  public class PackageType implements java.io.Serializable {
20  
21  
22        //--------------------------/
23       //- Class/Member Variables -/
24      //--------------------------/
25  
26      /**
27       * Field _name.
28       */
29      private java.lang.String _name;
30  
31      /**
32       * Field _packageTypeChoice.
33       */
34      private org.exolab.castor.builder.binding.xml.PackageTypeChoice _packageTypeChoice;
35  
36  
37        //----------------/
38       //- Constructors -/
39      //----------------/
40  
41      public PackageType() {
42          super();
43      }
44  
45  
46        //-----------/
47       //- Methods -/
48      //-----------/
49  
50      /**
51       * Returns the value of field 'name'.
52       * 
53       * @return the value of field 'Name'.
54       */
55      public java.lang.String getName(
56      ) {
57          return this._name;
58      }
59  
60      /**
61       * Returns the value of field 'packageTypeChoice'.
62       * 
63       * @return the value of field 'PackageTypeChoice'.
64       */
65      public org.exolab.castor.builder.binding.xml.PackageTypeChoice getPackageTypeChoice(
66      ) {
67          return this._packageTypeChoice;
68      }
69  
70      /**
71       * Method isValid.
72       * 
73       * @return true if this object is valid according to the schema
74       */
75      public boolean isValid(
76      ) {
77          try {
78              validate();
79          } catch (org.exolab.castor.xml.ValidationException vex) {
80              return false;
81          }
82          return true;
83      }
84  
85      /**
86       * 
87       * 
88       * @param out
89       * @throws org.exolab.castor.xml.MarshalException if object is
90       * null or if any SAXException is thrown during marshaling
91       * @throws org.exolab.castor.xml.ValidationException if this
92       * object is an invalid instance according to the schema
93       */
94      public void marshal(
95              final java.io.Writer out)
96      throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
97          org.exolab.castor.xml.Marshaller.marshal(this, out);
98      }
99  
100     /**
101      * 
102      * 
103      * @param handler
104      * @throws java.io.IOException if an IOException occurs during
105      * marshaling
106      * @throws org.exolab.castor.xml.ValidationException if this
107      * object is an invalid instance according to the schema
108      * @throws org.exolab.castor.xml.MarshalException if object is
109      * null or if any SAXException is thrown during marshaling
110      */
111     public void marshal(
112             final org.xml.sax.ContentHandler handler)
113     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
114         org.exolab.castor.xml.Marshaller.marshal(this, handler);
115     }
116 
117     /**
118      * Sets the value of field 'name'.
119      * 
120      * @param name the value of field 'name'.
121      */
122     public void setName(
123             final java.lang.String name) {
124         this._name = name;
125     }
126 
127     /**
128      * Sets the value of field 'packageTypeChoice'.
129      * 
130      * @param packageTypeChoice the value of field
131      * 'packageTypeChoice'.
132      */
133     public void setPackageTypeChoice(
134             final org.exolab.castor.builder.binding.xml.PackageTypeChoice packageTypeChoice) {
135         this._packageTypeChoice = packageTypeChoice;
136     }
137 
138     /**
139      * Method unmarshalPackageType.
140      * 
141      * @param reader
142      * @throws org.exolab.castor.xml.MarshalException if object is
143      * null or if any SAXException is thrown during marshaling
144      * @throws org.exolab.castor.xml.ValidationException if this
145      * object is an invalid instance according to the schema
146      * @return the unmarshaled
147      * org.exolab.castor.builder.binding.xml.PackageType
148      */
149     public static org.exolab.castor.builder.binding.xml.PackageType unmarshalPackageType(
150             final java.io.Reader reader)
151     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
152         return (org.exolab.castor.builder.binding.xml.PackageType) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.builder.binding.xml.PackageType.class, reader);
153     }
154 
155     /**
156      * 
157      * 
158      * @throws org.exolab.castor.xml.ValidationException if this
159      * object is an invalid instance according to the schema
160      */
161     public void validate(
162     )
163     throws org.exolab.castor.xml.ValidationException {
164         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
165         validator.validate(this);
166     }
167 
168 }