public class ScriptExprContext extends ExprContextImpl implements ScriptingSupport
Modifier and Type | Field and Description |
---|---|
Document |
editedDocument |
protected IdentityLinearHashtable<Name,Map<String,XNode[]>> |
keys |
protected IdentityHashMap<Name,Name[]> |
parentToChildNames |
protected static Name |
TEXT_PSEUDO_ELEM |
documentManager, EMPTY_ID_MAP, globalVariables, ID_MAP_PROP, idMaps
Constructor and Description |
---|
ScriptExprContext(Document doc) |
Modifier and Type | Method and Description |
---|---|
void |
deleteKey(Name keyName,
String keyValue) |
XNode |
findElementWithId(XNode node,
String id)
Returns
null because this basic implementation
is not schema-aware. |
protected static Element |
findId(Element element,
Name[] idAttrNames,
String id) |
NodeIterator |
getDocument(String uriRef,
URL baseURL)
Returns
NullNodeIterator.INSTANCE because this basic
implementation does not know how to load documents. |
protected Name[] |
getIdAttrNames() |
protected Map<String,IdEntry> |
getIdMap(XNode node) |
NodeIterator |
getKeyedNodes(Name keyName,
String keyValue,
XNode node)
Returns
NullNodeIterator.INSTANCE because this basic
implementation does not support key(). |
boolean |
isChildElement(Name parentName,
Name childName) |
boolean |
isElementWithId(XNode node,
String id)
Returns
false because this basic implementation
is not schema aware. |
boolean |
mayContainText(Name elementName) |
void |
updateKey(Name keyName,
String keyValue,
XNode keyedNode) |
doGetIdMap, findNodeByFragment, getDocumentManager, getGlobalVariable, getVariableValue, reset, resolveDocumentURL, setDocumentManager, setGlobalVariable
getCurrent, getLastPosition, getPosition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGlobalVariable, setGlobalVariable
public final Document editedDocument
protected final IdentityLinearHashtable<Name,Map<String,XNode[]>> keys
protected final IdentityHashMap<Name,Name[]> parentToChildNames
protected static final Name TEXT_PSEUDO_ELEM
public ScriptExprContext(Document doc)
public XNode findElementWithId(XNode node, String id) throws EvalException
OutermostExprContext
null
because this basic implementation
is not schema-aware.findElementWithId
in interface ExprContext
findElementWithId
in class ExprContextImpl
node
- used to specify the documentid
- searched ID valuenull
otherwiseEvalException
- if a problem occurs during the searchprotected Name[] getIdAttrNames()
protected Map<String,IdEntry> getIdMap(XNode node)
getIdMap
in class ExprContextImpl
public boolean isElementWithId(XNode node, String id) throws EvalException
OutermostExprContext
false
because this basic implementation
is not schema aware.isElementWithId
in interface ExprContext
isElementWithId
in class ExprContextImpl
node
- node possibly having an ID attributeid
- ID value to be matched against the possible ID attribute of nodetrue
if specified node has an ID attribute
having specified value; false
otherwiseEvalException
- if a problem occurs during the matchpublic NodeIterator getDocument(String uriRef, URL baseURL) throws EvalException
OutermostExprContext
NullNodeIterator.INSTANCE
because this basic
implementation does not know how to load documents.getDocument
in interface ExprContext
getDocument
in class ExprContextImpl
uriRef
- specifies nodes (using a fragment) in a documentbaseURL
- URL possibly used to resolve relative URL in uriRef;
may be null
EvalException
- if a problem occurs during the operationNullNodeIterator
public void updateKey(Name keyName, String keyValue, XNode keyedNode)
updateKey
in interface ScriptingSupport
public void deleteKey(Name keyName, String keyValue)
deleteKey
in interface ScriptingSupport
public NodeIterator getKeyedNodes(Name keyName, String keyValue, XNode node) throws EvalException
OutermostExprContext
NullNodeIterator.INSTANCE
because this basic
implementation does not support key().getKeyedNodes
in interface ExprContext
getKeyedNodes
in class OutermostExprContext
keyName
- name of the keykeyValue
- searched valuenode
- the context node.The returned nodes don't need to be sorted by document order.
EvalException
- if a problem occurs during the operationpublic boolean isChildElement(Name parentName, Name childName)
isChildElement
in interface ScriptingSupport
public boolean mayContainText(Name elementName)
mayContainText
in interface ScriptingSupport