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

java.lang.Object
  extended by org.opennms.web.filter.BaseFilter<T>
      extended by org.opennms.web.filter.OneArgFilter<T>
All Implemented Interfaces:
Filter
Direct Known Subclasses:
EqualsFilter, GreaterThanFilter, IPLikeFilter, LessThanFilter, LikeFilter, NoSubstringFilter, NotEqualOrNullFilter, NotEqualsFilter, RecentOutagesFilter, SubstringFilter, UserFilter

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

OneArgFilter

Since:
1.8.1
Version:
$Id: $
Author:
brozow

Field Summary
 
Fields inherited from class org.opennms.web.filter.BaseFilter
m_filterName, m_sqlType
 
Constructor Summary
OneArgFilter(String filterType, SQLType<T> sqlType, String fieldName, String propertyName, T value)
          Constructor for OneArgFilter.
 
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.
 T getBoundValue(T value)
          getBoundValue
 String getParamSql()
          getParamSql
 String getSql()
          getSql
abstract  String getSQLTemplate()
          getSQLTemplate
 T getValue()
          getValue
 String getValueString()
          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

OneArgFilter

public OneArgFilter(String filterType,
                    SQLType<T> sqlType,
                    String fieldName,
                    String propertyName,
                    T value)

Constructor for OneArgFilter.

Type Parameters:
T - a T object.
Parameters:
filterType - a String object.
sqlType - a SQLType object.
fieldName - a String object.
propertyName - a String object.
value - a T object.
Method Detail

getValue

public final T getValue()

getValue

Returns:
a T object.

getSQLTemplate

public abstract String getSQLTemplate()

getSQLTemplate

Returns:
a String object.

getBoundValue

public T getBoundValue(T value)

getBoundValue

Parameters:
value - a T object.
Returns:
a T object.

bindParam

public final int bindParam(PreparedStatement ps,
                           int parameterIndex)
                    throws SQLException
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>
Parameters:
ps - a PreparedStatement object.
parameterIndex - a int.
Returns:
a int.
Throws:
SQLException - if any.

getValueString

public final String getValueString()

getValueString

Specified by:
getValueString in class BaseFilter<T>
Returns:
a String object.

getParamSql

public final String getParamSql()

getParamSql

Specified by:
getParamSql in interface Filter
Specified by:
getParamSql in class BaseFilter<T>
Returns:
a String object.

getSql

public final String getSql()

getSql

Specified by:
getSql in interface Filter
Specified by:
getSql in class BaseFilter<T>
Returns:
a String object.


Copyright © 2011. All Rights Reserved.