com.taco.text
Class PatternToStringConverter

java.lang.Object
  extended by com.taco.text.AbstractObjectToStringConverter
      extended by 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.


Field Summary
static PatternToStringConverter instance
          The singleton instance of this class.
 
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 com.taco.text.AbstractObjectToStringConverter
map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static final PatternToStringConverter instance
The singleton instance of this class.

Constructor Detail

PatternToStringConverter

protected PatternToStringConverter()
Since this class is implemented as a singleton, the sole constructor is protected.

Method Detail

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)