org.nuiton.topia.framework
Class TopiaFilter

java.lang.Object
  extended by org.nuiton.topia.framework.TopiaFilter
All Implemented Interfaces:
EntityFilter

public class TopiaFilter
extends Object
implements EntityFilter

Filter

Created: 23 avr. 2010

Since:
2.0
Author:
fdesbois

Field Summary
protected  Integer endIndex
           
protected  String orderBy
           
protected  String referenceId
           
protected  String referenceProperty
           
protected  Integer startIndex
           
 
Fields inherited from interface org.nuiton.topia.framework.EntityFilter
PROPERTY_END_INDEX, PROPERTY_ORDER_BY, PROPERTY_REFERENCE_ID, PROPERTY_REFERENCE_PROPERTY, PROPERTY_START_INDEX
 
Constructor Summary
TopiaFilter()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add PropertyChangeListener.
 void checkReference(Class<?> reference, boolean mandatory)
          Use to check if reference class is supported by the current filter reference.
 Integer getEndIndex()
          Get the value of endIndex
 String getOrderBy()
          Get the value of orderBy
 String getReferenceId()
          Get the value of referenceId
 String getReferenceProperty()
          Get the value of referenceProperty
 Integer getStartIndex()
          Get the value of startIndex
 boolean hasReference()
          Used to check if the filter contains a reference.
 boolean isClassReference(Class<?> entityClass)
          Test if the entityClass is corresponding to the current reference in the filter.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove PropertyChangeListener.
 void setEndIndex(Integer endIndex)
          Set the value of endIndex
 void setOrderBy(String orderBy)
          Set the value of orderBy
 void setReference(Object entity)
          Set the value of referenceId from entity
 void setReferenceId(String referenceId)
          Set the value of referenceId
 void setReferenceProperty(String referenceProperty)
          Set the value of referenceProperty
 void setStartIndex(Integer startIndex)
          Set the value of startIndex
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startIndex

protected Integer startIndex

endIndex

protected Integer endIndex

orderBy

protected String orderBy

referenceId

protected String referenceId

referenceProperty

protected String referenceProperty
Constructor Detail

TopiaFilter

public TopiaFilter()
Method Detail

getStartIndex

public Integer getStartIndex()
Description copied from interface: EntityFilter
Get the value of startIndex

Specified by:
getStartIndex in interface EntityFilter
Returns:
the value of startIndex

setStartIndex

public void setStartIndex(Integer startIndex)
Description copied from interface: EntityFilter
Set the value of startIndex

Specified by:
setStartIndex in interface EntityFilter
Parameters:
startIndex - new value of startIndex

getOrderBy

public String getOrderBy()
Description copied from interface: EntityFilter
Get the value of orderBy

Specified by:
getOrderBy in interface EntityFilter
Returns:
the value of orderBy

setOrderBy

public void setOrderBy(String orderBy)
Description copied from interface: EntityFilter
Set the value of orderBy

Specified by:
setOrderBy in interface EntityFilter
Parameters:
orderBy - new value of orderBy

getEndIndex

public Integer getEndIndex()
Description copied from interface: EntityFilter
Get the value of endIndex

Specified by:
getEndIndex in interface EntityFilter
Returns:
the value of endIndex

setEndIndex

public void setEndIndex(Integer endIndex)
Description copied from interface: EntityFilter
Set the value of endIndex

Specified by:
setEndIndex in interface EntityFilter
Parameters:
endIndex - new value of endIndex

getReferenceId

public String getReferenceId()
Description copied from interface: EntityFilter
Get the value of referenceId

Specified by:
getReferenceId in interface EntityFilter
Returns:
the value of referenceId

setReferenceId

public void setReferenceId(String referenceId)
Description copied from interface: EntityFilter
Set the value of referenceId

Specified by:
setReferenceId in interface EntityFilter

setReference

public void setReference(Object entity)
                  throws IllegalArgumentException
Description copied from interface: EntityFilter
Set the value of referenceId from entity

Specified by:
setReference in interface EntityFilter
Throws:
IllegalArgumentException

hasReference

public boolean hasReference()
Description copied from interface: EntityFilter
Used to check if the filter contains a reference.

Specified by:
hasReference in interface EntityFilter
Returns:
true if the filter contains a reference

getReferenceProperty

public String getReferenceProperty()
Description copied from interface: EntityFilter
Get the value of referenceProperty

Specified by:
getReferenceProperty in interface EntityFilter
Returns:
the value of referenceProperty

setReferenceProperty

public void setReferenceProperty(String referenceProperty)
Description copied from interface: EntityFilter
Set the value of referenceProperty

Specified by:
setReferenceProperty in interface EntityFilter

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: EntityFilter
Add PropertyChangeListener.

Specified by:
addPropertyChangeListener in interface EntityFilter

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: EntityFilter
Remove PropertyChangeListener.

Specified by:
removePropertyChangeListener in interface EntityFilter

isClassReference

public boolean isClassReference(Class<?> entityClass)
Test if the entityClass is corresponding to the current reference in the filter. Will return false if no reference is set in the filter.

Specified by:
isClassReference in interface EntityFilter
Parameters:
entityClass - Class reference to test
Returns:
true if the classReference is corresponding, false otherwise
See Also:
checkReference(Class, boolean)

checkReference

public void checkReference(Class<?> reference,
                           boolean mandatory)
                    throws IllegalArgumentException
Use to check if reference class is supported by the current filter reference. The reference can be not mandatory. Exceptions are thrown if the check failed. If you prefer to have a boolean instead of exceptions, you can use isClassReference(Class).

Specified by:
checkReference in interface EntityFilter
Parameters:
reference - Class reference to check
mandatory - If the existence of the reference is mandatory
Throws:
IllegalArgumentException - for errors on check
See Also:
hasReference(), isClassReference(Class)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2010 CodeLutin. All Rights Reserved.