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.SequenceSetProperties;
28 * Class SequenceSetPropertiesDescriptor.
30 * @version $Revision$ $Date$
32 public class SequenceSetPropertiesDescriptor 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 SequenceSetPropertiesDescriptor()
67 _nsURI = "www.vamsas.ac.uk/jalview/version2";
68 _xmlName = "sequenceSetProperties";
69 _elementDefinition = true;
70 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
71 org.exolab.castor.mapping.FieldHandler handler = null;
72 org.exolab.castor.xml.FieldValidator fieldValidator = null;
73 // -- initialize attribute descriptors
76 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
77 java.lang.String.class, "_key", "key",
78 org.exolab.castor.xml.NodeType.Attribute);
79 desc.setImmutable(true);
80 handler = new org.exolab.castor.xml.XMLFieldHandler()
82 public java.lang.Object getValue(java.lang.Object object)
83 throws IllegalStateException
85 SequenceSetProperties target = (SequenceSetProperties) object;
86 return target.getKey();
89 public void setValue(java.lang.Object object, java.lang.Object value)
90 throws IllegalStateException, IllegalArgumentException
94 SequenceSetProperties target = (SequenceSetProperties) object;
95 target.setKey((java.lang.String) value);
96 } catch (java.lang.Exception ex)
98 throw new IllegalStateException(ex.toString());
102 public java.lang.Object newInstance(java.lang.Object parent)
107 desc.setHandler(handler);
108 desc.setMultivalued(false);
109 addFieldDescriptor(desc);
111 // -- validation code for: _key
112 fieldValidator = new org.exolab.castor.xml.FieldValidator();
114 org.exolab.castor.xml.validators.StringValidator typeValidator;
115 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
116 fieldValidator.setValidator(typeValidator);
117 typeValidator.setWhiteSpace("preserve");
119 desc.setValidator(fieldValidator);
121 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
122 java.lang.String.class, "_value", "value",
123 org.exolab.castor.xml.NodeType.Attribute);
124 desc.setImmutable(true);
125 handler = new org.exolab.castor.xml.XMLFieldHandler()
127 public java.lang.Object getValue(java.lang.Object object)
128 throws IllegalStateException
130 SequenceSetProperties target = (SequenceSetProperties) object;
131 return target.getValue();
134 public void setValue(java.lang.Object object, java.lang.Object value)
135 throws IllegalStateException, IllegalArgumentException
139 SequenceSetProperties target = (SequenceSetProperties) object;
140 target.setValue((java.lang.String) value);
141 } catch (java.lang.Exception ex)
143 throw new IllegalStateException(ex.toString());
147 public java.lang.Object newInstance(java.lang.Object parent)
152 desc.setHandler(handler);
153 desc.setMultivalued(false);
154 addFieldDescriptor(desc);
156 // -- validation code for: _value
157 fieldValidator = new org.exolab.castor.xml.FieldValidator();
159 org.exolab.castor.xml.validators.StringValidator typeValidator;
160 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
161 fieldValidator.setValidator(typeValidator);
162 typeValidator.setWhiteSpace("preserve");
164 desc.setValidator(fieldValidator);
165 // -- initialize element descriptors
174 * Method getAccessMode.
176 * @return the access mode specified for this class.
178 public org.exolab.castor.mapping.AccessMode getAccessMode()
184 * Method getIdentity.
186 * @return the identity field, null if this class has no identity.
188 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
190 return super.getIdentity();
194 * Method getJavaClass.
196 * @return the Java class represented by this descriptor.
198 public java.lang.Class getJavaClass()
200 return jalview.schemabinding.version2.SequenceSetProperties.class;
204 * Method getNameSpacePrefix.
206 * @return the namespace prefix to use when marshaling as XML.
208 public java.lang.String getNameSpacePrefix()
214 * Method getNameSpaceURI.
216 * @return the namespace URI used when marshaling and unmarshaling as XML.
218 public java.lang.String getNameSpaceURI()
224 * Method getValidator.
226 * @return a specific validator for the class described by this
229 public org.exolab.castor.xml.TypeValidator getValidator()
237 * @return the XML Name for the Class being described.
239 public java.lang.String getXMLName()
245 * Method isElementDefinition.
247 * @return true if XML schema definition of this Class is that of a global
248 * element or element with anonymous type definition.
250 public boolean isElementDefinition()
252 return _elementDefinition;