001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
004: * Schema.
005: * $Id$
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 type represents the binding for the 'content' member
019: * generated
020: * as part of a 'mixed' complex type definition. It allows the
021: * definition
022: * of its name.
023: *
024: *
025: * @version $Revision$ $Date$
026: */
027: public class ContentMemberType implements java.io.Serializable {
028:
029: //--------------------------/
030: //- Class/Member Variables -/
031: //--------------------------/
032:
033: /**
034: * Field _name.
035: */
036: private java.lang.String _name;
037:
038: /**
039: * Field _visibility.
040: */
041: private org.exolab.castor.builder.binding.xml.types.VisibilityType _visibility;
042:
043: //----------------/
044: //- Constructors -/
045: //----------------/
046:
047: public ContentMemberType() {
048: super ();
049: }
050:
051: //-----------/
052: //- Methods -/
053: //-----------/
054:
055: /**
056: * Returns the value of field 'name'.
057: *
058: * @return the value of field 'Name'.
059: */
060: public java.lang.String getName() {
061: return this ._name;
062: }
063:
064: /**
065: * Returns the value of field 'visibility'.
066: *
067: * @return the value of field 'Visibility'.
068: */
069: public org.exolab.castor.builder.binding.xml.types.VisibilityType getVisibility() {
070: return this ._visibility;
071: }
072:
073: /**
074: * Method isValid.
075: *
076: * @return true if this object is valid according to the schema
077: */
078: public boolean isValid() {
079: try {
080: validate();
081: } catch (org.exolab.castor.xml.ValidationException vex) {
082: return false;
083: }
084: return true;
085: }
086:
087: /**
088: *
089: *
090: * @param out
091: * @throws org.exolab.castor.xml.MarshalException if object is
092: * null or if any SAXException is thrown during marshaling
093: * @throws org.exolab.castor.xml.ValidationException if this
094: * object is an invalid instance according to the schema
095: */
096: public void marshal(final java.io.Writer out)
097: throws org.exolab.castor.xml.MarshalException,
098: org.exolab.castor.xml.ValidationException {
099: Marshaller.marshal(this , out);
100: }
101:
102: /**
103: *
104: *
105: * @param handler
106: * @throws java.io.IOException if an IOException occurs during
107: * marshaling
108: * @throws org.exolab.castor.xml.ValidationException if this
109: * object is an invalid instance according to the schema
110: * @throws org.exolab.castor.xml.MarshalException if object is
111: * null or if any SAXException is thrown during marshaling
112: */
113: public void marshal(final org.xml.sax.ContentHandler handler)
114: throws java.io.IOException,
115: org.exolab.castor.xml.MarshalException,
116: org.exolab.castor.xml.ValidationException {
117: Marshaller.marshal(this , handler);
118: }
119:
120: /**
121: * Sets the value of field 'name'.
122: *
123: * @param name the value of field 'name'.
124: */
125: public void setName(final java.lang.String name) {
126: this ._name = name;
127: }
128:
129: /**
130: * Sets the value of field 'visibility'.
131: *
132: * @param visibility the value of field 'visibility'.
133: */
134: public void setVisibility(
135: final org.exolab.castor.builder.binding.xml.types.VisibilityType visibility) {
136: this ._visibility = visibility;
137: }
138:
139: /**
140: * Method unmarshalContentMemberType.
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.xml.ContentMemberType
149: */
150: public static org.exolab.castor.builder.binding.xml.ContentMemberType unmarshalContentMemberType(
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.ContentMemberType) Unmarshaller
155: .unmarshal(
156: org.exolab.castor.builder.binding.xml.ContentMemberType.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: }
|