Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
javax.script

Interface Invocable


  • public interface Invocable
    The optional interface implemented by ScriptEngines whose methods allow the invocation of procedures in scripts that have previously been executed.
    Since:
    1.6
    • Method Detail

      • invokeMethod

        Object invokeMethod(Object thiz,
                          String name,
                          Object... args)
                            throws ScriptException,
                                   NoSuchMethodException
        Calls a method on a script object compiled during a previous script execution, which is retained in the state of the ScriptEngine.
        Parameters:
        name - The name of the procedure to be called.
        thiz - If the procedure is a member of a class defined in the script and thiz is an instance of that class returned by a previous execution or invocation, the named method is called through that instance.
        args - Arguments to pass to the procedure. The rules for converting the arguments to scripting variables are implementation-specific.
        Returns:
        The value returned by the procedure. The rules for converting the scripting variable returned by the script method to a Java Object are implementation-specific.
        Throws:
        ScriptException - if an error occurrs during invocation of the method.
        NoSuchMethodException - if method with given name or matching argument types cannot be found.
        NullPointerException - if the method name is null.
        IllegalArgumentException - if the specified thiz is null or the specified Object is does not represent a scripting object.
      • getInterface

        <T> T getInterface(Class<T> clasz)
        Returns an implementation of an interface using functions compiled in the interpreter. The methods of the interface may be implemented using the invokeFunction method.
        Parameters:
        clasz - The Class object of the interface to return.
        Returns:
        An instance of requested interface - null if the requested interface is unavailable, i. e. if compiled functions in the ScriptEngine cannot be found matching the ones in the requested interface.
        Throws:
        IllegalArgumentException - if the specified Class object is null or is not an interface.
      • getInterface

        <T> T getInterface(Object thiz,
                         Class<T> clasz)
        Returns an implementation of an interface using member functions of a scripting object compiled in the interpreter. The methods of the interface may be implemented using the invokeMethod method.
        Parameters:
        thiz - The scripting object whose member functions are used to implement the methods of the interface.
        clasz - The Class object of the interface to return.
        Returns:
        An instance of requested interface - null if the requested interface is unavailable, i. e. if compiled methods in the ScriptEngine cannot be found matching the ones in the requested interface.
        Throws:
        IllegalArgumentException - if the specified Class object is null or is not an interface, or if the specified Object is null or does not represent a scripting object.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/script/Invocable.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut