Package scriptella.text
Class PropertyFormatter
java.lang.Object
scriptella.text.PropertyFormatter
Provides formatting and parsing methods using a
PropertyFormatInfo metadata.- Version:
- 1.1
- Author:
- Fyodor Kupolov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFormats given object to string.format(ParametersCallback parameters) Creates aParametersCallbackwhich formats parameters returned by the original callback.Parses a string value to an object (if mapping is defined inPropertyFormatInfo).
-
Constructor Details
-
PropertyFormatter
-
-
Method Details
-
parse
Parses a string value to an object (if mapping is defined inPropertyFormatInfo).- Parameters:
propertyName- name of the propertyvalue- value to parse.- Returns:
- parsed value (if mapping is defined in
PropertyFormatInfo), otherwise the unmodified value.
-
format
Formats given object to string.- Parameters:
propertyName- name of the property. (Case-sensitive)value- value to format.- Returns:
- string representation of the value.
-
getFormatInfo
-
format
Creates aParametersCallbackwhich formats parameters returned by the original callback.- Parameters:
parameters- parameters callback to use as a source- Returns:
- a
ParametersCallbackwhich formats parameters returned by the original callback.
-