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

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

public abstract class BaseFilter<T>
extends Object
implements Filter

BaseFilter

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

Field Summary
protected  String m_filterName
           
protected  SQLType<T> m_sqlType
           
 
Constructor Summary
BaseFilter(String filterType, SQLType<T> sqlType, String fieldName, String propertyName)
          Constructor for BaseFilter.
 
Method Summary
abstract  int bindParam(PreparedStatement ps, int parameterIndex)
          Binds the parameter values corresponding to the ? tokens in the string returned from getParamSql() to a prepared statement.
 void bindValue(PreparedStatement ps, int parameterIndex, T value)
          bindValue
 String formatValue(T value)
          formatValue
abstract  org.hibernate.criterion.Criterion getCriterion()
          getCriterion
 String getDescription()
          getDescription
abstract  String getParamSql()
          getParamSql
 String getPropertyName()
          getPropertyName
abstract  String getSql()
          getSql
 String getSQLFieldName()
          getSQLFieldName
abstract  String getTextDescription()
          getTextDescription
 String getValueAsString(T value)
          getValueAsString
abstract  String getValueString()
          getValueString
 String toString()
          toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_filterName

protected String m_filterName

m_sqlType

protected SQLType<T> m_sqlType
Constructor Detail

BaseFilter

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

Constructor for BaseFilter.

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

getSQLFieldName

public String getSQLFieldName()

getSQLFieldName

Returns:
a String object.

getPropertyName

public String getPropertyName()

getPropertyName

Returns:
a String object.

getDescription

public final String getDescription()

getDescription

Specified by:
getDescription in interface Filter
Returns:
a String object.

bindValue

public final void bindValue(PreparedStatement ps,
                            int parameterIndex,
                            T value)
                     throws SQLException

bindValue

Parameters:
ps - a PreparedStatement object.
parameterIndex - a int.
value - a T object.
Throws:
SQLException - if any.

formatValue

public String formatValue(T value)

formatValue

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

getValueAsString

public final String getValueAsString(T value)

getValueAsString

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

getValueString

public abstract String getValueString()

getValueString

Returns:
a String object.

getCriterion

public abstract org.hibernate.criterion.Criterion getCriterion()

getCriterion

Specified by:
getCriterion in interface Filter
Returns:
a Criterion object.

bindParam

public abstract 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
Parameters:
ps - a PreparedStatement object.
parameterIndex - a int.
Returns:
a int.
Throws:
SQLException - if any.

getParamSql

public abstract String getParamSql()

getParamSql

Specified by:
getParamSql in interface Filter
Returns:
a String object.

getSql

public abstract String getSql()

getSql

Specified by:
getSql in interface Filter
Returns:
a String object.

getTextDescription

public abstract String getTextDescription()

getTextDescription

Specified by:
getTextDescription in interface Filter
Returns:
a String object.

toString

public String toString()

toString

Overrides:
toString in class Object
Returns:
a String object.


Copyright © 2011. All Rights Reserved.