org.mmbase.bridge.jsp.taglib.typehandler
Class StringHandler

java.lang.Object
  extended by org.mmbase.bridge.jsp.taglib.typehandler.AbstractTypeHandler
      extended by org.mmbase.bridge.jsp.taglib.typehandler.StringHandler
All Implemented Interfaces:
TypeHandler
Direct Known Subclasses:
XmlHandler

public class StringHandler
extends AbstractTypeHandler

A TypeHandler for strings, textareas and text-input. Search values are SQL escaped.

Since:
MMBase-1.6
Version:
$Id: StringHandler.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Gerard van de Looi, Michiel Meeuwissen

Field Summary
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.typehandler.AbstractTypeHandler
eh, gotEnumHandler, tag
 
Constructor Summary
StringHandler(FieldInfoTag tag)
          Constructor for StringHandler.
 
Method Summary
protected  int getCols(Field field)
           
protected  Object getFieldValue(Node node, Field field)
          Returns the field value as specified by the client's post.
protected  int getOperator(Field field)
          The operator to be used by whereHtmlInput(field, query)
protected  Object getValue(Node node, String fieldName)
           
 String htmlInput(Node node, Field field, boolean search)
          Produces an form input field for the given Node, and Field.
protected  boolean interpretEmptyAsNull(Field field)
           
protected  void setValue(Node node, String fieldName, Object value)
           
 boolean useHtmlInput(Node node, Field field)
          returns true if setValue happened.
 String whereHtmlInput(Field field)
           
 Constraint whereHtmlInput(Field field, Query query)
          Adds search constraint to Query object.
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.typehandler.AbstractTypeHandler
addExtraAttributes, cast, checkHtmlInput, convertToValidate, findString, getClasses, getClassName, getEnumHandler, getFieldValue, getOperator, getSearchValue, getSearchValue, htmlInputId, init, paramHtmlInput, prefix, prefixError, prefixID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringHandler

public StringHandler(FieldInfoTag tag)
Constructor for StringHandler.

Method Detail

getCols

protected int getCols(Field field)
Since:
MMBase-1.9.1

htmlInput

public String htmlInput(Node node,
                        Field field,
                        boolean search)
                 throws JspTagException
Description copied from interface: TypeHandler
Produces an form input field for the given Node, and Field.

Specified by:
htmlInput in interface TypeHandler
Overrides:
htmlInput in class AbstractTypeHandler
search - if true, then a search field is produced.
Throws:
JspTagException
See Also:
TypeHandler.htmlInput(Node, Field, boolean)

setValue

protected void setValue(Node node,
                        String fieldName,
                        Object value)
Overrides:
setValue in class AbstractTypeHandler

getValue

protected Object getValue(Node node,
                          String fieldName)
Overrides:
getValue in class AbstractTypeHandler

useHtmlInput

public boolean useHtmlInput(Node node,
                            Field field)
                     throws JspTagException
Description copied from interface: TypeHandler
returns true if setValue happened.

Specified by:
useHtmlInput in interface TypeHandler
Overrides:
useHtmlInput in class AbstractTypeHandler
Throws:
JspTagException
See Also:
TypeHandler.useHtmlInput(Node, Field)

getFieldValue

protected Object getFieldValue(Node node,
                               Field field)
                        throws JspTagException
Description copied from class: AbstractTypeHandler
Returns the field value as specified by the client's post. This is only null if the client didn't post a thing. It can be empty if the client means null (depending on the value of AbstractTypeHandler.interpretEmptyAsNull(org.mmbase.bridge.Field)).

Overrides:
getFieldValue in class AbstractTypeHandler
Parameters:
node - This parameter could be used if the client does not fully specify the field's value (possible e.g. with Date fields). The existing specification could be used then.
Returns:
null if the client did not post, something else if it did. If the client meant to set null, this method should return the empty string.
Throws:
JspTagException

interpretEmptyAsNull

protected boolean interpretEmptyAsNull(Field field)
Overrides:
interpretEmptyAsNull in class AbstractTypeHandler

whereHtmlInput

public String whereHtmlInput(Field field)
                      throws JspTagException
Specified by:
whereHtmlInput in interface TypeHandler
Overrides:
whereHtmlInput in class AbstractTypeHandler
Returns:
Piece of SQL. null if no constraint.
Throws:
JspTagException
See Also:
TypeHandler.whereHtmlInput(Field)

getOperator

protected int getOperator(Field field)
Description copied from class: AbstractTypeHandler
The operator to be used by whereHtmlInput(field, query)

Overrides:
getOperator in class AbstractTypeHandler

whereHtmlInput

public Constraint whereHtmlInput(Field field,
                                 Query query)
                          throws JspTagException
Description copied from class: AbstractTypeHandler
Adds search constraint to Query object.

Specified by:
whereHtmlInput in interface TypeHandler
Overrides:
whereHtmlInput in class AbstractTypeHandler
Returns:
null if nothing to be searched, the constraint if constraint added
Throws:
JspTagException


MMBase 2.0-SNAPSHOT - null