Class ValuePathEvaluator


  • public final class ValuePathEvaluator
    extends Object
    Evaluates a path describing a value to be shown in a trade report.

    For example, if the expression is 'Product.index.name' and the results contain FraTrade instances the following calls will be made for each trade in the results:

    • FraTrade.getProduct() returning a Fra
    • Fra.getIndex() returning an IborIndex
    • IborIndex.getName() returning the index name
    The result of evaluating the expression is the index name.
    • Method Detail

      • measure

        public static Optional<Measure> measure​(String valuePath)
        Gets the measure encoded in a value path, if present.
        Parameters:
        valuePath - the value path
        Returns:
        the measure, if present
      • evaluate

        public static List<Result<?>> evaluate​(String valuePath,
                                               ReportCalculationResults results)
        Evaluates a value path against a set of results, returning the resolved result for each trade.
        Parameters:
        valuePath - the value path
        results - the calculation results
        Returns:
        the list of resolved results for each trade
      • tokens

        public static Set<String> tokens​(Object object)
        Gets the supported tokens on the given object.
        Parameters:
        object - the object for which to return the valid tokens
        Returns:
        the tokens