Package net.cnri.simplexml
Class XTag
java.lang.Object
net.cnri.simplexml.XTag
This represents an SGML/XML tag. This can either have a set of
sub-tags, or have a single value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
getAttribute
(String attrName) getAttribute
(String attrName, String defaultVal) boolean
getBoolAttribute
(String attrName, boolean defaultVal) boolean
getBoolSubTag
(String tagName, boolean defaultVal) boolean
double
getDoubleAttribute
(String attrName, double defaultVal) double
getDoubleSubTag
(String tagName, double defaultVal) double
int
getIntAttribute
(String attrName, int defaultVal) int
getIntSubTag
(String tagName, int defaultVal) int
long
getLongAttribute
(String attrName, long defaultVal) long
getLongSubTag
(String tagName, long defaultVal) long
getName()
getStrAttribute
(String tagName, String defaultVal) String[]
getStrListSubTag
(String tagName) getStrSubTag
(String tagName, String defaultVal) getSubTag
(int i) int
getUrlSubTag
(String tagName, URL defaultVal) getValue()
boolean
boolean
removeSubTag
(int index) boolean
removeSubTag
(XTag subtag) Remove the given subtag from the list of subtags.void
setAttribute
(String name, boolean val) void
setAttribute
(String name, int val) void
setAttribute
(String name, String val) void
setSuppressNewLine
(boolean suppressNewLine) void
toString()
void
write
(OutputStream out) void
void
-
Constructor Details
-
XTag
-
XTag
-
-
Method Details
-
shallowCloneTag
-
isContainer
public boolean isContainer() -
addSubTag
-
getSubTagCount
public int getSubTagCount() -
getSubTag
-
getSubTag
-
removeSubTag
-
getSubTags
-
removeSubTag
Remove the given subtag from the list of subtags. If the given tag was in the list of subtags, return true. Otherwise this returns false. -
hasSubTag
-
setSuppressNewLine
public void setSuppressNewLine(boolean suppressNewLine) -
getName
-
getValue
-
getStrValue
-
getIntValue
- Throws:
Exception
-
getLongValue
- Throws:
Exception
-
getDoubleValue
- Throws:
Exception
-
getUrlValue
- Throws:
Exception
-
getBoolValue
public boolean getBoolValue() -
getBoolSubTag
-
getStrSubTag
-
getIntSubTag
-
getLongSubTag
-
getDoubleSubTag
-
getUrlSubTag
-
getStrListSubTag
-
setValue
-
setAttribute
-
setAttribute
-
setAttribute
-
getAttribute
-
getAttribute
-
getBoolAttribute
-
getStrAttribute
-
getIntAttribute
-
getLongAttribute
-
getDoubleAttribute
-
getAttributes
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
toString
-