com.codemesh.terp.api
Class Selector.AbstractSelector<T>
java.lang.Object
com.codemesh.terp.api.Selector.AbstractSelector<T>
- All Implemented Interfaces:
- Selector<T>
- Enclosing interface:
- Selector<T>
public abstract static class Selector.AbstractSelector<T>
- extends java.lang.Object
- implements Selector<T>
A baseclass for concrete selectors.
Only the parametrized version of the selects() method needs to be
implemented. The unparamterized version is implemented in terms of
the paramtetrized version ans passes an empty list as arguments.
|
Method Summary |
java.lang.String |
getItemName()
Returns the name used for the item that is being tested. |
java.lang.String[] |
getParamNames()
Returns the parameter names. |
boolean |
selects(T item,
java.lang.Object owner)
Returns true if the given item satisfies the selector's criteria. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Selector.AbstractSelector
public Selector.AbstractSelector()
Selector.AbstractSelector
public Selector.AbstractSelector(java.lang.String itemName)
Selector.AbstractSelector
public Selector.AbstractSelector(java.lang.String itemName,
java.lang.String[] paramNames)
getItemName
public java.lang.String getItemName()
- Description copied from interface:
Selector
- Returns the name used for the item that is being tested.
- Specified by:
getItemName in interface Selector<T>
- Returns:
- a name.
getParamNames
public java.lang.String[] getParamNames()
- Description copied from interface:
Selector
- Returns the parameter names.
- Specified by:
getParamNames in interface Selector<T>
- Returns:
- an array of names.
selects
public boolean selects(T item,
java.lang.Object owner)
- Description copied from interface:
Selector
- Returns true if the given item satisfies the selector's criteria.
- Specified by:
selects in interface Selector<T>
- Parameters:
item - the item to test.owner - the item's owner, i.e. the object from which items are being selected.
- Returns:
- true if selection criteria are met.
Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.