MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.model.updatePrimitives
Interface UpdateableStore

All Superinterfaces:
Source
All Known Implementing Classes:
LLStore

public interface UpdateableStore
extends Source

Store of an XQuery-Data-Model-tree.


Method Summary
 void appendForInsert(XDMIterator node)
          Appends the passed not to the store.
 void checkNSXDM()
          Check if the store has conflicting namespace binding or violates XDM constraints
 boolean containsOnlyAttrs()
          Does this store only contain attributes?
 boolean containsTopAttrs()
          Returns true if the sequence that is represented by this store contains top attributes.
 int count()
          Counts the items that are saved in this store.
 void delete(Identifier targetId)
          Deletes the element that has the identifier targetId.
 java.lang.String getDoctypeRootElem()
          If the store contains a document with a docdecls, return the root element definition
 Window getIteratorForId(Identifier identifier)
          Returns Iterator that points on the token with the passed identifier in the store.
 Identifier getParentId(Identifier identifier)
          Returns the Identifier of the event with the passed identifier.
 XDMIterator getParentIterator(Identifier id)
          Get a window/iterator of the parent
 java.lang.String getPublicID()
          If the store contains a document with a docdecls, return the public id
 StoreSet getStoreSet()
          Get the StoreSet that the store belongs to
 java.lang.String getSystemID()
          If the store contains a document with a docdecls, return the system id
 boolean hasParent(Identifier identifier)
          Returns true if the event with the passed identifier has a parent.
 void insertAfter(Identifier targetId, UpdateableStore store)
          Inserts node after the element with the id targetId into the store.
 void insertAttributes(Identifier targetId, UpdateableStore store)
          Inserts all attributes of node into the XML-start-tag that has the identifier targetId.
 void insertBefore(Identifier targetId, UpdateableStore store)
          Inserts node before the element with the id targetId into the store.
 void insertInto(Identifier targetId, UpdateableStore store)
          Inserts node into the element with the id targetId.
 void insertIntoAsFirst(Identifier targetId, UpdateableStore store)
          Inserts node into the element with the id targetId at first position.
 void insertIntoAsLast(Identifier targetId, UpdateableStore store)
          Inserts node into the element with the id targetId at last position.
 boolean isEmpty()
          Is this store empty?
 boolean isModified()
          Has this store been modified since it has been initially loaded?
 void materialize()
           
 void mergeCleanTextNodes()
          Merges and/or removes multiple adjacent or empty text nodes under the same element
 UpdateableStore pullAttributes()
          A store represents a sequence of elements.
 void rename(Identifier targetId, QName qname)
          Renames the element with the identifier targetId.
 void replaceNode(Identifier targetId, UpdateableStore store)
          Replaces the element with the identifier targetId with node.
 void replaceNodeContent(Identifier targetId, UpdateableStore store)
          Replaces the content of the element with the identifier targetId with text.
 void replaceValue(Identifier targetId, java.lang.String stringValue)
          Replaces the string value of the element with the identifier targetId with stringValue.
 void setModified(boolean modVal)
          Set the modification state of the store
 
Methods inherited from interface ch.ethz.mxquery.datamodel.Source
compare, copySource, getIterator, getURI
 

Method Detail

materialize

void materialize()
                 throws MXQueryException
Throws:
MXQueryException

appendForInsert

void appendForInsert(XDMIterator node)
                     throws MXQueryException
Appends the passed not to the store. "ForInsert" means that this Store is used to insert data in another Store. The Difference to the normal append node is that an insert sequence must no contain document nodes => a document node is replaced by its children.

Parameters:
node -
Throws:
MXQueryException

getIteratorForId

Window getIteratorForId(Identifier identifier)
                        throws MXQueryException
Returns Iterator that points on the token with the passed identifier in the store.

Parameters:
identifier -
Returns:
Returns null if the token of the passed identifier cannot be found.
Throws:
MXQueryException

getParentIterator

XDMIterator getParentIterator(Identifier id)
                              throws MXQueryException
Get a window/iterator of the parent

Parameters:
id - Node to take as base for the parent
Returns:
Iterator providing the parent, EmptySequence if there is none
Throws:
MXQueryException

getParentId

Identifier getParentId(Identifier identifier)
                       throws MXQueryException
Returns the Identifier of the event with the passed identifier.

Parameters:
identifier -
Returns:
parent identifier
Throws:
MXQueryException

hasParent

boolean hasParent(Identifier identifier)
                  throws MXQueryException
Returns true if the event with the passed identifier has a parent.

Parameters:
identifier -
Returns:
true for has parent
Throws:
MXQueryException

insertBefore

void insertBefore(Identifier targetId,
                  UpdateableStore store)
                  throws MXQueryException
Inserts node before the element with the id targetId into the store.

Parameters:
targetId - element identifier
store - some data (XQuery Data Model)
Throws:
MXQueryException

