Package org.opennms.web.filter
Class MultiArgFilter<T>
- java.lang.Object
-
- org.opennms.web.filter.BaseFilter<T>
-
- org.opennms.web.filter.MultiArgFilter<T>
-
- All Implemented Interfaces:
Filter
- Direct Known Subclasses:
BetweenFilter
,InFilter
public abstract class MultiArgFilter<T> extends BaseFilter<T>
TwoArgFilter- 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
Constructors Constructor Description MultiArgFilter(java.lang.String filterType, SQLType<T> sqlType, java.lang.String fieldName, java.lang.String propertyName, T[] values)
Constructor for MultiArgFilter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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.java.lang.String
getParamSql()
getParamSqljava.lang.String
getSql()
getSqlabstract java.lang.String
getSQLTemplate()
getSQLTemplateT[]
getValues()
getValuesjava.util.List<T>
getValuesAsList()
getValuesAsListjava.lang.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
-
Methods inherited from interface org.opennms.web.filter.Filter
getTextDescriptionAsSanitizedHtml
-
-
-
-
Constructor Detail
-
MultiArgFilter
public MultiArgFilter(java.lang.String filterType, SQLType<T> sqlType, java.lang.String fieldName, java.lang.String propertyName, T[] values)
Constructor for MultiArgFilter.
- Type Parameters:
T
- a T object.- Parameters:
filterType
- aString
object.sqlType
- aSQLType
object.fieldName
- aString
object.propertyName
- aString
object.values
- an array of T objects.
-
-
Method Detail
-
getValues
public T[] getValues()
getValues
- Returns:
- an array of T objects.
-
getValuesAsList
public java.util.List<T> getValuesAsList()
getValuesAsList
- Returns:
- a
List
object.
-
getSQLTemplate
public abstract java.lang.String getSQLTemplate()
getSQLTemplate
- Returns:
- a
String
object.
-
bindParam
public final 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.- Specified by:
bindParam
in interfaceFilter
- Specified by:
bindParam
in classBaseFilter<T>
- Parameters:
ps
- aPreparedStatement
object.parameterIndex
- a int.- Returns:
- a int.
- Throws:
java.sql.SQLException
- if any.
-
getValueString
public final java.lang.String getValueString()
getValueString
- Specified by:
getValueString
in classBaseFilter<T>
- Returns:
- a
String
object.
-
getParamSql
public final java.lang.String getParamSql()
getParamSql
- Specified by:
getParamSql
in interfaceFilter
- Specified by:
getParamSql
in classBaseFilter<T>
- Returns:
- a
String
object.
-
getSql
public final java.lang.String getSql()
getSql
- Specified by:
getSql
in interfaceFilter
- Specified by:
getSql
in classBaseFilter<T>
- Returns:
- a
String
object.
-
-