Class ScriptEngineWrapper

  • Direct Known Subclasses:
    DefaultEngineWrapper

    public abstract class ScriptEngineWrapper
    extends java.lang.Object
    • Constructor Detail

      • ScriptEngineWrapper

        @Deprecated
        public ScriptEngineWrapper​(javax.script.ScriptEngine engine)
        Deprecated.
        Constructs a ScriptEngineWrapper with the given engine (to obtain a factory).
        Parameters:
        engine - an engine to obtain the corresponding ScriptEngineFactory.
      • ScriptEngineWrapper

        public ScriptEngineWrapper​(javax.script.ScriptEngineFactory factory)
        Constructs a ScriptEngineWrapper with the given engine factory.
        Parameters:
        factory - the factory to create ScriptEngines and obtain engine data (for example, engine name, language).
        Since:
        2.8.0
        See Also:
        getEngine()
    • Method Detail

      • getLanguageName

        public java.lang.String getLanguageName()
      • getEngineName

        public java.lang.String getEngineName()
      • getEngine

        public javax.script.ScriptEngine getEngine()
      • isTextBased

        public abstract boolean isTextBased()
      • getTemplate

        public abstract java.lang.String getTemplate​(java.lang.String type)
      • getSyntaxStyle

        public abstract java.lang.String getSyntaxStyle()
      • getIcon

        public abstract javax.swing.ImageIcon getIcon()
      • getExtensions

        public java.util.List<java.lang.String> getExtensions()
      • isSingleThreaded

        public boolean isSingleThreaded()
        Tells whether or not this engine is single threaded.

        Engines that are single threaded have their cached scripts executed by a single thread at a time.

        Returns:
        true if the engine is single threaded, false otherwise.
        Since:
        2.12.0
        See Also:
        ScriptsCache
      • isVisible

        public boolean isVisible()
        Tells whether or not this engine should be visible to the user.

        Engines that are not visible are not shown in the GUI nor listed through the API.

        Engines are visible by default.

        Returns:
        true if the engine should be visible to the user, false otherwise.
        Since:
        2.8.0
      • isRawEngine

        public abstract boolean isRawEngine()
      • isSupportsMissingTemplates

        public abstract boolean isSupportsMissingTemplates()
        Returns true if this engine supports script types without defined templates.
        Returns:
        true if the engine doesn't require templates, false otherwise.
      • isDefaultTemplate

        public abstract boolean isDefaultTemplate​(ScriptWrapper script)
        Tells whether or not the given script is a default template of this engine.

        Default templates are automatically removed when the script engine is removed.

        Parameters:
        script - the script template that should be checked
        Returns:
        true if the template script is default of this engine, false otherwise