org.opennms.web.filter
Class MultiArgFilter<T>

java.lang.Object
  extended by org.opennms.web.filter.BaseFilter<T>
      extended by org.opennms.web.filter.MultiArgFilter<T>
All Implemented Interfaces:
Filter
Direct Known Subclasses:
BetweenFilter, InFilter

public abstract class MultiArgFilter<T>
extends BaseFilter<T>

TwoArgFilter

Author:
brozow

Field Summary
 
Fields inherited from class org.opennms.web.filter.BaseFilter
m_filterName, m_sqlType
 
Constructor Summary
MultiArgFilter(String filterType, SQLType<T> sqlType, String fieldName, String propertyName, T[] values)
           
 
Method Summary
 int bindParam(PreparedStatement ps, int parameterIndex)
          Binds the parameter values corresponding to the ? tokens in the string returned from getParamSql() to a prepared statement.
 String getParamSql()
          Returns a parameterized SQL where clause.
 String getSql()
          Returns an expression for a SQL where clause.
abstract  String getSQLTemplate()
           
 T[] getValues()
           
 List<T> getValuesAsList()
           
 String getValueString()
           
 
Methods inherited from class org.opennms.web.filter.BaseFilter
bindValue, formatValue, getCriterion, getDescription, getPropertyName, getSQLFieldName, getTextDescription, getValueAsString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiArgFilter

public MultiArgFilter(String filterType,
                      SQLType<T> sqlType,
                      String fieldName,
                      String propertyName,
                      T[] values)
Method Detail

getValues

public T[] getValues()

getValuesAsList

public List<T> getValuesAsList()

getSQLTemplate

public abstract String getSQLTemplate()

bindParam

public final int bindParam(PreparedStatement ps,
                           int parameterIndex)
                    throws SQLException
Description copied from interface: Filter
Binds the parameter values corresponding to the ? tokens in the string returned from getParamSql() to a prepared statement. Returns the number of parameters that were bound.

Specified by:
bindParam in interface Filter
Specified by:
bindParam in class BaseFilter<T>
Throws:
SQLException

getValueString

public final String getValueString()
Specified by:
getValueString in class BaseFilter<T>

getParamSql

public final String getParamSql()
Description copied from interface: Filter
Returns a parameterized SQL where clause. Remember to include a trailing space, but no leading AND or OR.

Specified by:
getParamSql in interface Filter
Specified by:
getParamSql in class BaseFilter<T>

getSql

public final String getSql()
Description copied from interface: Filter
Returns an expression for a SQL where clause. Remember to include a trailing space, but no leading AND or OR.

Specified by:
getSql in interface Filter
Specified by:
getSql in class BaseFilter<T>


Copyright © 2009. All Rights Reserved.