Interface TuriClass

All Superinterfaces:
ServiceLoaded

public interface TuriClass extends ServiceLoaded
Classes implementing this interface and "providing" these classes from the module can implement methods for Java classes. When there is a method call on a value, which is not LngObject, the run-time checks if there is any class implementing this interface registered for the given class (as returned by the method forClass().

If there is then getMethod(Object, String) will be invoked on that object to get a callable. To create such a callable see the implementation TuriString that implements methods callable on normal strings.

  • Method Details

    • getInstances

      static List<TuriClass> getInstances()
      Retrieves a list of instances of classes that implement the TuriClass interface. These instances are loaded using the service loader mechanism. If no instances are found through the primary approach, a fallback mechanism attempts to load the classes using the META-INF/services resources.
      Returns:
      a list of instances of classes implementing the TuriClass interface
    • forClass

      Class<?> forClass()
      Returns:
      the class on which works
    • getMethod

      LngCallable getMethod(Object target, String identifier) throws ExecutionException
      Throws:
      ExecutionException