| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdom.Content
org.jdom.Element
org.apache.anakia.AnakiaElement
A JDOM Element that is tailored for Anakia needs. It has
 selectNodes(String) method as well as a toString() that
 outputs the XML serialized form of the element. This way it acts in much the
 same way as a single-element NodeList would.
| Field Summary | 
| Fields inherited from class org.jdom.Element | 
| additionalNamespaces, name, namespace | 
| Fields inherited from class org.jdom.Content | 
| parent | 
| Constructor Summary | |
| AnakiaElement(String name)This will create an AnakiaElementin no. | |
| AnakiaElement(String name,
              Namespace namespace)This will create a new AnakiaElementwith the supplied (local) name, and define
   theto be used. | |
| AnakiaElement(String name,
              String uri)This will create a new AnakiaElementwith
    the supplied (local) name, and specifies the URI
    of thetheElementshould be in, resulting it being unprefixed (in the default
    namespace). | |
| AnakiaElement(String name,
              String prefix,
              String uri)This will create a new AnakiaElementwith
    the supplied (local) name, and specifies the prefix and URI
    of thetheElementshould be in. | |
| Method Summary | |
|  List | getAttributes()This returns the complete set of attributes for this element, as a NodeListofAttributeobjects in no particular
 order, or an empty list if there are none. | 
|  List | getChildren()This returns a NodeListof all the child elements
 nested directly (one level deep) within this element, asElementobjects. | 
|  List | getChildren(String name)This returns a NodeListof all the child elements
 nested directly (one level deep) within this element with the given
 local name and belonging to no namespace, returned asElementobjects. | 
|  List | getChildren(String name,
            Namespace ns)This returns a NodeListof all the child elements
 nested directly (one level deep) within this element with the given
 local name and belonging to the given Namespace, returned asElementobjects. | 
|  List | getContent()This returns the full content of the element as a NodeList which may contain objects of type String,Element,Comment,ProcessingInstruction,CDATA, andEntityRef. | 
|  NodeList | selectNodes(String xpathExpression)Applies an XPath expression to this element and returns the resulting node list. | 
|  String | toString()Returns the XML serialized form of this element, as produced by the default XMLOutputter. | 
| Methods inherited from class org.jdom.Content | 
| detach, equals, getDocument, getParent, getParentElement, hashCode, setParent | 
| Methods inherited from class java.lang.Object | 
| finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface org.jdom.Parent | 
| getDocument, getParent | 
| Constructor Detail | 
public AnakiaElement(String name,
                     Namespace namespace)
 This will create a new AnakiaElement
   with the supplied (local) name, and define
   the Namespace
name - String name of element.namespace - Namespace to put element in.public AnakiaElement(String name)
  This will create an AnakiaElement in no
    Namespace
name - String name of element.
public AnakiaElement(String name,
                     String uri)
  This will create a new AnakiaElement with
    the supplied (local) name, and specifies the URI
    of the NamespaceElement
    should be in, resulting it being unprefixed (in the default
    namespace).
 
name - String name of element.uri - String URI for Namespace element
        should be in.
public AnakiaElement(String name,
                     String prefix,
                     String uri)
  This will create a new AnakiaElement with
    the supplied (local) name, and specifies the prefix and URI
    of the NamespaceElement
    should be in.
 
name - String name of element.prefix - The prefix of the element.uri - String URI for Namespace element
        should be in.| Method Detail | 
public NodeList selectNodes(String xpathExpression)
xpathExpression - the XPath expression you wish to apply
public String toString()
XMLOutputter.
XMLOutputter.public List getContent()
 This returns the full content of the element as a NodeList which
 may contain objects of type String, Element,
 Comment, ProcessingInstruction,
 CDATA, and EntityRef.
 The List returned is "live" in document order and modifications
 to it affect the element's actual contents.  Whitespace content is
 returned in its entirety.
 
List containing the mixed content of the
         element: may contain String,
         ElementCommentProcessingInstructionCDATAEntityRefpublic List getChildren()
 This returns a NodeList of all the child elements
 nested directly (one level deep) within this element, as
 Element objects.  If this target element has no nested
 elements, an empty List is returned.  The returned list is "live"
 in document order and changes to it affect the element's actual
 contents.
 
This performs no recursion, so elements nested two levels deep would have to be obtained with:
 
   Iterator itr = currentElement.getChildren().iterator();
   while (itr.hasNext()) {
     Element oneLevelDeep = (Element)nestedElements.next();
     List twoLevelsDeep = oneLevelDeep.getChildren();
     // Do something with these children
   }
 
 
 
Element objects for this elementpublic List getChildren(String name)
 This returns a NodeList of all the child elements
 nested directly (one level deep) within this element with the given
 local name and belonging to no namespace, returned as
 Element objects.  If this target element has no nested
 elements with the given name outside a namespace, an empty List
 is returned.  The returned list is "live" in document order
 and changes to it affect the element's actual contents.
 
 Please see the notes for getChildren()
name - local name for the children to match
public List getChildren(String name,
                        Namespace ns)
 This returns a NodeList of all the child elements
 nested directly (one level deep) within this element with the given
 local name and belonging to the given Namespace, returned as
 Element objects.  If this target element has no nested
 elements with the given name in the given Namespace, an empty List
 is returned.  The returned list is "live" in document order
 and changes to it affect the element's actual contents.
 
 Please see the notes for getChildren()
name - local name for the children to matchns - Namespace to search within
public List getAttributes()
 This returns the complete set of attributes for this element, as a
 NodeList of Attribute objects in no particular
 order, or an empty list if there are none.
 The returned list is "live" and changes to it affect the
 element's actual attributes.
 
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||