|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.googlecode.jinahya.elementlocator.ElementLocator<D>
D - document type parameterpublic abstract class ElementLocator<D>
Abstract element locator.
| Method Summary | |
|---|---|
ElementLocator<D> |
addChild(String localName)
Deprecated. Use child(java.lang.String) |
ElementLocator<D> |
addChild(String namespaceURI,
String localName)
Deprecated. Use child(java.lang.String, java.lang.String) |
String |
attribute(String namespaceURI,
String localName)
Finds an attribute and returns its value. |
ElementLocator<D> |
attribute(String namespaceURI,
String localName,
String value)
Sets or removes attribute's value. |
ElementLocator<D> |
child(String localName)
Adds a child element and locate it. |
ElementLocator<D> |
child(String localName,
int index)
Locates child element which has given localName in no
name space at index. |
ElementLocator<D> |
child(String namespaceURI,
String localName)
Adds a child element and locate it. |
ElementLocator<D> |
child(String namespaceURI,
String localName,
int index)
Locate a child element which has given localName in given
namespaceURI at index. |
String |
getAttribute(String localName)
Deprecated. Use attribute(java.lang.String, java.lang.String) |
String |
getAttribute(String namespaceURI,
String localName)
Deprecated. Use attribute(java.lang.String, java.lang.String) |
int |
getChildCount(String localName)
Returns the number of child elements which each has given localName in no name space. |
int |
getChildCount(String namespaceURI,
String localName)
Returns the number of child elements which each has given localName in specified namespaceURI. |
String |
getText()
Deprecated. Use text() |
ElementLocator<D> |
locateChild(String localName,
int index)
Deprecated. Use child(java.lang.String, int) |
ElementLocator<D> |
locateChild(String namespaceURI,
String localName,
int index)
Deprecated. Use child(java.lang.String, java.lang.String, int) |
ElementLocator<D> |
locateParent()
Deprecated. Use parent() |
ElementLocator<D> |
locateRoot()
Deprecated. Use root() |
ElementLocator<D> |
parent()
Locates to the parent element. |
ElementLocator<D> |
remove()
Removes currently located element and locate parent. |
ElementLocator<D> |
removeAttribute(String localName)
Deprecated. Use attribute(String, String, String) with
null value. |
ElementLocator<D> |
removeAttribute(String namespaceURI,
String localName)
Deprecated. Use attribute(String, String, String) with
null value. |
ElementLocator<D> |
removeCurrent()
Removes current element and locate parent. |
ElementLocator<D> |
root()
Locate to the root element. |
ElementLocator<D> |
setAttribute(String localName,
String value)
Deprecated. Use attribute(String, String, String) |
ElementLocator<D> |
setAttribute(String namespaceURI,
String localName,
String value)
Deprecated. Use attribute(String, String, String) |
ElementLocator<D> |
setText(String text)
Deprecated. Use text(java.lang.String) |
String |
text()
Returns text value of currently located element. |
ElementLocator<D> |
text(String text)
Sets the text value of currently located element. |
abstract D |
toDocument(D document)
Prints contents to given document. |
String |
toJSON()
Returns JSON representation of the contents. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public final int getChildCount(String localName)
localName in no name space.
localName - local name
public final int getChildCount(String namespaceURI,
String localName)
localName in specified namespaceURI. En empty
string("") must be used for no(null) name space.
namespaceURI - The name space URI.localName - The local name.
#getCount(String)public final ElementLocator<D> locateRoot()
root()
public final ElementLocator<D> root()
public final ElementLocator<D> locateParent()
parent()
public final ElementLocator<D> parent()
IllegalStateException will
be thrown if there is no parent to locate (on the root).
public final ElementLocator<D> locateChild(String localName,
int index)
child(java.lang.String, int)
localName with no
name space at index.
localName - local nameindex - index
public final ElementLocator<D> locateChild(String namespaceURI,
String localName,
int index)
child(java.lang.String, java.lang.String, int)
localName at index in
namespaceURI.
namespaceURI - element's name space URIlocalName - element's local nameindex - target index to locate
locateChild(String, int)
public final ElementLocator<D> child(String localName,
int index)
localName in no
name space 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<D> child(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 name space URIlocalName - element's local nameindex - target index to locate
child(String, int)public final ElementLocator<D> addChild(String localName)
child(java.lang.String)
localName with
no name space and locate it.
localName - local name
public final ElementLocator<D> addChild(String namespaceURI,
String localName)
child(java.lang.String, java.lang.String)
localName with given
namespaceURI and locate it.
namespaceURI - localName -
public final ElementLocator<D> child(String localName)
localName in no name space.
localName - new child element's local name.
public final ElementLocator<D> child(String namespaceURI,
String localName)
localName in given namespaceURI.
namespaceURI - child element's name space URIlocalName - child element's local name
public final String getText()
text()
public final String text()
public final ElementLocator<D> setText(String text)
text(java.lang.String)
text - text value
public final ElementLocator<D> text(String text)
text - new text value
public final String getAttribute(String localName)
attribute(java.lang.String, java.lang.String)
localName - attribute's local name
public final String getAttribute(String namespaceURI,
String localName)
attribute(java.lang.String, java.lang.String)
name in
space.
namespaceURI - attribute's name space URIlocalName - attribute's local name
public final String attribute(String namespaceURI,
String localName)
namespaceURI - attribute's name space URIlocalName - attribute's local name
public final ElementLocator<D> setAttribute(String localName,
String value)
attribute(String, String, String)
localName - local namevalue - attribute value
public final ElementLocator<D> setAttribute(String namespaceURI,
String localName,
String value)
attribute(String, String, String)
localName in
namespaceURI.
namespaceURI - attribute's name space URIlocalName - attribute's local namevalue - attribute's value
public final ElementLocator<D> attribute(String namespaceURI,
String localName,
String value)
value is null mapped
attribute will be removed.
namespaceURI - attribute's name space URIlocalName - attribute's local namevalue - attribute's value; null for removing attribute
public final ElementLocator<D> removeAttribute(String localName)
attribute(String, String, String) with
null value.
localName with no
namespaceURI.
localName - attribute's local name
public final ElementLocator<D> removeAttribute(String namespaceURI,
String localName)
attribute(String, String, String) with
null value.
localName in
namespaceURI.
namespaceURI - attribute's name space URIlocalName - attribute's local name
public abstract D toDocument(D document)
document.
document - an empty document
documentpublic final ElementLocator<D> removeCurrent()
IllegalStateException will be thrown if this element locator
is already locating the root.
public final ElementLocator<D> remove()
IllegalStateException will be thrown if this locate is
currently locating the root element.
public final String toJSON()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||