Package org.opennms.web.filter
Class BaseFilter<T>
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected String
m_filterName
protected SQLType<T>
m_sqlType
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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)
bindValueString
formatValue(T value)
formatValueabstract org.hibernate.criterion.Criterion
getCriterion()
getCriterionString
getDescription()
getDescriptionabstract String
getParamSql()
getParamSqlString
getPropertyName()
getPropertyNameabstract String
getSql()
getSqlString
getSQLFieldName()
getSQLFieldNameabstract String
getTextDescription()
getTextDescriptionString
getValueAsString(T value)
getValueAsStringabstract String
getValueString()
getValueStringString
toString()
toString-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opennms.web.filter.Filter
getTextDescriptionAsSanitizedHtml
-
-
-
-
Method Detail
-
getDescription
public String getDescription()
getDescription
- Specified by:
getDescription
in interfaceFilter
- Returns:
- a
String
object.
-
bindValue
public final void bindValue(PreparedStatement ps, int parameterIndex, T value) throws SQLException
bindValue
- Parameters:
ps
- aPreparedStatement
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.
-
getCriterion
public abstract org.hibernate.criterion.Criterion getCriterion()
getCriterion
- Specified by:
getCriterion
in interfaceFilter
- 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 interfaceFilter
- Parameters:
ps
- aPreparedStatement
object.parameterIndex
- a int.- Returns:
- a int.
- Throws:
SQLException
- if any.
-
getParamSql
public abstract String getParamSql()
getParamSql
- Specified by:
getParamSql
in interfaceFilter
- Returns:
- a
String
object.
-
getSql
public abstract String getSql()
getSql
-
getTextDescription
public abstract String getTextDescription()
getTextDescription
- Specified by:
getTextDescription
in interfaceFilter
- Returns:
- a
String
object.
-
-