Class BaseStringModifierFunction
- java.lang.Object
-
- org.incenp.obofoundry.sssom.transform.BaseStringModifierFunction
-
- All Implemented Interfaces:
IFormatModifierFunction
- Direct Known Subclasses:
SimpleStringModifierFunction,SSSOMTFormatFunction,SSSOMTPrefixFunction,SSSOMTReplaceModifierFunction,SSSOMTShortFunction,SSSOMTSuffixFunction
public abstract class BaseStringModifierFunction extends Object implements IFormatModifierFunction
Base class for format modifier functions that can act both on a single value and on a list of values, where all values in the list are to be processed in the same way as single values.
-
-
Constructor Summary
Constructors Constructor Description BaseStringModifierFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Stringapply(Object value, List<String> extra)Applies the function to a single value.Objectcall(Object value, List<String> extra)Executes the function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.incenp.obofoundry.sssom.transform.IFormatModifierFunction
getName, getSignature
-
-
-
-
Method Detail
-
call
public Object call(Object value, List<String> extra)
Description copied from interface:IFormatModifierFunctionExecutes the function.- Specified by:
callin interfaceIFormatModifierFunction- Parameters:
value- The original value this function is supposed to modify. It is guaranteed never to benull, but the exact type will depend on what the substituted placeholder was, and also on what any previous modifier function may have done with it.extra- Additional arguments to the function, if any. If the function declared that it expects some mandatory arguments (through theIFormatModifierFunction.getSignature()method), it is guaranteed the list will contains as many arguments as expected.- Returns:
- The modified value. It may not need be of the same type as the original value (e.g., a function could transform a list value into a string value).
-
-