Class FunctionAdapter

java.lang.Object
org.aksw.jenax.arq.functionbinder.FunctionAdapter
All Implemented Interfaces:
org.apache.jena.sparql.function.Function

public class FunctionAdapter extends Object implements org.apache.jena.sparql.function.Function
Jena function implementation that delegates to a backing Java method. Instances of this class are usually generated using the FunctionGenerator.wrap(Method). Use the FunctionBinder for creating function bindings and registration of them with Jena.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.aksw.commons.util.convert.ConverterRegistry
     
    protected Object
     
    protected int
     
    protected Method
     
    protected Param[]
     
    protected Function<Object,org.apache.jena.sparql.expr.NodeValue>
     
    protected org.apache.jena.datatypes.TypeMapper
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FunctionAdapter(Method method, Object invocationTarget, Function<Object,org.apache.jena.sparql.expr.NodeValue> returnValueConverter, Param[] params, org.apache.jena.datatypes.TypeMapper typeMapper, org.aksw.commons.util.convert.ConverterRegistry converterRegistry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    build(String uri, org.apache.jena.sparql.expr.ExprList args, org.apache.jena.sparql.util.Context context)
     
    buildJavaArgs(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.expr.ExprList args, org.apache.jena.sparql.function.FunctionEnv env)
    Given a list of argument expressions and a binding, derive the list of corresponding Java objects to be used as the actual function arguments.
    org.apache.jena.sparql.expr.NodeValue
    exec(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.expr.ExprList args, String uri, org.apache.jena.sparql.function.FunctionEnv env)
     
     
     
    org.apache.jena.sparql.expr.NodeValue
    Invoke the wrapped method with prior built java arguments and return the result as a NodeValue.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • invocationTarget

      protected Object invocationTarget
    • method

      protected Method method
    • returnValueConverter

      protected Function<Object,org.apache.jena.sparql.expr.NodeValue> returnValueConverter
    • converterRegistry

      protected org.aksw.commons.util.convert.ConverterRegistry converterRegistry
    • typeMapper

      protected org.apache.jena.datatypes.TypeMapper typeMapper
    • params

      protected Param[] params
    • mandatoryArgsCount

      protected int mandatoryArgsCount
  • Constructor Details

    • FunctionAdapter

      public FunctionAdapter(Method method, Object invocationTarget, Function<Object,org.apache.jena.sparql.expr.NodeValue> returnValueConverter, Param[] params, org.apache.jena.datatypes.TypeMapper typeMapper, org.aksw.commons.util.convert.ConverterRegistry converterRegistry)
  • Method Details

    • build

      public void build(String uri, org.apache.jena.sparql.expr.ExprList args, org.apache.jena.sparql.util.Context context)
      Specified by:
      build in interface org.apache.jena.sparql.function.Function
    • exec

      public org.apache.jena.sparql.expr.NodeValue exec(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.expr.ExprList args, String uri, org.apache.jena.sparql.function.FunctionEnv env)
      Specified by:
      exec in interface org.apache.jena.sparql.function.Function
    • invokeWithJavaArgs

      public org.apache.jena.sparql.expr.NodeValue invokeWithJavaArgs(Object[] javaArgs)
      Invoke the wrapped method with prior built java arguments and return the result as a NodeValue.
    • buildJavaArgs

      public Object[] buildJavaArgs(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.expr.ExprList args, org.apache.jena.sparql.function.FunctionEnv env)
      Given a list of argument expressions and a binding, derive the list of corresponding Java objects to be used as the actual function arguments.
    • getInvocationTarget

      public Object getInvocationTarget()
    • getMethod

      public Method getMethod()