|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.googlecode.jinahya.xml.ElementLocator
public abstract class ElementLocator
Abstract element locator.
| Constructor Summary | |
|---|---|
ElementLocator(ELElement root)
Creates a new instance. |
|
| Method Summary | |
|---|---|
ElementLocator |
addChild(String localName)
Adds a child element and locate it. |
ElementLocator |
addChild(String namespaceURI,
String localName)
Adds a child element and locate it. |
String |
getAttribute(String localName)
|
String |
getAttribute(String namespaceURI,
String localName)
Finds an attribute and returns its value. |
int |
getChildCount(String localName)
Returns the number of child elements which each has given localName in no namespace. |
int |
getChildCount(String namespaceURI,
String localName)
Returns the number of child elements which each has given localName in specified namespaceURI. |
String |
getLocalName()
|
String |
getNamespaceURI()
|
String |
getText()
Returns text value of currently located element. |
ElementLocator |
locateChild(String localName,
int index)
Locates child element which has given localName in no
namespace at index. |
ElementLocator |
locateChild(String namespaceURI,
String localName,
int index)
Locate a child element which has given localName in given
namespaceURI at index. |
ElementLocator |
locateParent()
Locates to the parent element. |
ElementLocator |
locateRoot()
Locate to the root element. |
ElementLocator |
removeCurrent()
Removes currently located element and locate parent. |
ElementLocator |
setAttribute(String localName,
String value)
|
ElementLocator |
setAttribute(String namespaceURI,
String localName,
String value)
Sets or removes attribute's value. |
ElementLocator |
setText(String text)
Sets the text value of currently located element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ElementLocator(ELElement root)
root - root element| Method Detail |
|---|
public final String getNamespaceURI()
public final String getLocalName()
public final int getChildCount(String localName)
localName in no namespace.
localName - local name
public final int getChildCount(String namespaceURI,
String localName)
localName in specified namespaceURI. En empty
string("") must be used for no(null) namespace.
namespaceURI - The namespace URI.localName - The local name.
#getCount(String)public final ElementLocator locateRoot()
public final ElementLocator locateParent()
public final ElementLocator locateChild(String localName,
int index)
localName in no
namespace at index. An
IndexOutOfBoundsException will be thrown if there is no
child at specified index.
localName - element's local nameindex - child element index
#child(java.lang.String, java.lang.String, int)
public final ElementLocator locateChild(String namespaceURI,
String localName,
int index)
localName in given
namespaceURI at index. An
IndexOutOfBoundsException will be thrown if there is no
child at specified index.
namespaceURI - element's namespace URIlocalName - element's local nameindex - target index to locate
#child(String, int)public final ElementLocator addChild(String localName)
localName in no namespace.
localName - new child element's local name.
public final ElementLocator addChild(String namespaceURI,
String localName)
localName in given namespaceURI.
namespaceURI - child element's namespace URIlocalName - child element's local name
public final String getText()
public final ElementLocator setText(String text)
text - new text value
public final String getAttribute(String localName)
public final String getAttribute(String namespaceURI,
String localName)
namespaceURI - attribute's namespace URIlocalName - attribute's local name
public final ElementLocator setAttribute(String localName,
String value)
public final ElementLocator setAttribute(String namespaceURI,
String localName,
String value)
value is null mapped
attribute will be removed.
namespaceURI - attribute's namespace URIlocalName - attribute's local namevalue - attribute's value; null for removing attribute
public final ElementLocator removeCurrent()
IllegalStateException will be thrown if this locate is
currently locating the root element.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||