org.keycloak.scripting

## Class InvocableScriptAdapter

- java.lang.Object
- - org.keycloak.scripting.InvocableScriptAdapter

- All Implemented Interfaces:
    Invocable

      public class InvocableScriptAdapter
      extends Object
      implements Invocable

  Wraps a `ScriptModel` and makes it `Invocable`.
  Author:
    Thomas Darimont

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvocableScriptAdapter(ScriptModel scriptModel, ScriptEngine scriptEngine)` Creates a new `InvocableScriptAdapter` instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `getInterface(Class<T> clazz)`
    `<T> T` | `getInterface(Object thiz, Class<T> clazz)`
    `Object` | `invokeFunction(String name, Object... args)`
    `Object` | `invokeMethod(Object thiz, String name, Object... args)`
    `boolean` | `isDefined(String name)` Returns true if the `ScriptEngine` has a definition with the given `name`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InvocableScriptAdapter

          public InvocableScriptAdapter(ScriptModel scriptModel,
                                        ScriptEngine scriptEngine)

      Creates a new `InvocableScriptAdapter` instance.
      Parameters:
        `scriptModel` - must not be null
        `scriptEngine` - must not be null

  - ### Method Detail

    - #### invokeMethod

          public Object invokeMethod(Object thiz,
                                     String name,
                                     Object... args)
                              throws ScriptExecutionException

      Specified by:
        `invokeMethod` in interface `Invocable`
      Throws:
        `ScriptExecutionException`

    - #### invokeFunction

          public Object invokeFunction(String name,
                                       Object... args)
                                throws ScriptExecutionException

      Specified by:
        `invokeFunction` in interface `Invocable`
      Throws:
        `ScriptExecutionException`

    - #### getInterface

          public <T> T getInterface(Class<T> clazz)

      Specified by:
        `getInterface` in interface `Invocable`

    - #### getInterface

          public <T> T getInterface(Object thiz,
                                    Class<T> clazz)

      Specified by:
        `getInterface` in interface `Invocable`

    - #### isDefined

          public boolean isDefined(String name)

      Returns true if the `ScriptEngine` has a definition with the given `name`.
      Parameters:
        `name` -
      Returns:

Copyright © 2021 JBoss by Red Hat. All rights reserved.