/*
 * 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 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 Filter.
 * 
 * @version $Revision$ $Date$
 */
public class Filter extends com.queplix.core.utils.jxb.JXBObject 
implements java.io.Serializable
{


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

    /**
     * Id of field which will be filtered
     */
    private java.lang.String _fieldId;

    /**
     * Id of form to filter by.
     *  By default current form will be used.
     */
    private java.lang.String _byFormId;

    /**
     * Id of field to filter by
     */
    private java.lang.String _byFieldId;


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

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


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

    /**
     * Returns the value of field 'byFieldId'. The field
     * 'byFieldId' has the following description: Id of field to
     * filter by
     * 
     * @return String
     * @return the value of field 'byFieldId'.
     */
    public java.lang.String getByFieldId()
    {
        return this._byFieldId;
    } //-- java.lang.String getByFieldId() 

    /**
     * Returns the value of field 'byFormId'. The field 'byFormId'
     * has the following description: Id of form to filter by.
     *  By default current form will be used.
     * 
     * @return String
     * @return the value of field 'byFormId'.
     */
    public java.lang.String getByFormId()
    {
        return this._byFormId;
    } //-- java.lang.String getByFormId() 

    /**
     * Returns the value of field 'fieldId'. The field 'fieldId'
     * has the following description: Id of field which will be
     * filtered
     * 
     * @return String
     * @return the value of field 'fieldId'.
     */
    public java.lang.String getFieldId()
    {
        return this._fieldId;
    } //-- java.lang.String getFieldId() 

    /**
     * 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 'byFieldId'. The field 'byFieldId'
     * has the following description: Id of field to filter by
     * 
     * @param byFieldId the value of field 'byFieldId'.
     */
    public void setByFieldId(java.lang.String byFieldId)
    {
        this._byFieldId = byFieldId;
    } //-- void setByFieldId(java.lang.String) 

    /**
     * Sets the value of field 'byFormId'. The field 'byFormId' has
     * the following description: Id of form to filter by.
     *  By default current form will be used.
     * 
     * @param byFormId the value of field 'byFormId'.
     */
    public void setByFormId(java.lang.String byFormId)
    {
        this._byFormId = byFormId;
    } //-- void setByFormId(java.lang.String) 

    /**
     * Sets the value of field 'fieldId'. The field 'fieldId' has
     * the following description: Id of field which will be
     * filtered
     * 
     * @param fieldId the value of field 'fieldId'.
     */
    public void setFieldId(java.lang.String fieldId)
    {
        this._fieldId = fieldId;
    } //-- void setFieldId(java.lang.String) 

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

}
