de.vc.xml

## Interface Node

- All Superinterfaces:
    java.lang.Cloneable, NodeElement, java.io.Serializable
  All Known Subinterfaces:
    BlockElement, InlineElement, PageMaster
  All Known Implementing Classes:
    AbstractNode, AbstractNodeWithAttributes, BasicLink, BidiOverride, Block, BlockContainer, ColorProfile, ConditionalPageMasterReference, Declarations, DefaultNode, Document, ExternalGraphic, Flow, FlowObject, FlowObjectWithElements, FOCharacter, FOFloat, Footnote, FootnoteBody, FormattingObject, InitialPropertySet, Inline, InlineContainer, InstreamForeignObject, LayoutMasterSet, Leader, ListBlock, ListItem, ListItemBody, ListItemLabel, Marker, MultiCase, MultiProperties, MultiPropertySet, MultiSwitch, MultiToggle, PageMasterReference, PageNumber, PageNumberCitation, PageSequence, PageSequenceMaster, RegionAfter, RegionBefore, RegionBody, RegionEnd, RegionStart, RepeatablePageMasterAlternatives, RepeatablePageMasterReference, RetrieveMarker, SimplePageMaster, SinglePageMasterReference, StaticContent, SwappingFObj, Table, TableAndCaption, TableBody, TableCaption, TableCell, TableColumn, TableContent, TableFooter, TableHeader, TableRow, Title, UnresolvedCompareField, Wrapper

      public interface Node
      extends NodeElement

  Interface for XML nodes.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttributeChangeListener(AttributeChangeListener l)` Adds an listener that is notified when an attribute was changed.
    `void` | `addElement(int index, java.lang.Object e)` Adds a node element at `index` to this node.
    `void` | `addElement(java.lang.Object e)` Adds a node element to this node.
    `boolean` | `clearInheratedAttribute(java.lang.String name)` Clears an attributed that was defined by a parent node and has same value.
    `void` | `clearInheratedAttributes()` Clears all attributes that were defined by a parent node and have same value.
    `void` | `clearValue(java.lang.String name)` Clears an attribute, this means they value becomes NULL.
    `boolean` | `contains(Node child, boolean deep)` Tests if this node contains the given node.
    `void` | `fireSaxEvents(org.xml.sax.ContentHandler handler)` Fires SAX events to a SAX content handler.
    `java.lang.Object` | `firstElement()` Gets the first element of this node.
    `java.lang.String` | `getAttrAsString(java.lang.String name)` Gets an attribute as String.
    `java.lang.String` | `getAttrAsString(java.lang.String name, boolean inherit)` Gets the value of an attribute as String.
    `java.lang.Object` | `getAttribute(java.lang.String name)` Gets an attribute.
    `java.lang.Object` | `getAttribute(java.lang.String name, boolean inherit)` Gets the value of an attribute.
    `java.util.Map<java.lang.String,java.lang.Object>` | `getAttributeMap()` Gets a map of all defined attributes.
    `java.lang.String` | `getContentText(boolean deep)` Gets only the text of this node.
    `java.util.Set<java.lang.String>` | `getDefinedAttributes(boolean deep)` Gets a Set of all defined attributes.
    `java.util.List<java.lang.Object>` | `getElements()` Gets childreen of this node.
    `java.util.List<Node>` | `getElements(java.lang.String name, boolean deep)` Finds all sub nodes of this node that have the given name.
    `java.lang.String` | `getLocalName()` Gets the local name of this node.
    `java.lang.String` | `getNamespacePrefix()` Gets the namespace prefix of this node.
    `java.util.Set<java.lang.String>` | `getNamespacePrefixes(boolean inherated)` Gets a set of all defined namespace prefixes.
    `java.lang.String` | `getNamespaceURI(java.lang.String prefix, boolean inherated)` Gets the URI of a namespace prefix.
    `java.lang.String` | `getQName()` Gets the full qualified name of this node.
    `Node` | `getRoot()` Gets the root node of this node.
    `int` | `indexOf(java.lang.Object child)` Gets the index of a child.
    `boolean` | `isEmpty()` Determinates if this node has no elements.
    `java.lang.Object` | `lastElement()` Gets the last element of this node.
    `void` | `removeAttributeChangeListener(AttributeChangeListener l)` Removes a listener that was listener for attribute changes.
    `java.lang.Object` | `removeElement(int i)` Removes an element from this node.
    `boolean` | `removeElement(java.lang.Object e)` Removes an element from this node.
    `boolean` | `replaceElement(java.lang.Object oldElement, java.lang.Object newElement)` Replaces an element.
    `boolean` | `setAttribute(java.lang.String name, java.lang.Object value)` Sets the value of an attribute.
    `void` | `setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributeMap)` Sets all attributes that are contained in the map.
    `java.lang.Object` | `setElement(int index, java.lang.Object e)` Replaces a node element at `index` of this node.
    `void` | `setNamespace(java.lang.String prefix, java.lang.String uri)` Sets a namespace.

    - ### Methods inherited from interface de.vc.xml.NodeElement

      `clone, getParent, setParent, writeTo`

- - ### Method Detail

    - #### getElements

          java.util.List<java.lang.Object> getElements()

      Gets childreen of this node. A child is typical an instance of `NodeElement` or `String`.
      Returns:
        Childreen.

    - #### addElement

          void addElement(java.lang.Object e)

      Adds a node element to this node.
      Parameters:
        `e` - Node element.
      Throws:
        `java.lang.UnsupportedOperationException` - is throws if no childreen are allowed.
        `java.lang.NullPointerException` - is thrown if `e==null`

    - #### addElement

          void addElement(int index,
                        java.lang.Object e)

      Adds a node element at `index` to this node.
      Parameters:
        `index` - Index of element.
        `e` - Node element.
      Throws:
        `java.lang.IndexOutOfBoundsException` - is thrown if `index` is out of bounds.
        `java.lang.UnsupportedOperationException` - is throws if no childreen are allowed.
        `java.lang.NullPointerException` - is thrown if `e==null`

    - #### setElement

          java.lang.Object setElement(int index,
                                    java.lang.Object e)

      Replaces a node element at `index` of this node.
      Parameters:
        `index` - Index of element.
        `e` - Node element.
      Returns:
        Replaced element.
      Throws:
        `java.lang.IndexOutOfBoundsException` - is thrown if `index` is out of bounds.
        `java.lang.UnsupportedOperationException` - is throws if no childreen are allowed.
        `java.lang.NullPointerException` - is thrown if `e==null`

    - #### removeElement

          boolean removeElement(java.lang.Object e)

      Removes an element from this node.
      Parameters:
        `e` - NodeElement
      Returns:
        `true` if this node contained the specified element.

    - #### removeElement

          java.lang.Object removeElement(int i)

      Removes an element from this node.
      Parameters:
        `i` - Index of element.
      Returns:
        Removed node element.
      Throws:
        `java.lang.IndexOutOfBoundsException` - is thrown if `index` is out of bounds.

    - #### replaceElement

          boolean replaceElement(java.lang.Object oldElement,
                               java.lang.Object newElement)

      Replaces an element.
      Parameters:
        `oldElement` - Old element.
        `newElement` - New element.
      Returns:
        `true` if this node contained `oldElement`

    - #### getRoot

          Node getRoot()

      Gets the root node of this node.
      Returns:
        Root node.

    - #### getAttributeMap

          java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()

      Gets a map of all defined attributes.
      Returns:
        Map of attributes.

    - #### getDefinedAttributes

          java.util.Set<java.lang.String> getDefinedAttributes(boolean deep)

      Gets a Set of all defined attributes.
      Parameters:
        `deep` - true, if defined of parent nodes are included.
      Returns:
        Set of all defined attributes.

    - #### getQName

          java.lang.String getQName()

      Gets the full qualified name of this node. Qualified name means name with namespace prefix.
      Returns:
        Name of this node.

    - #### getLocalName

          java.lang.String getLocalName()

      Gets the local name of this node. Local name means name without namespace prefix.
      Returns:
        Local name of this node.

    - #### indexOf

          int indexOf(java.lang.Object child)

      Gets the index of a child.
      Parameters:
        `child` - Child.
      Returns:
        index or -1, if not found.

    - #### lastElement

          java.lang.Object lastElement()

      Gets the last element of this node.
      Returns:
        Last element or NULL if empty.

    - #### firstElement

          java.lang.Object firstElement()

      Gets the first element of this node.
      Returns:
        First element or NULL if empty.

    - #### getAttribute

          java.lang.Object getAttribute(java.lang.String name)

      Gets an attribute. It's possible that an attribute is not of type String.
      Parameters:
        `name` - Attribute name.
      Returns:
        Value.

    - #### getAttrAsString

          java.lang.String getAttrAsString(java.lang.String name)

      Gets an attribute as String.
      Parameters:
        `name` - Attribute name.
      Returns:
        Value as String.

    - #### getAttrAsString

          java.lang.String getAttrAsString(java.lang.String name,
                                         boolean inherit)

      Gets the value of an attribute as String.
      Parameters:
        `name` - Name of attribute.
        `inherit` - True if attribute can be defined by a parent node.
      Returns:
        Value of attribute or NULL, if not defined.

    - #### getAttribute

          java.lang.Object getAttribute(java.lang.String name,
                                      boolean inherit)

      Gets the value of an attribute.
      Parameters:
        `name` - Name of attribute.
        `inherit` - True if attribute can be defined by a parent node.
      Returns:
        Value of attribute or NULL, if not defined.

    - #### getContentText

          java.lang.String getContentText(boolean deep)

      Gets only the text of this node.
      Parameters:
        `deep` - true, if sub-nodes shall be included.
      Returns:
        Text.

    - #### getNamespaceURI

          java.lang.String getNamespaceURI(java.lang.String prefix,
                                         boolean inherated)

      Gets the URI of a namespace prefix.
      Parameters:
        `prefix` - Prefix of namespace.
        `inherated` - Regard also namespace definitions of parent nodes.
      Returns:
        URI of namespace or NULL if not defined.

    - #### getNamespacePrefixes

          java.util.Set<java.lang.String> getNamespacePrefixes(boolean inherated)

      Gets a set of all defined namespace prefixes.
      Parameters:
        `inherated` - Get also defined namespaces of parent nodes.
      Returns:
        Set of namespace prefixes (String).

    - #### setNamespace

          void setNamespace(java.lang.String prefix,
                          java.lang.String uri)

      Sets a namespace.
      Parameters:
        `prefix` - Prefix of namespace.
        `uri` - URI of namespace.

    - #### getNamespacePrefix

          java.lang.String getNamespacePrefix()

      Gets the namespace prefix of this node.
      Returns:
        Prefix of namespace.

    - #### isEmpty

          boolean isEmpty()

      Determinates if this node has no elements.
      Returns:
        true, if this node has no elements.

    - #### clearInheratedAttributes

          void clearInheratedAttributes()

      Clears all attributes that were defined by a parent node and have same value.

    - #### clearInheratedAttribute

          boolean clearInheratedAttribute(java.lang.String name)

      Clears an attributed that was defined by a parent node and has same value.
      Parameters:
        `name` - Name of attribute.
      Returns:
        `true` if attribute was cleared.

    - #### contains

          boolean contains(Node child,
                         boolean deep)

      Tests if this node contains the given node.
      Parameters:
        `child` - Node.
        `deep` - Search also in subnodes.
      Returns:
        `true` if this node contains `child`.

    - #### clearValue

          void clearValue(java.lang.String name)

      Clears an attribute, this means they value becomes NULL.
      Parameters:
        `name` - Name of the attribute.

    - #### setAttribute

          boolean setAttribute(java.lang.String name,
                             java.lang.Object value)

      Sets the value of an attribute. A ValueChangeEvent is fired.
      Parameters:
        `name` - Name of the attribute.
        `value` - New value.
      Returns:
        true, if value was setted.

    - #### setAttributes

          void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributeMap)

      Sets all attributes that are contained in the map.
      Parameters:
        `attributeMap` - Map of attributes to values.

    - #### getElements

          java.util.List<Node> getElements(java.lang.String name,
                                         boolean deep)

      Finds all sub nodes of this node that have the given name.
      Parameters:
        `name` - Tag of sub-node.
        `deep` - true, if deep search.
      Returns:
        Nodes that has given name.

    - #### fireSaxEvents

          void fireSaxEvents(org.xml.sax.ContentHandler handler)
                             throws org.xml.sax.SAXException

      Fires SAX events to a SAX content handler.
      Parameters:
        `handler` - Content handler.
      Throws:
        `org.xml.sax.SAXException`

    - #### addAttributeChangeListener

          void addAttributeChangeListener(AttributeChangeListener l)

      Adds an listener that is notified when an attribute was changed.
      Parameters:
        `l` - Listener.

    - #### removeAttributeChangeListener

          void removeAttributeChangeListener(AttributeChangeListener l)

      Removes a listener that was listener for attribute changes.
      Parameters:
        `l` - Listener.

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.