sk.uniba.euromath.document
Class DocumentContent

java.lang.Object
  extended by sk.uniba.euromath.document.DocumentContent

public final class DocumentContent
extends Object

Provides access to document's contents. It doesn't provide functions to modify document - that is the task of DocumentModifier. Nodes, returned by this function, must not be modified.

Author:
Martin Vysny

Method Summary
 void checkNode(Node node)
          Checks the node if it is from our document.
 void checkPtr(sk.baka.ikslibs.ptr.DomPointer ptr)
          Checks the pointer if it points into our document.
 boolean containsElements(String id)
          Deprecated.  
 DocumentFragment copy(sk.baka.ikslibs.ptr.DomPointer from, sk.baka.ikslibs.ptr.DomPointer to)
          Deprecated.  
 Attr getAttrNode(String id)
          Deprecated.  
 Comment getCommentNode(String id)
          Deprecated.  
static String getContainerText(Node node)
          Deprecated.  
 String getContainerText(String id)
          Deprecated.  
static String getData(Node node)
          Deprecated.  
 String getData(String id)
          Deprecated.  
 Element getElement(String id)
          Deprecated.  
 Element getNameRoot(Node node)
          Deprecated.  
 ProcessingInstruction getPINode(String id)
          Deprecated.  
 sk.baka.ikslibs.levelmapper.NodeListID getTextNode(String id)
          Deprecated.  
 boolean isOurNode(Node node)
          Checks the node if it is from our document.
 ContentNodesIterator iterateContent(Node node)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getElement

@Deprecated
public Element getElement(String id)
                   throws DocumentException
Deprecated. 

Returns regular element, identified by given id.

Parameters:
id - id of node.
Returns:
Element, denoted by given id.
Throws:
DocumentException - if id doesn't exist or it doesn't denote regular element.

getTextNode

@Deprecated
public sk.baka.ikslibs.levelmapper.NodeListID getTextNode(String id)
                                                   throws DocumentException
Deprecated. 

Gets text (or CData) nodes, containing text identified by ID.

Parameters:
id - id of the desired node.
Returns:
text nodes denoted by given id.
Throws:
DocumentException - if id doesn't exist or it doesn't denote text or CData node.

getPINode

@Deprecated
public ProcessingInstruction getPINode(String id)
                                throws DocumentException
Deprecated. 

Gets processing instruction node, identified by ID.

Parameters:
id - id of the desired node.
Returns:
the node
Throws:
DocumentException - if id doesn't exist or it doesn't denote ProcessingInstruction node.

getCommentNode

@Deprecated
public Comment getCommentNode(String id)
                       throws DocumentException
Deprecated. 

Gets comment node, identified by ID.

Parameters:
id - id of the desired node.
Returns:
the node
Throws:
DocumentException - if id doesn't exist or it doesn't denote Comment node.

getAttrNode

@Deprecated
public Attr getAttrNode(String id)
                 throws DocumentException
Deprecated. 

Gets attribute node, identified by ID.

Parameters:
id - id of the desired node.
Returns:
the node
Throws:
DocumentException - if id doesn't exist or it doesn't denote Attr node.

getData

@Deprecated
public String getData(String id)
               throws DocumentException
Deprecated. 

Returns data, associated with given node. Returns a text value.

Parameters:
id - id of node.
Returns:
character data, that the node contains. Never null.
Throws:
DocumentException - if node doesn't exist or it denotes an element.

getData

@Deprecated
public static String getData(Node node)
Deprecated. 

Returns data, associated with given node. Returns a text value.

Parameters:
node - the node.
Returns:
character data, that the node contains. Never null.

containsElements

@Deprecated
public boolean containsElements(String id)
                         throws DocumentException
Deprecated. 

Checks, whether given element contains some elements also, or it contains text/comments/pi only.

Parameters:
id - id of element.
Returns:
true if element contains at least one regular element, false otherwise.
Throws:
DocumentException - if id doesn't exist or it doesn't denote regular element.

getContainerText

@Deprecated
public String getContainerText(String id)
Deprecated. 

Computes text value of element or entity reference by concatenating all textual values of descendant text/cdata nodes.

Parameters:
id - id of element.
Returns:
textual value of element, never null.
Throws:
DocumentException - if id doesn't exist or it doesn't denote regular element.

getContainerText

@Deprecated
public static String getContainerText(Node node)
Deprecated. 

Computes text value of element or entity by concatenating all textual values of descendant text/cdata nodes.

Parameters:
node - node to query.
Returns:
textual value of element, never null.

getNameRoot

@Deprecated
public Element getNameRoot(Node node)
Deprecated. 

Returns element that is the nameroot of tree containing given node.

Parameters:
node - the node.
Returns:
nameroot (an element that belongs to same namespace as given node (if node is not element then its parent/owner is used instead), its parent is null or has different namespace and it is nearest such node to given node).

copy

@Deprecated
public DocumentFragment copy(sk.baka.ikslibs.ptr.DomPointer from,
                                        sk.baka.ikslibs.ptr.DomPointer to)
Deprecated. 

Tries to copy all nodes in the specified range (the node pointed to by to parameter is not copied). Copied nodes are returned in a DocumentFragment instance. Both pointers must have the same parent element.

Parameters:
from - start of the removal interval. The node where this pointer points shall be copied first.
to - end of the copy interval.
Returns:
DocumentFragment instance containing nodes that have been cut from the document. Never null. No element in the target fragment will have emp:id attribute.

checkNode

public void checkNode(Node node)
Checks the node if it is from our document.

Parameters:
node - node to check.
Throws:
IllegalArgumentException - if node is not from bound document

checkPtr

public void checkPtr(sk.baka.ikslibs.ptr.DomPointer ptr)
Checks the pointer if it points into our document.

Parameters:
ptr - pointer to check.
Throws:
IllegalArgumentException - if pointer is not from bound document

isOurNode

public boolean isOurNode(Node node)
Checks the node if it is from our document.

Parameters:
node - node to check.
Returns:
true if the node was created by this document, false otherwise.

iterateContent

@Deprecated
public ContentNodesIterator iterateContent(Node node)
Deprecated. 

Iterates over the content nodes (comment, pi, text and element nodes) located directly in given node (i.e. there is no element node between node and returned nodes; iterator does not iterate through other elements).

Parameters:
node - contents of this node are to be iterated.
Returns:
iterator iterating through direct content nodes.


Copyright © 2003-2006 null. All Rights Reserved.