|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.japisoft.fastparser.node.SimpleNode
Simple node.
Field Summary | |
static int |
COMMENT_NODE
|
static int |
TAG_NODE
|
static int |
TEXT_NODE
|
Constructor Summary | |
SimpleNode(int type,
java.lang.String content)
|
|
SimpleNode(SimpleNode parent,
int type,
java.lang.String content)
|
Method Summary | |
void |
addChildNode(SimpleNode node)
Insert a new node |
void |
addNameSpaceDeclaration(java.lang.String prefix,
java.lang.String uri)
Add a declaration for nameSpace |
void |
addNode(MutableNode node)
Reset the children |
SimpleNode |
childAt(int index)
|
int |
childCount()
|
int |
childNodeIndex(SimpleNode node)
|
SimpleNode |
clone(boolean deep)
Clone the current node, include subchild if deep is true |
java.util.Enumeration |
getAllChild()
Get all child |
java.lang.String |
getAttribute(java.lang.String qname)
|
java.lang.String |
getAttribute(java.lang.String qname,
java.lang.String defaultValue)
|
java.lang.String |
getContent()
|
java.lang.String |
getDefaultNamespace()
Return the default namespace declaration |
Document |
getDocument()
|
int |
getLine()
|
java.util.Enumeration |
getNameSpaceDeclaration()
|
java.lang.String |
getNameSpaceDeclarationURI(java.lang.String prefix)
|
java.util.Enumeration |
getNamespaceDeclared()
|
java.lang.String |
getNameSpacePrefix()
|
java.lang.String |
getNameSpaceURI()
|
java.util.Enumeration |
getNodeByCriteria(ValidCriteria criteria,
boolean deep)
Sample of criteria : new OrCriteria( new NodeNameCriteria( "aa" ), new NodeNameCriteria( "bb" ) ) for
returning 'aa' or 'bb' node. |
java.util.Enumeration |
getNodeByName(java.lang.String name,
boolean deep)
|
java.lang.String |
getNodeContent()
|
SimpleNode |
getNodeForXPathLocation(java.lang.String xpath,
boolean resolveAlways)
This feature is limited to a subset of the XPath set : /tag1[ location ]/tag2... |
SimpleNode |
getSimpleParent()
|
int |
getType()
|
java.lang.String |
getViewAttribute(java.lang.String name)
|
java.util.Enumeration |
getViewAttributes()
|
ViewableNode |
getViewChildAt(int i)
|
int |
getViewChildCount()
|
java.lang.String |
getViewContent()
|
java.lang.String |
getXPathLocation()
|
java.lang.String |
getXPathLocation(SimpleNode node)
|
boolean |
hasAttribute(java.lang.String qname)
|
void |
insertChildNode(int index,
SimpleNode node)
Insert a childnode at the index location |
boolean |
isComment()
|
boolean |
isLeaf()
|
boolean |
isNamespaceDeclared(java.lang.String prefix)
Check if this namespace prefix is declared in this node |
boolean |
isRoot()
|
boolean |
isTag()
|
boolean |
isText()
|
boolean |
isViewComment()
|
boolean |
isViewLeaf()
|
boolean |
isViewText()
|
void |
removeChildNode(SimpleNode node)
Remove the following node |
void |
removeNameSpaceDeclaration(java.lang.String prefix)
Remove a nameSpace prefix declaration |
void |
setAttribute(java.lang.String qname,
java.lang.String value)
Set the attribute value. |
void |
setContent(java.lang.String content)
Update the node content, for tag this is the tag name, for text this is the content, for comment this is the content |
void |
setDefaultNamespace(java.lang.String namespaceURI)
Reset the default namespace |
void |
setDocument(Document doc)
Owner document for this node |
void |
setLine(int line)
Set the node line location |
void |
setNameSpace(java.lang.String name,
java.lang.String nameSpaceURI)
Set the namespace |
void |
setNodeAttribute(java.lang.String name,
java.lang.String value)
Reset the node attribute |
void |
setNodeContent(java.lang.String content)
Reset the node content |
void |
setNodeParent(MutableNode node)
Reset the node parent |
void |
setSimpleParent(SimpleNode node)
reset the parent node |
void |
setType(int type)
Update the node type, this is TEXT_NODE, TAG_NODE or COMMENT_NODE |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int TEXT_NODE
public static final int TAG_NODE
public static final int COMMENT_NODE
Constructor Detail |
public SimpleNode(int type, java.lang.String content)
type
- Node type : TEXT_NODE, TAG_NODE or COMMENT_NODEcontent
- the tag contentpublic SimpleNode(SimpleNode parent, int type, java.lang.String content)
type
- Node type : TEXT_NODE, TAG_NODE or COMMENT_NODEcontent
- the tag contentMethod Detail |
public void setLine(int line)
setLine
in interface MutableNode
public int getLine()
public void addNameSpaceDeclaration(java.lang.String prefix, java.lang.String uri)
addNameSpaceDeclaration
in interface MutableNode
prefix
- NameSpace prefixuri
- NameSpace URIpublic void removeNameSpaceDeclaration(java.lang.String prefix)
removeNameSpaceDeclaration
in interface MutableNode
public java.util.Enumeration getNameSpaceDeclaration()
getNameSpaceDeclaration
in interface ViewableNode
public java.lang.String getNameSpaceDeclarationURI(java.lang.String prefix)
getNameSpaceDeclarationURI
in interface ViewableNode
public boolean isNamespaceDeclared(java.lang.String prefix)
MutableNode
isNamespaceDeclared
in interface MutableNode
public java.util.Enumeration getNamespaceDeclared()
getNamespaceDeclared
in interface MutableNode
public void setNameSpace(java.lang.String name, java.lang.String nameSpaceURI)
setNameSpace
in interface MutableNode
name
- Namespace prefixpublic java.lang.String getNameSpacePrefix()
getNameSpacePrefix
in interface MutableNode
public java.lang.String getNameSpaceURI()
getNameSpaceURI
in interface MutableNode
public void setDefaultNamespace(java.lang.String namespaceURI)
setDefaultNamespace
in interface MutableNode
public java.lang.String getDefaultNamespace()
MutableNode
getDefaultNamespace
in interface MutableNode
public void setDocument(Document doc)
public Document getDocument()
public SimpleNode clone(boolean deep)
true
public void setSimpleParent(SimpleNode node)
public SimpleNode getSimpleParent()
public boolean isRoot()
public void setContent(java.lang.String content)
public java.lang.String getContent()
public void setType(int type)
public int getType()
public boolean isText()
public boolean isTag()
public boolean isComment()
public void insertChildNode(int index, SimpleNode node)
public void addChildNode(SimpleNode node)
public void removeChildNode(SimpleNode node)
public int childNodeIndex(SimpleNode node)
public int childCount()
public java.util.Enumeration getAllChild()
public SimpleNode childAt(int index)
public boolean isLeaf()
public void setAttribute(java.lang.String qname, java.lang.String value)
qname
- Qualified name (namespace prefix + local name )value
- value for this attributepublic java.lang.String getAttribute(java.lang.String qname, java.lang.String defaultValue)
public java.util.Enumeration getNodeByName(java.lang.String name, boolean deep)
public java.util.Enumeration getNodeByCriteria(ValidCriteria criteria, boolean deep)
new OrCriteria( new NodeNameCriteria( "aa" ), new NodeNameCriteria( "bb" ) )
for
returning 'aa' or 'bb' node.
public java.lang.String getAttribute(java.lang.String qname)
public boolean hasAttribute(java.lang.String qname)
public java.lang.String toString()
toString
in class java.lang.Object
public void setNodeContent(java.lang.String content)
setNodeContent
in interface MutableNode
public java.lang.String getNodeContent()
getNodeContent
in interface MutableNode
public void setNodeParent(MutableNode node)
setNodeParent
in interface MutableNode
public void setNodeAttribute(java.lang.String name, java.lang.String value)
setNodeAttribute
in interface MutableNode
public void addNode(MutableNode node)
addNode
in interface MutableNode
public java.util.Enumeration getViewAttributes()
getViewAttributes
in interface ViewableNode
public java.lang.String getViewAttribute(java.lang.String name)
getViewAttribute
in interface ViewableNode
public java.lang.String getViewContent()
getViewContent
in interface ViewableNode
public boolean isViewLeaf()
isViewLeaf
in interface ViewableNode
public int getViewChildCount()
getViewChildCount
in interface ViewableNode
public ViewableNode getViewChildAt(int i)
getViewChildAt
in interface ViewableNode
public boolean isViewText()
isViewText
in interface ViewableNode
public boolean isViewComment()
isViewComment
in interface ViewableNode
public SimpleNode getNodeForXPathLocation(java.lang.String xpath, boolean resolveAlways)
public java.lang.String getXPathLocation()
public java.lang.String getXPathLocation(SimpleNode node)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |