com.taco.text
Class PatternToStringConverter
java.lang.Object
com.taco.text.AbstractObjectToStringConverter
com.taco.text.PatternToStringConverter
- All Implemented Interfaces:
- IObjectToStringConverter, IObjectMapper
public final class PatternToStringConverter
- extends AbstractObjectToStringConverter
An implemenation of IObjectToStringConverter
the converts a
Pattern
into a string which is the double quote-escaped
version of its regex string. This class is useful for converting a pattern
list into a string, where each pattern's string representation is
surrounded by double quotes.
Constructor Summary |
protected |
PatternToStringConverter()
Since this class is implemented as a singleton, the sole constructor
is protected. |
Method Summary |
static java.lang.String |
escapeQuotes(java.lang.String s)
Escape all unescaped quotes that appear in the argument string. |
static void |
main(java.lang.String[] args)
|
java.lang.String |
toString(java.lang.Object obj)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
instance
public static final PatternToStringConverter instance
- The singleton instance of this class.
PatternToStringConverter
protected PatternToStringConverter()
- Since this class is implemented as a singleton, the sole constructor
is protected.
toString
public java.lang.String toString(java.lang.Object obj)
- Specified by:
toString
in interface IObjectToStringConverter
- Specified by:
toString
in class AbstractObjectToStringConverter
escapeQuotes
public static final java.lang.String escapeQuotes(java.lang.String s)
- Escape all unescaped quotes that appear in the argument string.
main
public static void main(java.lang.String[] args)