Package g3.project.elements
Interface Scriptable
-
- All Known Implementing Classes:
DocElement
,ImageElement
,PageElement
,PlayableElement
,ShapeElement
,TableElement
,Tool
,VisualElement
public interface Scriptable
- Author:
- Group 3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addScriptFile(java.nio.file.Path path, java.lang.String language)
Attach a script file to this object.java.lang.Boolean
getEvalRequired()
Get if the element requires evaluating again.java.util.Optional<RecursiveBindings>
getParentElementScriptingBindings()
Get Local Script Bindings of parent node, if parent node is another Scriptable element.java.util.Optional<Scriptable>
getParentScriptable()
Get the parent of this Scriptable element.java.lang.String
getRealType()
Return the type of the element.java.util.Optional<ScriptElement>
getScriptEl()
Get the ScriptElement attached to this object.RecursiveBindings
getScriptingBindings()
Get the local scope for this object.void
setEvalRequired(java.lang.Boolean req)
Set if the element requires evaluating again.
-
-
-
Method Detail
-
getScriptingBindings
RecursiveBindings getScriptingBindings()
Get the local scope for this object.- Returns:
- my Bindings.
-
getParentElementScriptingBindings
java.util.Optional<RecursiveBindings> getParentElementScriptingBindings()
Get Local Script Bindings of parent node, if parent node is another Scriptable element.- Returns:
- Optional Bindings
-
getParentScriptable
java.util.Optional<Scriptable> getParentScriptable()
Get the parent of this Scriptable element.- Returns:
- Maybe parent.
-
getScriptEl
java.util.Optional<ScriptElement> getScriptEl()
Get the ScriptElement attached to this object. There should only be one element.- Returns:
- my (first) script element.
-
addScriptFile
void addScriptFile(java.nio.file.Path path, java.lang.String language) throws java.io.IOException
Attach a script file to this object.- Parameters:
path
- Path to file.language
- Script language.- Throws:
java.io.IOException
- Couldn't access path.
-
getRealType
java.lang.String getRealType()
Return the type of the element.- Returns:
- Type-name
-
getEvalRequired
java.lang.Boolean getEvalRequired()
Get if the element requires evaluating again.- Returns:
- Is Eval required?
-
setEvalRequired
void setEvalRequired(java.lang.Boolean req)
Set if the element requires evaluating again.- Parameters:
req
- Re-Evaluate is required?
-
-