| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
Object |
getLastMarginBottom() |
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 |
setLastMarginBottom(Object lastMarginBottom) |
void |
setParent(Tag parent)
Set the tags parent tag.
|
String |
toString()
Print the tag
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic Tag(String tag, Map<String,String> attr)
tag - the tag nameattr - the attributes in the tagpublic Tag(String tag)
tag - the tag namepublic Tag(String tag, Map<String,String> attr, Map<String,String> css, String ns)
tag - the tag nameattr - the attributescss - a map with CSSns - the namespacepublic Tag(String tag, Map<String,String> attr, String ns)
tag - the tag nameattr - the attributesns - the namespacepublic 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 void addChild(Tag t)
t - the tagpublic List<Tag> getChildren()
public List<Tag> getChildren(String name)
name - the name of the tags to look forpublic String getNameSpace()
public boolean compareTag(Tag t)
t - the tag to compare withpublic Tag getChild(String name, String ns)
name - the name of the tagns - the namespacepublic 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()
nullpublic 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()
public Object getLastMarginBottom()
public void setLastMarginBottom(Object lastMarginBottom)
Copyright © 2020. All rights reserved.