/*
 * 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 com.queplix.core.modules.config.jxb.types.PermissionsType;
import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
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;

/**
 * Button which shall be added into form
 * 
 * @version $Revision$ $Date$
 */
public class Button extends com.queplix.core.utils.jxb.JXBObject 
implements java.io.Serializable
{


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

    /**
     * Standard buttons are:
     *  "FORM_SEARCH_BUTTON"
     *  "FORM_CLEAR_BUTTON"
     *  "FORM_NEW_BUTTON"
     *  any of "FORM_CHANGE_BUTTON" | "FORM_UPDATE_BUTTON" |
     * "FORM_CHANGE_OR_UPDATE_BUTTON"
     *  
     */
    private java.lang.String _name;

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

    /**
     * Field _order
     */
    private java.lang.Integer _order;

    /**
     * Field _permission
     */
    private com.queplix.core.modules.config.jxb.types.PermissionsType _permission;

    /**
     * Field _captions
     */
    private com.queplix.core.modules.config.jxb.Captions _captions;


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

    public Button() 
     {
        super();
    } //-- com.queplix.core.modules.config.jxb.Button()


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

    /**
     * Returns the value of field 'caption'.
     * 
     * @return String
     * @return the value of field 'caption'.
     */
    public java.lang.String getCaption()
    {
        return this._caption;
    } //-- java.lang.String getCaption() 

    /**
     * Returns the value of field 'captions'.
     * 
     * @return Captions
     * @return the value of field 'captions'.
     */
    public com.queplix.core.modules.config.jxb.Captions getCaptions()
    {
        return this._captions;
    } //-- com.queplix.core.modules.config.jxb.Captions getCaptions() 

    /**
     * Returns the value of field 'name'. The field 'name' has the
     * following description: Standard buttons are:
     *  "FORM_SEARCH_BUTTON"
     *  "FORM_CLEAR_BUTTON"
     *  "FORM_NEW_BUTTON"
     *  any of "FORM_CHANGE_BUTTON" | "FORM_UPDATE_BUTTON" |
     * "FORM_CHANGE_OR_UPDATE_BUTTON"
     *  
     * 
     * @return String
     * @return the value of field 'name'.
     */
    public java.lang.String getName()
    {
        return this._name;
    } //-- java.lang.String getName() 

    /**
     * Returns the value of field 'order'.
     * 
     * @return Integer
     * @return the value of field 'order'.
     */
    public java.lang.Integer getOrder()
    {
        return this._order;
    } //-- java.lang.Integer getOrder() 

    /**
     * Returns the value of field 'permission'.
     * 
     * @return PermissionsType
     * @return the value of field 'permission'.
     */
    public com.queplix.core.modules.config.jxb.types.PermissionsType getPermission()
    {
        return this._permission;
    } //-- com.queplix.core.modules.config.jxb.types.PermissionsType getPermission() 

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

    /**
     * Sets the value of field 'caption'.
     * 
     * @param caption the value of field 'caption'.
     */
    public void setCaption(java.lang.String caption)
    {
        this._caption = caption;
    } //-- void setCaption(java.lang.String) 

    /**
     * Sets the value of field 'captions'.
     * 
     * @param captions the value of field 'captions'.
     */
    public void setCaptions(com.queplix.core.modules.config.jxb.Captions captions)
    {
        this._captions = captions;
    } //-- void setCaptions(com.queplix.core.modules.config.jxb.Captions) 

    /**
     * Sets the value of field 'name'. The field 'name' has the
     * following description: Standard buttons are:
     *  "FORM_SEARCH_BUTTON"
     *  "FORM_CLEAR_BUTTON"
     *  "FORM_NEW_BUTTON"
     *  any of "FORM_CHANGE_BUTTON" | "FORM_UPDATE_BUTTON" |
     * "FORM_CHANGE_OR_UPDATE_BUTTON"
     *  
     * 
     * @param name the value of field 'name'.
     */
    public void setName(java.lang.String name)
    {
        this._name = name;
    } //-- void setName(java.lang.String) 

    /**
     * Sets the value of field 'order'.
     * 
     * @param order the value of field 'order'.
     */
    public void setOrder(java.lang.Integer order)
    {
        this._order = order;
    } //-- void setOrder(java.lang.Integer) 

    /**
     * Sets the value of field 'permission'.
     * 
     * @param permission the value of field 'permission'.
     */
    public void setPermission(com.queplix.core.modules.config.jxb.types.PermissionsType permission)
    {
        this._permission = permission;
    } //-- void setPermission(com.queplix.core.modules.config.jxb.types.PermissionsType) 

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

}
