Class FunctionBinder

java.lang.Object
org.aksw.jenax.arq.functionbinder.FunctionBinder

public class FunctionBinder extends Object
Convenience class to create Jena bindings for Java functions and to register them at Jena's default FunctionRegistry.
Author:
raven
  • Field Details

    • functionRegistrySupplier

      protected Supplier<org.apache.jena.sparql.function.FunctionRegistry> functionRegistrySupplier
    • functionGenerator

      protected FunctionGenerator functionGenerator
  • Constructor Details

    • FunctionBinder

      public FunctionBinder()
    • FunctionBinder

      public FunctionBinder(Supplier<org.apache.jena.sparql.function.FunctionRegistry> functionRegistrySupplier)
    • FunctionBinder

      public FunctionBinder(FunctionGenerator functionGenerator)
    • FunctionBinder

      public FunctionBinder(FunctionGenerator functionGenerator, Supplier<org.apache.jena.sparql.function.FunctionRegistry> functionRegistrySupplier)
  • Method Details

    • getFunctionGenerator

      public FunctionGenerator getFunctionGenerator()
    • register

      public void register(String uri, Method method)
    • register

      public void register(String uri, Method method, Object invocationTarget)
    • register

      public void register(Method method)
    • register

      public void register(Method method, Object invocationTarget)
    • registerAll

      public void registerAll(Class<?> clz)
    • registerAll

      public void registerAll(Class<?> clz, Object invocationTarget)
    • register

      public void register(boolean lazy, String functionIri, Method method)
      Convenience method to register a function at Jena's default registry
    • register

      public void register(boolean lazy, List<String> functionIris, Method method, Object invocationTarget)
      Register a method with multiple aliases
    • register

      public void register(boolean lazy, String functionIri, Method method, Object invocationTarget)
    • register

      public void register(boolean lazy, Method method)
    • register

      public void register(boolean lazy, Method method, Object invocationTarget)
      Convenience method to register a function at Jena's default registry
    • register

      public void register(String iri, Class<?> clazz, String methodName, Class<?>... paramTypes)
      Convenience method that hides checked exceptions from Class.getMethod
    • registerAll

      public void registerAll(boolean lazy, Class<?> clz)
      Register all static methods with @Iri annotations
    • registerAll

      public void registerAll(boolean lazy, Class<?> clz, Object invocationTarget)
      Register all methods of the class with the given invocationTarget. If the invocation target is null then all static methods will be registered. Otherwise, if the invocation target is non-null then all non-static methods will be registered.
      Parameters:
      clz -
      invocationTarget -
    • factory

      public org.apache.jena.sparql.function.FunctionFactory factory(boolean lazy, Method method)
    • factory

      public org.apache.jena.sparql.function.FunctionFactory factory(boolean lazy, Method method, Object invocationTarget)
    • getFunction

      public static org.apache.jena.sparql.function.Function getFunction(Method method)
      Lookup a function for a given method in the default registry. Uses getFunction(FunctionRegistry, Method).
    • getFunction

      public static org.apache.jena.sparql.function.Function getFunction(org.apache.jena.sparql.function.FunctionRegistry registry, Method method)
      Read a (static) method's @Iri annotation and use it to lookup a function in the given registry At present there is no direct mapping of methods to FuncionFactories (without having to read the @Iri annotation)