|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itextpdf.tool.xml.Tag
public class Tag
Represents an encountered tag.
| Constructor Summary | |
|---|---|
Tag(String tag)
|
|
Tag(String tag,
Map<String,String> attr)
Construct a tag. |
|
Tag(String tag,
Map<String,String> attr,
Map<String,String> css,
String ns)
|
|
Tag(String tag,
Map<String,String> attr,
String ns)
Create a new tag object. |
|
Tag(String tag,
String ns)
Create a new tag object. |
|
| Method Summary | |
|---|---|
void |
addChild(Tag t)
Add a child tag to this tag. |
boolean |
compareTag(Tag t)
Compare this tag with t for namespace and name equality. |
Map<String,String> |
getAttributes()
|
Tag |
getChild(String name,
String ns)
Finds the first child that matches the given name and namespace. |
Tag |
getChild(String name,
String ns,
boolean recursive)
Finds the first child that matches the given name and ns. |
List<Tag> |
getChildren()
Returns all children of this tag. |
List<Tag> |
getChildren(String name)
Returns all children of this tag with the given name. |
Map<String,String> |
getCSS()
Returns a Map of css property, value. |
String |
getName()
Returns the name of the tag. (Actually the same as getTag method, but after using XMLWorker for a while we caught ourself always trying to call Tag#getName() instead of Tag#getTag()) |
String |
getNameSpace()
|
Tag |
getParent()
Returns the parent tag for this tag. |
String |
getTag()
Deprecated. marked as deprecated in favor for getName, we won't remove it yet. |
boolean |
hasChild(String name,
String ns)
Check if this tag has a child with the given name and namespace. |
boolean |
hasChild(String name,
String ns,
boolean recursive)
Check if this tag has a child with the given name and namespace. |
boolean |
hasChildren()
Whether or not this tag has children. |
boolean |
hasParent()
Whether or not this tag has a parent. |
Iterator<Tag> |
iterator()
|
void |
setCSS(Map<String,String> css)
Set the css map. |
void |
setParent(Tag parent)
Set the tags parent tag. |
String |
toString()
Print the tag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Tag(String tag,
Map<String,String> attr)
tag - the tag nameattr - the attributes in the tagpublic Tag(String tag)
tag - the tag name
public Tag(String tag,
Map<String,String> attr,
Map<String,String> css,
String ns)
tag - the tag nameattr - the attributescss - a map with CSSns - the namespace
public Tag(String tag,
Map<String,String> attr,
String ns)
tag - the tag nameattr - the attributesns - the namespace
public Tag(String tag,
String ns)
tag - the name of the tagns - the namespace of the tag (do not set null, set an empty String)| Method Detail |
|---|
public void setParent(Tag parent)
parent - the parent tag of this tagpublic Tag getParent()
@Deprecated public String getTag()
public Map<String,String> getCSS()
public void setCSS(Map<String,String> css)
null is given the css is cleared.
css - set css propertiespublic Map<String,String> getAttributes()
public void addChild(Tag t)
t - the tagpublic List<Tag> getChildren()
public List<Tag> getChildren(String name)
name - the name of the tags to look for
public String getNameSpace()
public String toString()
toString in class Objectpublic boolean compareTag(Tag t)
t - the tag to compare with
public Iterator<Tag> iterator()
iterator in interface Iterable<Tag>
public Tag getChild(String name,
String ns)
name - the name of the tagns - the namespace
public Tag getChild(String name,
String ns,
boolean recursive)
name - name of the tagns - the namespacerecursive - true if the tree should be fully inwards inspected.
public boolean hasChildren()
public boolean hasParent()
null
public boolean hasChild(String name,
String ns)
name - the name of the tag to look forns - the namespace (if no namespace, set an empty String)
public boolean hasChild(String name,
String ns,
boolean recursive)
name - the name of the tag to look forns - the namespace (if no namespace, set an empty String)recursive - true if children's children children children ... should be inspected too.
public String getName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||