com.vaadin.data.util.sqlcontainer.query.generator.filter
Class StringDecorator

java.lang.Object
  extended by com.vaadin.data.util.sqlcontainer.query.generator.filter.StringDecorator
All Implemented Interfaces:
java.io.Serializable

public class StringDecorator
extends java.lang.Object
implements java.io.Serializable

The StringDecorator knows how to produce a quoted string using the specified quote start and quote end characters. It also handles grouping of a string (surrounding it in parenthesis). Extend this class if you need to support special characters for grouping (parenthesis).

Author:
Vaadin Ltd
See Also:
Serialized Form

Constructor Summary
StringDecorator(java.lang.String quoteStart, java.lang.String quoteEnd)
          Constructs a StringDecorator that uses the quoteStart and quoteEnd characters to create quoted strings.
 
Method Summary
 java.lang.String group(java.lang.String str)
          Groups a string by surrounding it in parenthesis
 java.lang.String quote(java.lang.Object str)
          Surround a string with quote characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDecorator

public StringDecorator(java.lang.String quoteStart,
                       java.lang.String quoteEnd)
Constructs a StringDecorator that uses the quoteStart and quoteEnd characters to create quoted strings.

Parameters:
quoteStart - the character denoting the start of a quote.
quoteEnd - the character denoting the end of a quote.
Method Detail

quote

public java.lang.String quote(java.lang.Object str)
Surround a string with quote characters.

Parameters:
str - the string to quote
Returns:
the quoted string

group

public java.lang.String group(java.lang.String str)
Groups a string by surrounding it in parenthesis

Parameters:
str - the string to group
Returns:
the grouped string


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.