Note: Just in case the collection - * contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This - * way we know that the Array returned is of exactly the correct length. - * - * @return this collection as an Array - */ - public org.springframework.oxm.castor.Flight[] getFlight() { - org.springframework.oxm.castor.Flight[] array = new org.springframework.oxm.castor.Flight[0]; - return (org.springframework.oxm.castor.Flight[]) this._flightList.toArray(array); - } - - /** - * Method getFlightCount. - * - * @return the size of this collection - */ - public int getFlightCount() { - return this._flightList.size(); - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid() { - try { - validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * Method iterateFlight. - * - * @return an Iterator over all possible elements in this collection - */ - public java.util.Iterator iterateFlight() { - return this._flightList.iterator(); - } - - /** - * @throws org.exolab.castor.xml.MarshalException - * if object is null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException - * if this object is an invalid instance according to the schema - */ - public void marshal(final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * @throws java.io.IOException if an IOException occurs during marshaling - * @throws org.exolab.castor.xml.ValidationException - * if this object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException - * if object is null or if any SAXException is thrown during marshaling - */ - public void marshal(final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, - org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - */ - public void removeAllFlight() { - this._flightList.clear(); - } - - /** - * Method removeFlight. - * - * @return true if the object was removed from the collection. - */ - public boolean removeFlight(final org.springframework.oxm.castor.Flight vFlight) { - boolean removed = _flightList.remove(vFlight); - return removed; - } - - /** - * Method removeFlightAt. - * - * @return the element removed from the collection - */ - public org.springframework.oxm.castor.Flight removeFlightAt(final int index) { - java.lang.Object obj = this._flightList.remove(index); - return (org.springframework.oxm.castor.Flight) obj; - } - - /** - * @throws java.lang.IndexOutOfBoundsException - * if the index given is outside the bounds of the collection - */ - public void setFlight(final int index, final org.springframework.oxm.castor.Flight vFlight) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._flightList.size()) { - throw new IndexOutOfBoundsException( - "setFlight: Index value '" + index + "' not in range [0.." + (this._flightList.size() - 1) + "]"); - } - - this._flightList.set(index, vFlight); - } - - /** - * - * - * @param vFlightArray - */ - public void setFlight(final org.springframework.oxm.castor.Flight[] vFlightArray) { - //-- copy array - _flightList.clear(); - - for (int i = 0; i < vFlightArray.length; i++) { - this._flightList.add(vFlightArray[i]); - } - } - - /** - * Method unmarshal. - * - * @return the unmarshaled org.springframework.oxm.castor.Flight - * @throws org.exolab.castor.xml.MarshalException - * if object is null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException - * if this object is an invalid instance according to the schema - */ - public static org.springframework.oxm.castor.Flights unmarshal(final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (org.springframework.oxm.castor.Flights) Unmarshaller - .unmarshal(org.springframework.oxm.castor.Flights.class, reader); - } - - /** - * @throws org.exolab.castor.xml.ValidationException - * if this object is an invalid instance according to the schema - */ - public void validate() throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } - -} diff --git a/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightDescriptor.java b/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightDescriptor.java deleted file mode 100644 index 11550b2766..0000000000 --- a/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightDescriptor.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This class was automatically generated with - * Castor 1.1, using an XML - * Schema. - * $Id$ - */ - -package org.springframework.oxm.castor.descriptors; - -//---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -/** - * Class FlightDescriptor. - * - * @version $Revision$ $Date$ - */ -public class FlightDescriptor extends org.springframework.oxm.castor.descriptors.FlightTypeDescriptor { - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** Field _elementDefinition. */ - private boolean _elementDefinition; - - /** Field _nsPrefix. */ - private java.lang.String _nsPrefix; - - /** Field _nsURI. */ - private java.lang.String _nsURI; - - /** Field _xmlName. */ - private java.lang.String _xmlName; - - /** Field _identity. */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - - //----------------/ - //- Constructors -/ - //----------------/ - - public FlightDescriptor() { - super(); - setExtendsWithoutFlatten(new org.springframework.oxm.castor.descriptors.FlightTypeDescriptor()); - _nsURI = "http://samples.springframework.org/flight"; - _xmlName = "flight"; - _elementDefinition = true; - } - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode() { - return null; - } - - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity() { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; - } - - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass() { - return org.springframework.oxm.castor.Flight.class; - } - - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix() { - return _nsPrefix; - } - - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI() { - return _nsURI; - } - - /** - * Method getValidator. - * - * @return a specific validator for the class described by this ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator() { - return this; - } - - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName() { - return _xmlName; - } - - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that of a global element or element with anonymous type - * definition. - */ - public boolean isElementDefinition() { - return _elementDefinition; - } - -} diff --git a/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightTypeDescriptor.java b/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightTypeDescriptor.java deleted file mode 100644 index 5ed057661a..0000000000 --- a/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightTypeDescriptor.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * This class was automatically generated with - * Castor 1.1, using an XML - * Schema. - * $Id$ - */ - -package org.springframework.oxm.castor.descriptors; - -//---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import org.springframework.oxm.castor.FlightType; - -/** - * Class FlightTypeDescriptor. - * - * @version $Revision$ $Date$ - */ -public class FlightTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** Field _elementDefinition. */ - private boolean _elementDefinition; - - /** Field _nsPrefix. */ - private java.lang.String _nsPrefix; - - /** Field _nsURI. */ - private java.lang.String _nsURI; - - /** Field _xmlName. */ - private java.lang.String _xmlName; - - /** Field _identity. */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - - //----------------/ - //- Constructors -/ - //----------------/ - - public FlightTypeDescriptor() { - super(); - _nsURI = "http://samples.springframework.org/flight"; - _xmlName = "flightType"; - _elementDefinition = false; - - //-- set grouping compositor - setCompositorAsSequence(); - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- initialize element descriptors - - //-- _number - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_number", "number", - org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException { - FlightType target = (FlightType) object; - if (!target.hasNumber()) { - return null; - } - return new java.lang.Long(target.getNumber()); - } - - public void setValue(java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException { - try { - FlightType target = (FlightType) object; - // ignore null values for non optional primitives - if (value == null) { - return; - } - - target.setNumber(((java.lang.Long) value).longValue()); - } - catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("http://samples.springframework.org/flight"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _number - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.LongValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.LongValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-9223372036854775808L); - typeValidator.setMaxInclusive(9223372036854775807L); - } - desc.setValidator(fieldValidator); - } - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode() { - return null; - } - - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity() { - return _identity; - } - - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass() { - return org.springframework.oxm.castor.FlightType.class; - } - - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix() { - return _nsPrefix; - } - - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI() { - return _nsURI; - } - - /** - * Method getValidator. - * - * @return a specific validator for the class described by this ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator() { - return this; - } - - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName() { - return _xmlName; - } - - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that of a global element or element with anonymous type - * definition. - */ - public boolean isElementDefinition() { - return _elementDefinition; - } - -} diff --git a/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightsDescriptor.java b/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightsDescriptor.java deleted file mode 100644 index e532d6ff09..0000000000 --- a/org.springframework.oxm/src/test/java/org/springframework/oxm/castor/descriptors/FlightsDescriptor.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * This class was automatically generated with - * Castor 1.1, using an XML - * Schema. - * $Id$ - */ - -package org.springframework.oxm.castor.descriptors; - -//---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import org.springframework.oxm.castor.Flights; - -/** - * Class FlightsDescriptor. - * - * @version $Revision$ $Date$ - */ -public class FlightsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** Field _elementDefinition. */ - private boolean _elementDefinition; - - /** Field _nsPrefix. */ - private java.lang.String _nsPrefix; - - /** Field _nsURI. */ - private java.lang.String _nsURI; - - /** Field _xmlName. */ - private java.lang.String _xmlName; - - /** Field _identity. */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - - //----------------/ - //- Constructors -/ - //----------------/ - - public FlightsDescriptor() { - super(); - _nsURI = "http://samples.springframework.org/flight"; - _xmlName = "flights"; - _elementDefinition = true; - - //-- set grouping compositor - setCompositorAsSequence(); - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- initialize element descriptors - - //-- _flightList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.springframework.oxm.castor.Flight.class, - "_flightList", "flight", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException { - Flights target = (Flights) object; - return target.getFlight(); - } - - public void setValue(java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException { - try { - Flights target = (Flights) object; - target.addFlight((org.springframework.oxm.castor.Flight) value); - } - catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Flights target = (Flights) object; - target.removeAllFlight(); - } - catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - - public java.lang.Object newInstance(java.lang.Object parent) { - return new org.springframework.oxm.castor.Flight(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("http://samples.springframework.org/flight"); - desc.setRequired(true); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _flightList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - } - desc.setValidator(fieldValidator); - } - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode() { - return null; - } - - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity() { - return _identity; - } - - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass() { - return org.springframework.oxm.castor.Flights.class; - } - - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix() { - return _nsPrefix; - } - - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI() { - return _nsURI; - } - - /** - * Method getValidator. - * - * @return a specific validator for the class described by this ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator() { - return this; - } - - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName() { - return _xmlName; - } - - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that of a global element or element with anonymous type - * definition. - */ - public boolean isElementDefinition() { - return _elementDefinition; - } - -} diff --git a/org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/FlightType.java b/org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/FlightType.java deleted file mode 100644 index 6853387fad..0000000000 --- a/org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/FlightType.java +++ /dev/null @@ -1,47 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.3-b01-fcs -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2009.01.08 at 12:41:36 PM CET -// - -package org.springframework.oxm.jaxb; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -/** - *
Java class for flightType complex type. - * - *
The following schema fragment specifies the expected content contained within this class. - * - *
- * <complexType name="flightType"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="number" type="{http://www.w3.org/2001/XMLSchema}long"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - *- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "flightType", propOrder = {"number"}) -public class FlightType { - - protected long number; - - /** Gets the value of the number property. */ - public long getNumber() { - return number; - } - - /** Sets the value of the number property. */ - public void setNumber(long value) { - this.number = value; - } - -} diff --git a/org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/Flights.java b/org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/Flights.java deleted file mode 100644 index 4122d2598d..0000000000 --- a/org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/Flights.java +++ /dev/null @@ -1,66 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.3-b01-fcs -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2009.01.08 at 12:41:36 PM CET -// - -package org.springframework.oxm.jaxb; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - *
Java class for anonymous complex type. - * - *
The following schema fragment specifies the expected content contained within this class. - * - *
- * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="flight" type="{http://samples.springframework.org/flight}flightType" - * maxOccurs="unbounded"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - *- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = {"flight"}) -@XmlRootElement(name = "flights") -public class Flights { - - @XmlElement(required = true) - protected List
This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make
- * to the returned list will be present inside the JAXB object. This is why there is not a set
method for
- * the flight property.
- *
- *
For example, to add a new item, do as follows: - *
- * getFlight().add(newItem); - *- * - * - *
Objects of the following type(s) are allowed in the list {@link FlightType }
- */
- public List An ObjectFactory allows you to programatically construct new instances of
- * the Java representation for XML content. The Java representation of XML content can consist of schema derived
- * interfaces and classes representing the binding of schema type definitions, element declarations and model groups.
- * Factory methods for each of these are provided in this class.
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _Flight_QNAME = new QName("http://samples.springframework.org/flight", "flight");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package:
- * org.springframework.oxm.jaxb
- */
- public ObjectFactory() {
- }
-
- /** Create an instance of {@link FlightType } */
- public FlightType createFlightType() {
- return new FlightType();
- }
-
- /** Create an instance of {@link Flights } */
- public Flights createFlights() {
- return new Flights();
- }
-
- /** Create an instance of {@link JAXBElement }{@code <}{@link FlightType }{@code >}} */
- @XmlElementDecl(namespace = "http://samples.springframework.org/flight", name = "flight")
- public JAXBElement