public final class Script extends Object implements NamespacePrefixMap
This class is thread-safe.
EMPTY_PREFIXES, XML_PREFIXES
Constructor and Description |
---|
Script() |
Modifier and Type | Method and Description |
---|---|
void |
addAction(com.xmlmind.xml.xed.Action action) |
void |
addMacro(com.xmlmind.xml.xed.MacroCmd macro) |
void |
declareNamespace(String prefix,
Namespace namespace) |
void |
declareNamespace(String prefix,
String uri) |
com.xmlmind.xml.xed.Action[] |
getActions() |
com.xmlmind.xml.xed.MacroCmd |
getMacro(String name) |
com.xmlmind.xml.xed.MacroCmd[] |
getMacros() |
PrefixEntry[] |
getNamespacePrefixes() |
URL |
getURL() |
String[] |
namespaceToPrefixes(Namespace namespace)
Returns the list of prefixes used to represent specified namespace.
|
Namespace |
prefixToNamespace(String prefix)
Returns namespace represented by specified prefix.
|
void |
resolveCommands() |
void |
run(Document doc,
Console console) |
void |
run(ScriptExprContext context,
Console console) |
void |
run(XNode contextNode,
ExprContext context,
Console console) |
void |
setURL(URL url) |
String |
toString() |
void |
toString(StringBuilder buffer) |
public void setURL(URL url)
public URL getURL()
public PrefixEntry[] getNamespacePrefixes()
public void addMacro(com.xmlmind.xml.xed.MacroCmd macro)
public com.xmlmind.xml.xed.MacroCmd getMacro(String name)
public com.xmlmind.xml.xed.MacroCmd[] getMacros()
public void addAction(com.xmlmind.xml.xed.Action action)
public com.xmlmind.xml.xed.Action[] getActions()
public void resolveCommands() throws ScriptLoadException
ScriptLoadException
public void run(Document doc, Console console) throws com.xmlmind.xml.xed.ActionException
com.xmlmind.xml.xed.ActionException
public void run(ScriptExprContext context, Console console) throws com.xmlmind.xml.xed.ActionException
com.xmlmind.xml.xed.ActionException
public void run(XNode contextNode, ExprContext context, Console console) throws com.xmlmind.xml.xed.ActionException
com.xmlmind.xml.xed.ActionException
public void toString(StringBuilder buffer)
public Namespace prefixToNamespace(String prefix)
PrefixToNamespace
The empty string may be used to get the prefix of the default namespace.
Note: In principle, this method is not invoked for
prefix "xml". However, in such case, it should return
Namespace.XML
.
prefixToNamespace
in interface PrefixToNamespace
prefix
- prefix representing a namespace.
May be the empty string ("").null
if prefix is unknown (that is, not used to represent any namespace).public String[] namespaceToPrefixes(Namespace namespace)
NamespaceToPrefixes
The returned list may contain the empty string which means that specified namespace is the default namespace.
Note:In principle, this method is not invoked for
the absent namespace ("") and for
"http://www.w3.org/XML/1998/namespace".
However, it should return NamespaceToPrefixes.EMPTY_PREFIXES
for
the absent namespace and NamespaceToPrefixes.XML_PREFIXES
for
the "http://www.w3.org/XML/1998/namespace" namespace.
namespaceToPrefixes
in interface NamespaceToPrefixes
namespace
- the namespace represented by one or several prefixesnull
if specified namespace is not represented by any
prefix.