/*
 * 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;

/**
 * Class HtmlelementsType.
 * 
 * @version $Revision$ $Date$
 */
public class HtmlelementsType extends com.queplix.core.utils.jxb.JXBObject 
implements java.io.Serializable
{


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

    /**
     * Field _htmlelementList
     */
    private java.util.ArrayList _htmlelementList;


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

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


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

    /**
     * Method addHtmlelement
     * 
     * 
     * 
     * @param vHtmlelement
     */
    public void addHtmlelement(com.queplix.core.modules.config.jxb.Htmlelement vHtmlelement)
        throws java.lang.IndexOutOfBoundsException
    {
        _htmlelementList.add(vHtmlelement);
    } //-- void addHtmlelement(com.queplix.core.modules.config.jxb.Htmlelement) 

    /**
     * Method addHtmlelement
     * 
     * 
     * 
     * @param index
     * @param vHtmlelement
     */
    public void addHtmlelement(int index, com.queplix.core.modules.config.jxb.Htmlelement vHtmlelement)
        throws java.lang.IndexOutOfBoundsException
    {
        _htmlelementList.add(index, vHtmlelement);
    } //-- void addHtmlelement(int, com.queplix.core.modules.config.jxb.Htmlelement) 

    /**
     * Method clearHtmlelement
     * 
     */
    public void clearHtmlelement()
    {
        _htmlelementList.clear();
    } //-- void clearHtmlelement() 

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

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

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

    /**
     * Method getHtmlelementCount
     * 
     * 
     * 
     * @return int
     */
    public int getHtmlelementCount()
    {
        return _htmlelementList.size();
    } //-- int getHtmlelementCount() 

    /**
     * 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 removeHtmlelement
     * 
     * 
     * 
     * @param vHtmlelement
     * @return boolean
     */
    public boolean removeHtmlelement(com.queplix.core.modules.config.jxb.Htmlelement vHtmlelement)
    {
        boolean removed = _htmlelementList.remove(vHtmlelement);
        return removed;
    } //-- boolean removeHtmlelement(com.queplix.core.modules.config.jxb.Htmlelement) 

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

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

    /**
     * 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.HtmlelementsType) Unmarshaller.unmarshal(com.queplix.core.modules.config.jxb.HtmlelementsType.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() 

}
