Class PropertyFormatter

java.lang.Object
scriptella.text.PropertyFormatter

public class PropertyFormatter extends Object
Provides formatting and parsing methods using a PropertyFormatInfo metadata.
Version:
1.1
Author:
Fyodor Kupolov
  • Constructor Details

  • Method Details

    • parse

      public Object parse(String propertyName, String value)
      Parses a string value to an object (if mapping is defined in PropertyFormatInfo).
      Parameters:
      propertyName - name of the property
      value - value to parse.
      Returns:
      parsed value (if mapping is defined in PropertyFormatInfo), otherwise the unmodified value.
    • format

      public String format(String propertyName, Object value)
      Formats given object to string.
      Parameters:
      propertyName - name of the property. (Case-sensitive)
      value - value to format.
      Returns:
      string representation of the value.
    • getFormatInfo

      public PropertyFormatInfo getFormatInfo()
    • format

      public ParametersCallback format(ParametersCallback parameters)
      Creates a ParametersCallback which formats parameters returned by the original callback.
      Parameters:
      parameters - parameters callback to use as a source
      Returns:
      a ParametersCallback which formats parameters returned by the original callback.