com.taco.text
Class PunctuationStrippingConverter
java.lang.Object
com.taco.text.AbstractInterpolatingStringToObjectConverter
com.taco.text.InterpolatingConverter
com.taco.text.PunctuationStrippingConverter
- All Implemented Interfaces:
- IInterpolatingConverter, IInterpolatingStringToObjectConverter, IStringToObjectConverter, IInterpolatingResourceBundleToObjectConverter, java.lang.Cloneable
public class PunctuationStrippingConverter
- extends InterpolatingConverter
A converter that strips leading and trailing punctuation from a string
before delegating to another converter.
Method Summary |
protected java.lang.Object |
_literalToObject(java.lang.String s,
java.util.ResourceBundle bundle,
INoReturnMap argMap,
java.lang.String globalName)
Given s , which is a string literal, not a reference to
a resource bundle key or a key in the argument map, convert
s to an object. |
java.lang.Object |
toObject(java.util.ResourceBundle bundle,
java.lang.String baseKey,
INoReturnMap argMap,
KeyLookupRecord context)
Simply delegate to the converter specified in the constructor. |
Methods inherited from class com.taco.text.InterpolatingConverter |
_argMapReferenceToObject, _getStandardImports, _getStandardStaticImports, _literalResultToObject, _scriptSnippetToObject, _toObject, _toObjectMapper, clone, name, toObject, toObject |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PunctuationStrippingConverter
public PunctuationStrippingConverter(IInterpolatingConverter converter,
char punctuationChar)
- Create a new instance that strips the argument leading punctuation
character and the corresponding trailing punctuation character from
strings. The strings are then converted by the argument converter.
Resource bundles are converted by the argument converter directly.
toObject
public java.lang.Object toObject(java.util.ResourceBundle bundle,
java.lang.String baseKey,
INoReturnMap argMap,
KeyLookupRecord context)
throws java.text.ParseException,
java.util.MissingResourceException
- Simply delegate to the converter specified in the constructor.
- Specified by:
toObject
in interface IInterpolatingResourceBundleToObjectConverter
- Overrides:
toObject
in class InterpolatingConverter
- Throws:
java.text.ParseException
java.util.MissingResourceException
_literalToObject
protected java.lang.Object _literalToObject(java.lang.String s,
java.util.ResourceBundle bundle,
INoReturnMap argMap,
java.lang.String globalName)
throws java.text.ParseException,
java.util.MissingResourceException
- Description copied from class:
InterpolatingConverter
Given s
, which is a string literal, not a reference to
a resource bundle key or a key in the argument map, convert
s
to an object.
*This implementation simply returns s
unchanged.
- Overrides:
_literalToObject
in class InterpolatingConverter
- Throws:
java.text.ParseException
java.util.MissingResourceException