insertAfter

void insertAfter(Identifier targetId,
                 UpdateableStore store)
                 throws MXQueryException
Inserts node after the element with the id targetId into the store.

Parameters:
targetId - element identifier
store - some data (XQuery Data Model)
Throws:
MXQueryException

insertInto

void insertInto(Identifier targetId,
                UpdateableStore store)
                throws MXQueryException
Inserts node into the element with the id targetId.

Parameters:
targetId - element identifier
store - some data (XQuery Data Model)
Throws:
MXQueryException

insertIntoAsFirst

void insertIntoAsFirst(Identifier targetId,
                       UpdateableStore store)
                       throws MXQueryException
Inserts node into the element with the id targetId at first position.

Parameters:
targetId - element identifier
store - some data (XQuery Data Model)
Throws:
MXQueryException

insertIntoAsLast

void insertIntoAsLast(Identifier targetId,
                      UpdateableStore store)
                      throws MXQueryException
Inserts node into the element with the id targetId at last position.

Parameters:
targetId - element identifier
store - some data (XQuery Data Model)
Throws:
MXQueryException

insertAttributes

void insertAttributes(Identifier targetId,
                      UpdateableStore store)
                      throws MXQueryException
Inserts all attributes of node into the XML-start-tag that has the identifier targetId.

Parameters:
targetId - element identifier
store - attributes to insert (one attribute or a sequence of attributes)
Throws:
MXQueryException

delete

void delete(Identifier targetId)
            throws MXQueryException
Deletes the element that has the identifier targetId.

Parameters:
targetId - element identifier
Throws:
MXQueryException

replaceNode

void replaceNode(Identifier targetId,
                 UpdateableStore store)
                 throws MXQueryException
Replaces the element with the identifier targetId with node.

Parameters:
targetId - element identifier
store - some data (XQuery Data Model)
Throws:
MXQueryException

replaceValue

void replaceValue(Identifier targetId,
                  java.lang.String stringValue)
                  throws MXQueryException
Replaces the string value of the element with the identifier targetId with stringValue.

Parameters:
targetId - element identifier (element must be an attribute, text, comment, or processing instruction node)
stringValue - data that contains a string
Throws:
MXQueryException

replaceNodeContent

void replaceNodeContent(Identifier targetId,
                        UpdateableStore store)
                        throws MXQueryException
Replaces the content of the element with the identifier targetId with text.

Parameters:
targetId - element identifier (element must be an XML-node)
store - contains per facility only one text element (string, int, ...)
Throws:
MXQueryException

rename

void rename(Identifier targetId,
            QName qname)
            throws MXQueryException
Renames the element with the identifier targetId.

Parameters:
targetId - element identifier (element must be an XML-node, or processing instruction node)
qname - new name
Throws:
MXQueryException

pullAttributes

UpdateableStore pullAttributes()
                               throws MXQueryException
A store represents a sequence of elements. This methods returns a new store that contains all attributes that are at the beginning of this sequence (the sequence that is represented by this store) and deletes them in this store.

Returns:
store of attributes
Throws:
MXQueryException

containsTopAttrs

boolean containsTopAttrs()
                         throws MXQueryException
Returns true if the sequence that is represented by this store contains top attributes. Top means attributes that are saved directly in the sequence and not indirectly inside other elements.

Returns:
true/false
Throws:
MXQueryException

containsOnlyAttrs

boolean containsOnlyAttrs()
                          throws MXQueryException
Does this store only contain attributes?

Returns:
true if this sequence contains only attributes
Throws:
MXQueryException

isEmpty

boolean isEmpty()
                throws MXQueryException
Is this store empty?

Returns:
true if empty
Throws:
MXQueryException

count

int count()
          throws MXQueryException
Counts the items that are saved in this store.

Returns:
number of events
Throws:
MXQueryException

setModified

void setModified(boolean modVal)
Set the modification state of the store


isModified

boolean isModified()
Has this store been modified since it has been initially loaded?

Returns:
true if the store has been modified

getSystemID

java.lang.String getSystemID()
If the store contains a document with a docdecls, return the system id

Returns:
Contents of the System ID, if present, otherwise null

getPublicID

java.lang.String getPublicID()
If the store contains a document with a docdecls, return the public id

Returns:
Contents of the Public ID, if present, otherwise null

getDoctypeRootElem

java.lang.String getDoctypeRootElem()
If the store contains a document with a docdecls, return the root element definition

Returns:
Contents of the root element name, if present, otherwise null

getStoreSet

StoreSet getStoreSet()
Get the StoreSet that the store belongs to

Returns:
the owning StoreSet

mergeCleanTextNodes

void mergeCleanTextNodes()
Merges and/or removes multiple adjacent or empty text nodes under the same element


checkNSXDM

void checkNSXDM()
                throws MXQueryException
Check if the store has conflicting namespace binding or violates XDM constraints

Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich