Class Features

java.lang.Object
net.pincette.mongo.Features

public class Features extends Object
Extra features for the query and aggregation expression language.
Since:
1.5
Author:
Werner Donné
  • Field Details

    • customJsltFunctions

      public final Collection<com.schibsted.spt.data.jslt.Function> customJsltFunctions
    • expressionExtensions

      public final Map<String,Operator> expressionExtensions
    • expressionResolver

      public final BiFunction<JsonObject,String,JsonObject> expressionResolver
    • jsltResolver

      public final com.schibsted.spt.data.jslt.ResourceResolver jsltResolver
    • matchExtensions

      public final Map<String,QueryOperator> matchExtensions
  • Constructor Details

    • Features

      public Features()
  • Method Details

    • withCustomJsltFunctions

      public Features withCustomJsltFunctions(Collection<com.schibsted.spt.data.jslt.Function> customJsltFunctions)
      Custom functions for JSLT transformations.
      Parameters:
      customJsltFunctions - the collection of JSLT functions.
      Returns:
      A new features object.
    • withExpressionExtensions

      public Features withExpressionExtensions(Map<String,Operator> expressionExtensions)
      Additional MongoDB Operators.
      Parameters:
      expressionExtensions - the mapping between operator names and their implementation.
      Returns:
      A new features object.
    • withExpressionResolver

      public Features withExpressionResolver(BiFunction<JsonObject,String,JsonObject> expressionResolver)
      A function to resolve certain fields of MongoDB operators or query expressions. The first parameter is the expression and the second a context resource in which the expression is used. This could be a base directory a JAR resource or anything else. The function should return the modified expression.
      Parameters:
      expressionResolver - the first parameter is the expression and the second a context resource in which the expression is used. This could be a base directory a JAR resource or anything else. The function should return the modified expression.
      Returns:
      A new features object.
      Since:
      2.2
    • withJsltResolver

      public Features withJsltResolver(com.schibsted.spt.data.jslt.ResourceResolver jsltResolver)
      The import resolver for the JSLT compiler.
      Parameters:
      jsltResolver - an implementation that resolves imported JSLT scripts.
      Returns:
      A new features object.
    • withMatchExtensions

      public Features withMatchExtensions(Map<String,QueryOperator> matchExtensions)
      Additional MongoDB query operators.
      Parameters:
      matchExtensions - the mapping between query operator names and their implementation.
      Returns:
      A new features object.