public class BaseScriptingEnvironment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
BaseScriptingEnvironment.Window
Represents the window object of this environment.
|
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALTERNATE_EVENT_NAME |
protected static java.lang.String |
APPLICATION_ECMASCRIPT
The 'application/ecmascript' MIME type.
|
protected BridgeContext |
bridgeContext
The bridge context.
|
protected ParsedURL |
docPURL
The URL of the document ot manage
|
protected Document |
document
The document to manage.
|
protected static java.lang.String |
EVENT_NAME |
static java.lang.String |
EVENT_SCRIPT_DESCRIPTION
Constant used to describe inline scripts.
|
protected java.util.WeakHashMap |
executedScripts
Set of <script> elements that have already been executed.
|
static java.lang.String |
INLINE_SCRIPT_DESCRIPTION
Constant used to describe inline scripts.
|
protected Interpreter |
interpreter
The default Interpreter for the document
|
protected java.util.Set |
languages |
protected UserAgent |
userAgent
The user-agent.
|
protected java.util.Map |
windowObjects
Map of
Interpreter to Window
objects. |
Constructor and Description |
---|
BaseScriptingEnvironment(BridgeContext ctx)
Creates a new BaseScriptingEnvironment.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkCompatibleScriptURL(java.lang.String scriptType,
ParsedURL scriptPURL)
Checks that the script URLs and the document url are
compatible.
|
protected Window |
createWindow(Interpreter interp,
java.lang.String lang)
Creates a new Window object.
|
protected void |
dispatchSVGDocEvent(java.lang.String eventType) |
protected void |
dispatchSVGLoad(Element elt,
boolean checkCanRun,
java.lang.String lang)
Auxiliary method for dispatchSVGLoad.
|
void |
dispatchSVGLoadEvent()
Recursively dispatch the SVG 'onload' event.
|
protected void |
dispatchSVGResizeEvent()
Method to dispatch SVG Resize event.
|
protected void |
dispatchSVGScrollEvent()
Method to dispatch SVG Scroll event.
|
protected void |
dispatchSVGZoomEvent()
Method to dispatch SVG Zoom event.
|
Interpreter |
getInterpreter()
Returns the default Interpreter for this document.
|
Interpreter |
getInterpreter(java.lang.String lang) |
Window |
getWindow()
Returns the Window object for scripting languages that have no
Interpreter object. |
Window |
getWindow(Interpreter interp,
java.lang.String lang)
Returns the Window object for the specified
Interpreter . |
protected void |
handleInterpreterException(InterpreterException ie)
Handles the given exception.
|
protected void |
handleSecurityException(java.lang.SecurityException se)
Handles the given exception.
|
void |
initializeEnvironment(Interpreter interp,
java.lang.String lang)
Initializes the environment of the given interpreter.
|
static boolean |
isDynamicDocument(BridgeContext ctx,
Document doc)
Tells whether the given SVG document is dynamic.
|
static boolean |
isDynamicElement(BridgeContext ctx,
Element elt) |
static boolean |
isDynamicElement(Element elt,
BridgeContext ctx,
java.util.List bridgeExtensions)
Tells whether the given SVG element is dynamic.
|
protected void |
loadScript(AbstractElement script)
Executes the specified <script> element, if it hasn't been
executed already.
|
void |
loadScripts()
Loads the scripts contained in the <script> elements.
|
public static final java.lang.String INLINE_SCRIPT_DESCRIPTION
{0} - URL of document containing script. {1} - Element tag {2} - line number of element.
public static final java.lang.String EVENT_SCRIPT_DESCRIPTION
{0} - URL of document containing script. {1} - Event attribute name {2} - line number of element.
protected static final java.lang.String EVENT_NAME
protected static final java.lang.String ALTERNATE_EVENT_NAME
protected static final java.lang.String APPLICATION_ECMASCRIPT
protected BridgeContext bridgeContext
protected UserAgent userAgent
protected Document document
protected ParsedURL docPURL
protected java.util.Set languages
protected Interpreter interpreter
protected java.util.Map windowObjects
Interpreter
to Window
objects.protected java.util.WeakHashMap executedScripts
public BaseScriptingEnvironment(BridgeContext ctx)
ctx
- the bridge contextpublic static boolean isDynamicDocument(BridgeContext ctx, Document doc)
public static boolean isDynamicElement(BridgeContext ctx, Element elt)
public static boolean isDynamicElement(Element elt, BridgeContext ctx, java.util.List bridgeExtensions)
public Window getWindow(Interpreter interp, java.lang.String lang)
Interpreter
.public Window getWindow()
Interpreter
object.protected Window createWindow(Interpreter interp, java.lang.String lang)
public Interpreter getInterpreter()
public Interpreter getInterpreter(java.lang.String lang)
public void initializeEnvironment(Interpreter interp, java.lang.String lang)
public void loadScripts()
protected void loadScript(AbstractElement script)
protected void checkCompatibleScriptURL(java.lang.String scriptType, ParsedURL scriptPURL)
public void dispatchSVGLoadEvent()
protected void dispatchSVGLoad(Element elt, boolean checkCanRun, java.lang.String lang)
protected void dispatchSVGZoomEvent()
protected void dispatchSVGScrollEvent()
protected void dispatchSVGResizeEvent()
protected void dispatchSVGDocEvent(java.lang.String eventType)
protected void handleInterpreterException(InterpreterException ie)
protected void handleSecurityException(java.lang.SecurityException se)
Copyright © 2022 Apache Software Foundation. All Rights Reserved.