All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.exolab.castor.mapping.xml.FieldHandlerDef Maven / Gradle / Ivy

/*
 * This class was automatically generated with 
 * Castor 1.3.1, using an XML
 * Schema.
 * $Id$
 */

package org.exolab.castor.mapping.xml;

/**
 * Class FieldHandlerDef.
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings("serial")
public class FieldHandlerDef implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _name.
     */
    private java.lang.String _name;

    /**
     * Field _clazz.
     */
    private java.lang.String _clazz;

    /**
     * Field _paramList.
     */
    private java.util.List _paramList;


      //----------------/
     //- Constructors -/
    //----------------/

    public FieldHandlerDef() {
        super();
        this._paramList = new java.util.ArrayList();
    }


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * 
     * 
     * @param vParam
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void addParam(
            final org.exolab.castor.mapping.xml.Param vParam)
    throws java.lang.IndexOutOfBoundsException {
        this._paramList.add(vParam);
    }

    /**
     * 
     * 
     * @param index
     * @param vParam
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void addParam(
            final int index,
            final org.exolab.castor.mapping.xml.Param vParam)
    throws java.lang.IndexOutOfBoundsException {
        this._paramList.add(index, vParam);
    }

    /**
     * Method enumerateParam.
     * 
     * @return an Enumeration over all possible elements of this
     * collection
     */
    public java.util.Enumeration enumerateParam(
    ) {
        return java.util.Collections.enumeration(this._paramList);
    }

    /**
     * Returns the value of field 'clazz'.
     * 
     * @return the value of field 'Clazz'.
     */
    public java.lang.String getClazz(
    ) {
        return this._clazz;
    }

    /**
     * Returns the value of field 'name'.
     * 
     * @return the value of field 'Name'.
     */
    public java.lang.String getName(
    ) {
        return this._name;
    }

    /**
     * Method getParam.
     * 
     * @param index
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     * @return the value of the org.exolab.castor.mapping.xml.Param
     * at the given index
     */
    public org.exolab.castor.mapping.xml.Param getParam(
            final int index)
    throws java.lang.IndexOutOfBoundsException {
        // check bounds for index
        if (index < 0 || index >= this._paramList.size()) {
            throw new IndexOutOfBoundsException("getParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]");
        }

        return (org.exolab.castor.mapping.xml.Param) _paramList.get(index);
    }

    /**
     * Method getParam.Returns the contents of the collection in an
     * Array.  

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.exolab.castor.mapping.xml.Param[] getParam( ) { org.exolab.castor.mapping.xml.Param[] array = new org.exolab.castor.mapping.xml.Param[0]; return (org.exolab.castor.mapping.xml.Param[]) this._paramList.toArray(array); } /** * Method getParamCount. * * @return the size of this collection */ public int getParamCount( ) { return this._paramList.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 iterateParam. * * @return an Iterator over all possible elements in this * collection */ public java.util.Iterator iterateParam( ) { return this._paramList.iterator(); } /** * * * @param out * @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 { org.exolab.castor.xml.Marshaller.marshal(this, out); } /** * * * @param handler * @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 { org.exolab.castor.xml.Marshaller.marshal(this, handler); } /** */ public void removeAllParam( ) { this._paramList.clear(); } /** * Method removeParam. * * @param vParam * @return true if the object was removed from the collection. */ public boolean removeParam( final org.exolab.castor.mapping.xml.Param vParam) { boolean removed = _paramList.remove(vParam); return removed; } /** * Method removeParamAt. * * @param index * @return the element removed from the collection */ public org.exolab.castor.mapping.xml.Param removeParamAt( final int index) { java.lang.Object obj = this._paramList.remove(index); return (org.exolab.castor.mapping.xml.Param) obj; } /** * Sets the value of field 'clazz'. * * @param clazz the value of field 'clazz'. */ public void setClazz( final java.lang.String clazz) { this._clazz = clazz; } /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ public void setName( final java.lang.String name) { this._name = name; } /** * * * @param index * @param vParam * @throws java.lang.IndexOutOfBoundsException if the index * given is outside the bounds of the collection */ public void setParam( final int index, final org.exolab.castor.mapping.xml.Param vParam) throws java.lang.IndexOutOfBoundsException { // check bounds for index if (index < 0 || index >= this._paramList.size()) { throw new IndexOutOfBoundsException("setParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]"); } this._paramList.set(index, vParam); } /** * * * @param vParamArray */ public void setParam( final org.exolab.castor.mapping.xml.Param[] vParamArray) { //-- copy array _paramList.clear(); for (int i = 0; i < vParamArray.length; i++) { this._paramList.add(vParamArray[i]); } } /** * Method unmarshal. * * @param reader * @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 * @return the unmarshaled * org.exolab.castor.mapping.xml.FieldHandlerDef */ public static org.exolab.castor.mapping.xml.FieldHandlerDef unmarshal( final java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (org.exolab.castor.mapping.xml.FieldHandlerDef) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.mapping.xml.FieldHandlerDef.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); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy