2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.schemabinding.version2.descriptors;
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
25 import jalview.schemabinding.version2.PdbentryItem;
28 * Class PdbentryItemDescriptor.
30 * @version $Revision$ $Date$
32 public class PdbentryItemDescriptor extends
33 org.exolab.castor.xml.util.XMLClassDescriptorImpl
36 // --------------------------/
37 // - Class/Member Variables -/
38 // --------------------------/
41 * Field _elementDefinition.
43 private boolean _elementDefinition;
48 private java.lang.String _nsPrefix;
53 private java.lang.String _nsURI;
58 private java.lang.String _xmlName;
64 public PdbentryItemDescriptor()
67 _nsURI = "www.jalview.org";
68 _xmlName = "pdbentry";
69 _elementDefinition = false;
71 // -- set grouping compositor
72 setCompositorAsSequence();
73 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
74 org.exolab.castor.mapping.FieldHandler handler = null;
75 org.exolab.castor.xml.FieldValidator fieldValidator = null;
76 // -- initialize attribute descriptors
78 // -- initialize element descriptors
81 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
82 jalview.schemabinding.version2.Property.class, "_propertyList",
83 "property", org.exolab.castor.xml.NodeType.Element);
84 handler = new org.exolab.castor.xml.XMLFieldHandler()
86 public java.lang.Object getValue(java.lang.Object object)
87 throws IllegalStateException
89 PdbentryItem target = (PdbentryItem) object;
90 return target.getProperty();
93 public void setValue(java.lang.Object object, java.lang.Object value)
94 throws IllegalStateException, IllegalArgumentException
98 PdbentryItem target = (PdbentryItem) object;
99 target.addProperty((jalview.schemabinding.version2.Property) value);
100 } catch (java.lang.Exception ex)
102 throw new IllegalStateException(ex.toString());
106 public void resetValue(Object object) throws IllegalStateException,
107 IllegalArgumentException
111 PdbentryItem target = (PdbentryItem) object;
112 target.removeAllProperty();
113 } catch (java.lang.Exception ex)
115 throw new IllegalStateException(ex.toString());
119 public java.lang.Object newInstance(java.lang.Object parent)
121 return new jalview.schemabinding.version2.Property();
124 desc.setHandler(handler);
125 desc.setNameSpaceURI("www.jalview.org");
126 desc.setMultivalued(true);
127 addFieldDescriptor(desc);
129 // -- validation code for: _propertyList
130 fieldValidator = new org.exolab.castor.xml.FieldValidator();
131 fieldValidator.setMinOccurs(0);
134 desc.setValidator(fieldValidator);
142 * Method getAccessMode.
144 * @return the access mode specified for this class.
146 public org.exolab.castor.mapping.AccessMode getAccessMode()
152 * Method getIdentity.
154 * @return the identity field, null if this class has no identity.
156 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
158 return super.getIdentity();
162 * Method getJavaClass.
164 * @return the Java class represented by this descriptor.
166 public java.lang.Class getJavaClass()
168 return jalview.schemabinding.version2.PdbentryItem.class;
172 * Method getNameSpacePrefix.
174 * @return the namespace prefix to use when marshaling as XML.
176 public java.lang.String getNameSpacePrefix()
182 * Method getNameSpaceURI.
184 * @return the namespace URI used when marshaling and unmarshaling as XML.
186 public java.lang.String getNameSpaceURI()
192 * Method getValidator.
194 * @return a specific validator for the class described by this
197 public org.exolab.castor.xml.TypeValidator getValidator()
205 * @return the XML Name for the Class being described.
207 public java.lang.String getXMLName()
213 * Method isElementDefinition.
215 * @return true if XML schema definition of this Class is that of a global
216 * element or element with anonymous type definition.
218 public boolean isElementDefinition()
220 return _elementDefinition;