terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.api
Class Selector.AbstractSelector<T>

java.lang.Object
  extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.codemesh.terp.api.Selector
Selector.AbstractSelector<T>
 
Field Summary
 
Fields inherited from interface com.codemesh.terp.api.Selector
NO_ARGS, NO_PARAM_NAMES
 
Constructor Summary
Selector.AbstractSelector()
           
Selector.AbstractSelector(java.lang.String itemName)
           
Selector.AbstractSelector(java.lang.String itemName, java.lang.String[] paramNames)
           
 
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
 
Methods inherited from interface com.codemesh.terp.api.Selector
selects
 

Constructor Detail

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)
Method Detail

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.

terp - the Codemesh Modular
Template Interpreter v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.