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:
Serializable

public class StringDecorator
extends Object
implements 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(String quoteStart, String quoteEnd)
          Constructs a StringDecorator that uses the quoteStart and quoteEnd characters to create quoted strings.
 
Method Summary
 String group(String str)
          Groups a string by surrounding it in parenthesis
 String quote(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(String quoteStart,
                       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 String quote(Object str)
Surround a string with quote characters.

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

group

public String group(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.