2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
\r
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2.descriptors;
\r
21 //---------------------------------/
\r
22 //- Imported classes and packages -/
\r
23 //---------------------------------/
\r
25 import jalview.schemabinding.version2.PdbentryItem;
\r
28 * Class PdbentryItemDescriptor.
\r
30 * @version $Revision$ $Date$
\r
32 public class PdbentryItemDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
\r
35 //--------------------------/
\r
36 //- Class/Member Variables -/
\r
37 //--------------------------/
\r
40 * Field _elementDefinition.
\r
42 private boolean _elementDefinition;
\r
47 private java.lang.String _nsPrefix;
\r
52 private java.lang.String _nsURI;
\r
57 private java.lang.String _xmlName;
\r
64 public PdbentryItemDescriptor() {
\r
66 _nsURI = "www.jalview.org";
\r
67 _xmlName = "pdbentry";
\r
68 _elementDefinition = false;
\r
70 //-- set grouping compositor
\r
71 setCompositorAsSequence();
\r
72 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
\r
73 org.exolab.castor.mapping.FieldHandler handler = null;
\r
74 org.exolab.castor.xml.FieldValidator fieldValidator = null;
\r
75 //-- initialize attribute descriptors
\r
77 //-- initialize element descriptors
\r
80 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
\r
81 handler = new org.exolab.castor.xml.XMLFieldHandler() {
\r
82 public java.lang.Object getValue( java.lang.Object object )
\r
83 throws IllegalStateException
\r
85 PdbentryItem target = (PdbentryItem) object;
\r
86 return target.getProperty();
\r
88 public void setValue( java.lang.Object object, java.lang.Object value)
\r
89 throws IllegalStateException, IllegalArgumentException
\r
92 PdbentryItem target = (PdbentryItem) object;
\r
93 target.addProperty( (jalview.schemabinding.version2.Property) value);
\r
94 } catch (java.lang.Exception ex) {
\r
95 throw new IllegalStateException(ex.toString());
\r
98 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
\r
100 PdbentryItem target = (PdbentryItem) object;
\r
101 target.removeAllProperty();
\r
102 } catch (java.lang.Exception ex) {
\r
103 throw new IllegalStateException(ex.toString());
\r
106 public java.lang.Object newInstance(java.lang.Object parent) {
\r
107 return new jalview.schemabinding.version2.Property();
\r
110 desc.setHandler(handler);
\r
111 desc.setNameSpaceURI("www.jalview.org");
\r
112 desc.setMultivalued(true);
\r
113 addFieldDescriptor(desc);
\r
115 //-- validation code for: _propertyList
\r
116 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
117 fieldValidator.setMinOccurs(0);
\r
120 desc.setValidator(fieldValidator);
\r
129 * Method getAccessMode.
\r
131 * @return the access mode specified for this class.
\r
133 public org.exolab.castor.mapping.AccessMode getAccessMode(
\r
139 * Method getIdentity.
\r
141 * @return the identity field, null if this class has no
\r
144 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
\r
146 return super.getIdentity();
\r
150 * Method getJavaClass.
\r
152 * @return the Java class represented by this descriptor.
\r
154 public java.lang.Class getJavaClass(
\r
156 return jalview.schemabinding.version2.PdbentryItem.class;
\r
160 * Method getNameSpacePrefix.
\r
162 * @return the namespace prefix to use when marshaling as XML.
\r
164 public java.lang.String getNameSpacePrefix(
\r
170 * Method getNameSpaceURI.
\r
172 * @return the namespace URI used when marshaling and
\r
173 * unmarshaling as XML.
\r
175 public java.lang.String getNameSpaceURI(
\r
181 * Method getValidator.
\r
183 * @return a specific validator for the class described by this
\r
186 public org.exolab.castor.xml.TypeValidator getValidator(
\r
192 * Method getXMLName.
\r
194 * @return the XML Name for the Class being described.
\r
196 public java.lang.String getXMLName(
\r
202 * Method isElementDefinition.
\r
204 * @return true if XML schema definition of this Class is that
\r
206 * element or element with anonymous type definition.
\r
208 public boolean isElementDefinition(
\r
210 return _elementDefinition;
\r