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: NamingXMLType.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: * This element allows to define naming convention when naming a
019: * complexType, element or
020: * modelGroup. Indeed the user can decide of a prefix to add to
021: * each class name as well
022: * as a suffix. This naming style won't affect the names entered
023: * in the binding file but only
024: * the XML Names.
025: *
026: *
027: * @version $Revision: 6766 $ $Date$
028: */
029: public class NamingXMLType implements java.io.Serializable {
030:
031: //--------------------------/
032: //- Class/Member Variables -/
033: //--------------------------/
034:
035: /**
036: * Field _elementName.
037: */
038: private org.exolab.castor.builder.binding.xml.NamingType _elementName;
039:
040: /**
041: * Field _complexTypeName.
042: */
043: private org.exolab.castor.builder.binding.xml.NamingType _complexTypeName;
044:
045: /**
046: * Field _modelGroupName.
047: */
048: private org.exolab.castor.builder.binding.xml.NamingType _modelGroupName;
049:
050: //----------------/
051: //- Constructors -/
052: //----------------/
053:
054: public NamingXMLType() {
055: super ();
056: }
057:
058: //-----------/
059: //- Methods -/
060: //-----------/
061:
062: /**
063: * Returns the value of field 'complexTypeName'.
064: *
065: * @return the value of field 'ComplexTypeName'.
066: */
067: public org.exolab.castor.builder.binding.xml.NamingType getComplexTypeName() {
068: return this ._complexTypeName;
069: }
070:
071: /**
072: * Returns the value of field 'elementName'.
073: *
074: * @return the value of field 'ElementName'.
075: */
076: public org.exolab.castor.builder.binding.xml.NamingType getElementName() {
077: return this ._elementName;
078: }
079:
080: /**
081: * Returns the value of field 'modelGroupName'.
082: *
083: * @return the value of field 'ModelGroupName'.
084: */
085: public org.exolab.castor.builder.binding.xml.NamingType getModelGroupName() {
086: return this ._modelGroupName;
087: }
088:
089: /**
090: * Method isValid.
091: *
092: * @return true if this object is valid according to the schema
093: */
094: public boolean isValid() {
095: try {
096: validate();
097: } catch (org.exolab.castor.xml.ValidationException vex) {
098: return false;
099: }
100: return true;
101: }
102:
103: /**
104: *
105: *
106: * @param out
107: * @throws org.exolab.castor.xml.MarshalException if object is
108: * null or if any SAXException is thrown during marshaling
109: * @throws org.exolab.castor.xml.ValidationException if this
110: * object is an invalid instance according to the schema
111: */
112: public void marshal(final java.io.Writer out)
113: throws org.exolab.castor.xml.MarshalException,
114: org.exolab.castor.xml.ValidationException {
115: Marshaller.marshal(this , out);
116: }
117:
118: /**
119: *
120: *
121: * @param handler
122: * @throws java.io.IOException if an IOException occurs during
123: * marshaling
124: * @throws org.exolab.castor.xml.ValidationException if this
125: * object is an invalid instance according to the schema
126: * @throws org.exolab.castor.xml.MarshalException if object is
127: * null or if any SAXException is thrown during marshaling
128: */
129: public void marshal(final org.xml.sax.ContentHandler handler)
130: throws java.io.IOException,
131: org.exolab.castor.xml.MarshalException,
132: org.exolab.castor.xml.ValidationException {
133: Marshaller.marshal(this , handler);
134: }
135:
136: /**
137: * Sets the value of field 'complexTypeName'.
138: *
139: * @param complexTypeName the value of field 'complexTypeName'.
140: */
141: public void setComplexTypeName(
142: final org.exolab.castor.builder.binding.xml.NamingType complexTypeName) {
143: this ._complexTypeName = complexTypeName;
144: }
145:
146: /**
147: * Sets the value of field 'elementName'.
148: *
149: * @param elementName the value of field 'elementName'.
150: */
151: public void setElementName(
152: final org.exolab.castor.builder.binding.xml.NamingType elementName) {
153: this ._elementName = elementName;
154: }
155:
156: /**
157: * Sets the value of field 'modelGroupName'.
158: *
159: * @param modelGroupName the value of field 'modelGroupName'.
160: */
161: public void setModelGroupName(
162: final org.exolab.castor.builder.binding.xml.NamingType modelGroupName) {
163: this ._modelGroupName = modelGroupName;
164: }
165:
166: /**
167: * Method unmarshalNamingXMLType.
168: *
169: * @param reader
170: * @throws org.exolab.castor.xml.MarshalException if object is
171: * null or if any SAXException is thrown during marshaling
172: * @throws org.exolab.castor.xml.ValidationException if this
173: * object is an invalid instance according to the schema
174: * @return the unmarshaled
175: * org.exolab.castor.builder.binding.NamingXMLType
176: */
177: public static org.exolab.castor.builder.binding.xml.NamingXMLType unmarshalNamingXMLType(
178: final java.io.Reader reader)
179: throws org.exolab.castor.xml.MarshalException,
180: org.exolab.castor.xml.ValidationException {
181: return (org.exolab.castor.builder.binding.xml.NamingXMLType) Unmarshaller
182: .unmarshal(
183: org.exolab.castor.builder.binding.xml.NamingXMLType.class,
184: reader);
185: }
186:
187: /**
188: *
189: *
190: * @throws org.exolab.castor.xml.ValidationException if this
191: * object is an invalid instance according to the schema
192: */
193: public void validate()
194: throws org.exolab.castor.xml.ValidationException {
195: org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
196: validator.validate(this);
197: }
198:
199: }
|