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 java.lang.Object implements Filter
BaseFilter- Since:
- 1.8.1
- Version:
- $Id: $
- Author:
- brozow
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
m_filterName
protected SQLType<T>
m_sqlType
-
Constructor Summary
Constructors Constructor Description BaseFilter(java.lang.String filterType, SQLType<T> sqlType, java.lang.String fieldName, java.lang.String propertyName)
Constructor for BaseFilter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
bindParam(java.sql.PreparedStatement ps, int parameterIndex)
Binds the parameter values corresponding to the ? tokens in the string returned from getParamSql() to a prepared statement.void
bindValue(java.sql.PreparedStatement ps, int parameterIndex, T value)
bindValuejava.lang.String
formatValue(T value)
formatValueabstract org.hibernate.criterion.Criterion
getCriterion()
getCriterionjava.lang.String
getDescription()
getDescriptionabstract java.lang.String
getParamSql()
getParamSqljava.lang.String
getPropertyName()
getPropertyNameabstract java.lang.String
getSql()
getSqljava.lang.String
getSQLFieldName()
getSQLFieldNameabstract java.lang.String
getTextDescription()
getTextDescriptionjava.lang.String
getValueAsString(T value)
getValueAsStringabstract java.lang.String
getValueString()
getValueStringjava.lang.String
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
-
-
-
-
Constructor Detail
-
BaseFilter
public BaseFilter(java.lang.String filterType, SQLType<T> sqlType, java.lang.String fieldName, java.lang.String propertyName)
Constructor for BaseFilter.
- Type Parameters:
T
- a T object.- Parameters:
filterType
- aString
object.sqlType
- aSQLType
object.fieldName
- aString
object.propertyName
- aString
object.
-
-
Method Detail
-
getSQLFieldName
public java.lang.String getSQLFieldName()
getSQLFieldName
- Returns:
- a
String
object.
-
getPropertyName
public java.lang.String getPropertyName()
getPropertyName
- Returns:
- a
String
object.
-
getDescription
public java.lang.String getDescription()
getDescription
- Specified by:
getDescription
in interfaceFilter
- Returns:
- a
String
object.
-
bindValue
public final void bindValue(java.sql.PreparedStatement ps, int parameterIndex, T value) throws java.sql.SQLException
bindValue
- Parameters:
ps
- aPreparedStatement
object.parameterIndex
- a int.value
- a T object.- Throws:
java.sql.SQLException
- if any.
-
formatValue
public java.lang.String formatValue(T value)
formatValue
- Parameters:
value
- a T object.- Returns:
- a
String
object.
-
getValueAsString
public final java.lang.String getValueAsString(T value)
getValueAsString
- Parameters:
value
- a T object.- Returns:
- a
String
object.
-
getValueString
public abstract java.lang.String getValueString()
getValueString
- 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(java.sql.PreparedStatement ps, int parameterIndex) throws java.sql.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.
-
getParamSql
public abstract java.lang.String getParamSql()
getParamSql
- Specified by:
getParamSql
in interfaceFilter
- Returns:
- a
String
object.
-
getSql
public abstract java.lang.String getSql()
getSql
-
getTextDescription
public abstract java.lang.String getTextDescription()
getTextDescription
- Specified by:
getTextDescription
in interfaceFilter
- Returns:
- a
String
object.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
-