public class XMLElement extends Object
An example XML element might look like this:
<img src="image.gif" width=100 height=150>
In this case img is the tag, and src, width and height are the parameters, with values image.gif, 100 and 150, respectively.
Modifier and Type | Field and Description |
---|---|
private boolean |
end |
private Hashtable |
params |
private String |
tag |
Constructor and Description |
---|
XMLElement()
Construct a new
XMLElement . |
XMLElement(String tag,
boolean end)
Construct a new
XMLElement . |
Modifier and Type | Method and Description |
---|---|
void |
addParam(String name,
String value)
Add a parameter.
|
Enumeration |
getParamNames()
Get parameter names.
|
String |
getParamValue(String name)
Get a parameter value.
|
String |
getTag()
Get the tag.
|
boolean |
isEnd()
Check if this is an end tag.
|
void |
setEnd(boolean end)
Set the end tag flag.
|
void |
setTag(String tag)
Set the tag.
|
String |
toString()
Create a string representatin of the element.
|
public XMLElement(String tag, boolean end)
XMLElement
.tag
- The element's tag.end
- A boolean flag specifying whether this is an end tag. For
example,
is an end tag.public XMLElement()
XMLElement
. The tag is set to the empty
string and the end flag is set to false
.public boolean isEnd()
true
if this is an end tag and false
otherwise.public void setEnd(boolean end)
end
- The new end tag flag value.public void addParam(String name, String value)
name
- The name of the parameter.value
- The value of the parameter (may be null
).public String getParamValue(String name)
name
- The name of the parameter.null
if it's a
valueless parameter.public Enumeration getParamNames()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses