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 TypeMethodDescriptionvoidgetAttribute(String attrName) getAttribute(String attrName, String defaultVal) booleangetBoolAttribute(String attrName, boolean defaultVal) booleangetBoolSubTag(String tagName, boolean defaultVal) booleandoublegetDoubleAttribute(String attrName, double defaultVal) doublegetDoubleSubTag(String tagName, double defaultVal) doubleintgetIntAttribute(String attrName, int defaultVal) intgetIntSubTag(String tagName, int defaultVal) intlonggetLongAttribute(String attrName, long defaultVal) longgetLongSubTag(String tagName, long defaultVal) longgetName()getStrAttribute(String tagName, String defaultVal) String[]getStrListSubTag(String tagName) getStrSubTag(String tagName, String defaultVal) getSubTag(int i) intgetUrlSubTag(String tagName, URL defaultVal) getValue()booleanbooleanremoveSubTag(int index) booleanremoveSubTag(XTag subtag) Remove the given subtag from the list of subtags.voidsetAttribute(String name, boolean val) voidsetAttribute(String name, int val) voidsetAttribute(String name, String val) voidsetSuppressNewLine(boolean suppressNewLine) voidtoString()voidwrite(OutputStream out) voidvoid
-
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
-