Class SSSOMTFormatFunction

  • All Implemented Interfaces:
    IFormatModifierFunction

    public class SSSOMTFormatFunction
    extends BaseStringModifierFunction
    Represents the SSSOM/T modifier function "format".

    Use this function to apply an arbitrary formatting to a substituted value. The function accepts a single parameter which should be a string containing a single placeholder specification as accepted by Java’s String.format(String, Object...) method. That placeholder will be replaced by the substituted value.

    For example, to format the value of the confidence slot (which is of type Double):

     "Confidence: %{confidence|format('%.03f')}"
     

    If called on a list-typed value, the formatting will be applied to all elements of the list.

    • Constructor Detail

      • SSSOMTFormatFunction

        public SSSOMTFormatFunction()
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: IFormatModifierFunction
        Gets the name by which the function should be called in a placeholder.
        Returns:
        The function name.
      • getSignature

        public String getSignature()
        Description copied from interface: IFormatModifierFunction
        Gets the expected signature of the function. This works similarly to ISSSOMTFunction.getSignature(), but it only concerns the additional arguments beyond the value of the substituted placeholder to modify (e.g. extra_arg1 in the example above).
        Returns:
        The function signature.