/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

package com.queplix.core.modules.config.jxb;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Enumeration;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.ContentHandler;

/**
 * This section contains hidden controls
 * 
 * @version $Revision$ $Date$
 */
public class HiddenControls extends com.queplix.core.utils.jxb.JXBObject 
implements java.io.Serializable
{


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

    /**
     * Encapsulates info about hidden control
     */
    private java.util.ArrayList _hiddenControlList;


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

    public HiddenControls() 
     {
        super();
        _hiddenControlList = new ArrayList();
    } //-- com.queplix.core.modules.config.jxb.HiddenControls()


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

    /**
     * Method addHiddenControl
     * 
     * 
     * 
     * @param vHiddenControl
     */
    public void addHiddenControl(com.queplix.core.modules.config.jxb.HiddenControl vHiddenControl)
        throws java.lang.IndexOutOfBoundsException
    {
        _hiddenControlList.add(vHiddenControl);
    } //-- void addHiddenControl(com.queplix.core.modules.config.jxb.HiddenControl) 

    /**
     * Method addHiddenControl
     * 
     * 
     * 
     * @param index
     * @param vHiddenControl
     */
    public void addHiddenControl(int index, com.queplix.core.modules.config.jxb.HiddenControl vHiddenControl)
        throws java.lang.IndexOutOfBoundsException
    {
        _hiddenControlList.add(index, vHiddenControl);
    } //-- void addHiddenControl(int, com.queplix.core.modules.config.jxb.HiddenControl) 

    /**
     * Method clearHiddenControl
     * 
     */
    public void clearHiddenControl()
    {
        _hiddenControlList.clear();
    } //-- void clearHiddenControl() 

    /**
     * Method enumerateHiddenControl
     * 
     * 
     * 
     * @return Enumeration
     */
    public java.util.Enumeration enumerateHiddenControl()
    {
        return new org.exolab.castor.util.IteratorEnumeration(_hiddenControlList.iterator());
    } //-- java.util.Enumeration enumerateHiddenControl() 

    /**
     * Method getHiddenControl
     * 
     * 
     * 
     * @param index
     * @return HiddenControl
     */
    public com.queplix.core.modules.config.jxb.HiddenControl getHiddenControl(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _hiddenControlList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (com.queplix.core.modules.config.jxb.HiddenControl) _hiddenControlList.get(index);
    } //-- com.queplix.core.modules.config.jxb.HiddenControl getHiddenControl(int) 

    /**
     * Method getHiddenControl
     * 
     * 
     * 
     * @return HiddenControl
     */
    public com.queplix.core.modules.config.jxb.HiddenControl[] getHiddenControl()
    {
        int size = _hiddenControlList.size();
        com.queplix.core.modules.config.jxb.HiddenControl[] mArray = new com.queplix.core.modules.config.jxb.HiddenControl[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (com.queplix.core.modules.config.jxb.HiddenControl) _hiddenControlList.get(index);
        }
        return mArray;
    } //-- com.queplix.core.modules.config.jxb.HiddenControl[] getHiddenControl() 

    /**
     * Method getHiddenControlCount
     * 
     * 
     * 
     * @return int
     */
    public int getHiddenControlCount()
    {
        return _hiddenControlList.size();
    } //-- int getHiddenControlCount() 

    /**
     * Method isValid
     * 
     * 
     * 
     * @return boolean
     */
    public boolean isValid()
    {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param out
     */
    public void marshal(java.io.Writer out)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param handler
     */
    public void marshal(org.xml.sax.ContentHandler handler)
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Method removeHiddenControl
     * 
     * 
     * 
     * @param vHiddenControl
     * @return boolean
     */
    public boolean removeHiddenControl(com.queplix.core.modules.config.jxb.HiddenControl vHiddenControl)
    {
        boolean removed = _hiddenControlList.remove(vHiddenControl);
        return removed;
    } //-- boolean removeHiddenControl(com.queplix.core.modules.config.jxb.HiddenControl) 

    /**
     * Method setHiddenControl
     * 
     * 
     * 
     * @param index
     * @param vHiddenControl
     */
    public void setHiddenControl(int index, com.queplix.core.modules.config.jxb.HiddenControl vHiddenControl)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _hiddenControlList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _hiddenControlList.set(index, vHiddenControl);
    } //-- void setHiddenControl(int, com.queplix.core.modules.config.jxb.HiddenControl) 

    /**
     * Method setHiddenControl
     * 
     * 
     * 
     * @param hiddenControlArray
     */
    public void setHiddenControl(com.queplix.core.modules.config.jxb.HiddenControl[] hiddenControlArray)
    {
        //-- copy array
        _hiddenControlList.clear();
        for (int i = 0; i < hiddenControlArray.length; i++) {
            _hiddenControlList.add(hiddenControlArray[i]);
        }
    } //-- void setHiddenControl(com.queplix.core.modules.config.jxb.HiddenControl) 

    /**
     * Method unmarshal
     * 
     * 
     * 
     * @param reader
     * @return Object
     */
    public static java.lang.Object unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        return (com.queplix.core.modules.config.jxb.HiddenControls) Unmarshaller.unmarshal(com.queplix.core.modules.config.jxb.HiddenControls.class, reader);
    } //-- java.lang.Object unmarshal(java.io.Reader) 

    /**
     * Method validate
     * 
     */
    public void validate()
        throws org.exolab.castor.xml.ValidationException
    {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
