001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 1.1-M2</a>, using an XML
004: * Schema.
005: * $Id: PackageType.java 6766 2007-01-18 21:12:08Z wguttmn $
006: */
007:
008: package org.exolab.castor.builder.binding.xml;
009:
010: //---------------------------------/
011: //- Imported classes and packages -/
012: //---------------------------------/
013:
014: import org.exolab.castor.xml.Marshaller;
015: import org.exolab.castor.xml.Unmarshaller;
016:
017: /**
018: * Mappings between a namespace and a java package can directly
019: * be defined in the binding file. This element allows also the
020: * mapping
021: * between a package and a schemaLocation.
022: *
023: *
024: * @version $Revision: 6766 $ $Date$
025: */
026: public class PackageType implements java.io.Serializable {
027:
028: //--------------------------/
029: //- Class/Member Variables -/
030: //--------------------------/
031:
032: /**
033: * Field _name.
034: */
035: private java.lang.String _name;
036:
037: /**
038: * Field _packageTypeChoice.
039: */
040: private org.exolab.castor.builder.binding.xml.PackageTypeChoice _packageTypeChoice;
041:
042: //----------------/
043: //- Constructors -/
044: //----------------/
045:
046: public PackageType() {
047: super ();
048: }
049:
050: //-----------/
051: //- Methods -/
052: //-----------/
053:
054: /**
055: * Returns the value of field 'name'.
056: *
057: * @return the value of field 'Name'.
058: */
059: public java.lang.String getName() {
060: return this ._name;
061: }
062:
063: /**
064: * Returns the value of field 'packageTypeChoice'.
065: *
066: * @return the value of field 'PackageTypeChoice'.
067: */
068: public org.exolab.castor.builder.binding.xml.PackageTypeChoice getPackageTypeChoice() {
069: return this ._packageTypeChoice;
070: }
071:
072: /**
073: * Method isValid.
074: *
075: * @return true if this object is valid according to the schema
076: */
077: public boolean isValid() {
078: try {
079: validate();
080: } catch (org.exolab.castor.xml.ValidationException vex) {
081: return false;
082: }
083: return true;
084: }
085:
086: /**
087: *
088: *
089: * @param out
090: * @throws org.exolab.castor.xml.MarshalException if object is
091: * null or if any SAXException is thrown during marshaling
092: * @throws org.exolab.castor.xml.ValidationException if this
093: * object is an invalid instance according to the schema
094: */
095: public void marshal(final java.io.Writer out)
096: throws org.exolab.castor.xml.MarshalException,
097: org.exolab.castor.xml.ValidationException {
098: Marshaller.marshal(this , out);
099: }
100:
101: /**
102: *
103: *
104: * @param handler
105: * @throws java.io.IOException if an IOException occurs during
106: * marshaling
107: * @throws org.exolab.castor.xml.ValidationException if this
108: * object is an invalid instance according to the schema
109: * @throws org.exolab.castor.xml.MarshalException if object is
110: * null or if any SAXException is thrown during marshaling
111: */
112: public void marshal(final org.xml.sax.ContentHandler handler)
113: throws java.io.IOException,
114: org.exolab.castor.xml.MarshalException,
115: org.exolab.castor.xml.ValidationException {
116: Marshaller.marshal(this , handler);
117: }
118:
119: /**
120: * Sets the value of field 'name'.
121: *
122: * @param name the value of field 'name'.
123: */
124: public void setName(final java.lang.String name) {
125: this ._name = name;
126: }
127:
128: /**
129: * Sets the value of field 'packageTypeChoice'.
130: *
131: * @param packageTypeChoice the value of field
132: * 'packageTypeChoice'.
133: */
134: public void setPackageTypeChoice(
135: final org.exolab.castor.builder.binding.xml.PackageTypeChoice packageTypeChoice) {
136: this ._packageTypeChoice = packageTypeChoice;
137: }
138:
139: /**
140: * Method unmarshalPackageType.
141: *
142: * @param reader
143: * @throws org.exolab.castor.xml.MarshalException if object is
144: * null or if any SAXException is thrown during marshaling
145: * @throws org.exolab.castor.xml.ValidationException if this
146: * object is an invalid instance according to the schema
147: * @return the unmarshaled
148: * org.exolab.castor.builder.binding.PackageType
149: */
150: public static org.exolab.castor.builder.binding.xml.PackageType unmarshalPackageType(
151: final java.io.Reader reader)
152: throws org.exolab.castor.xml.MarshalException,
153: org.exolab.castor.xml.ValidationException {
154: return (org.exolab.castor.builder.binding.xml.PackageType) Unmarshaller
155: .unmarshal(
156: org.exolab.castor.builder.binding.xml.PackageType.class,
157: reader);
158: }
159:
160: /**
161: *
162: *
163: * @throws org.exolab.castor.xml.ValidationException if this
164: * object is an invalid instance according to the schema
165: */
166: public void validate()
167: throws org.exolab.castor.xml.ValidationException {
168: org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
169: validator.validate(this);
170: }
171:
172: }
|