Class NodeUpdate
java.lang.Object
org.basex.query.up.primitives.Update
org.basex.query.up.primitives.DataUpdate
org.basex.query.up.primitives.node.NodeUpdate
- Direct Known Subclasses:
DeleteNode,InsertAfter,InsertAttribute,InsertBefore,InsertInto,InsertIntoAsFirst,InsertIntoAsLast,RenameNode,ReplaceDoc,ReplaceNode,ReplaceValue
Base class for all update primitives that operate on a specific node.
- Author:
- BaseX Team 2005-21, BSD License, Lukas Kircher
-
Field Summary
FieldsFields inherited from class org.basex.query.up.primitives.DataUpdate
data -
Method Summary
Modifier and TypeMethodDescriptionabstract voidAdds the atomic update operations for this update primitive to the given list.final DBNodenode()Creates aDBNodeinstance from the target node information.abstract voidprepare(MemData memData, QueryContext qc) Prepares this update primitive before execution.substitute(MemData tmp) Substitutes the update primitive if necessary.abstract voidUpdates the name pool, which is used to find duplicate attributes and namespace conflicts.Methods inherited from class org.basex.query.up.primitives.DataUpdate
data
-
Field Details
-
pre
public final int prePre value of target node.
-
-
Method Details
-
node
Creates aDBNodeinstance from the target node information.- Returns:
- new node instance
-
prepare
Prepares this update primitive before execution. This includes e.g. the preparation of insertion sequences.- Parameters:
memData- temporary data instanceqc- query context- Throws:
QueryException- query exception
-
update
Updates the name pool, which is used to find duplicate attributes and namespace conflicts.- Parameters:
pool- name pool
-
addAtomics
Adds the atomic update operations for this update primitive to the given list.- Parameters:
auc- list of atomic updates
-
substitute
Substitutes the update primitive if necessary. For instance a 'Replace Value of' primitive called on a target T with T being an element results in a 'Replace Element Content' primitive with target T. As this is ugly to process it is substituted by delete primitives for every child of T and an 'Insert into' primitive if the length of the (optional!) text node is greater zero. When a primitive is substituted it is still added to the list itself to be able to throw exceptions when necessary. I.e. for multiple replaces on the same target node. These update primitives don't produce atomic updates, hence this won't affect the database.- Parameters:
tmp- temporary mem data- Returns:
- An array that contains the substituting primitives or this update primitive if no substitution is necessary.
-