Package adams.doc.xhtml
Class AbstractMixedTag
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- adams.doc.xml.AbstractTag
-
- adams.doc.xhtml.AbstractMixedTag
-
- All Implemented Interfaces:
Serializable
,Cloneable
,MutableTreeNode
,TreeNode
public abstract class AbstractMixedTag extends AbstractTag
Ancestor for tags that have nested tags and textual content. The textual content always comes first.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AllowEmpty
whether to output empty tags.protected String
m_Content
the content.-
Fields inherited from class adams.doc.xml.AbstractTag
m_Attributes
-
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
-
Constructor Summary
Constructors Constructor Description AbstractMixedTag(String tag)
Initializes the tag with not content.AbstractMixedTag(String tag, String content)
Initializes the tag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendContent(StringBuilder buffer)
Appends the content of the tag to the buffer.String
getContent()
Returns the string content.boolean
hasContent()
Returns whether there is any "simple", textual content available.void
setContent(String value)
Sets the content of the tag.void
toXML(StringBuilder buffer)
Turns the XML tree into its string representation.-
Methods inherited from class adams.doc.xml.AbstractTag
appendEndTag, appendStartTag, doInsert, doValidate, getAttribute, getIndentation, getTag, hasAttribute, insert, isValidChild, postInsert, preInsert, removeAttribute, setAttribute, toEntities, validate
-
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
-
-
-
-
Field Detail
-
m_AllowEmpty
protected boolean m_AllowEmpty
whether to output empty tags.
-
m_Content
protected String m_Content
the content.
-
-
Constructor Detail
-
AbstractMixedTag
public AbstractMixedTag(String tag)
Initializes the tag with not content.- Parameters:
tag
- the name of the tag
-
-
Method Detail
-
setContent
public void setContent(String value)
Sets the content of the tag.- Parameters:
value
- the string content
-
getContent
public String getContent()
Returns the string content.- Returns:
- the content
-
hasContent
public boolean hasContent()
Returns whether there is any "simple", textual content available.- Specified by:
hasContent
in classAbstractTag
- Returns:
- true if content available
-
appendContent
protected void appendContent(StringBuilder buffer)
Appends the content of the tag to the buffer.- Specified by:
appendContent
in classAbstractTag
- Parameters:
buffer
- the buffer to append the content to
-
toXML
public void toXML(StringBuilder buffer)
Turns the XML tree into its string representation.- Overrides:
toXML
in classAbstractTag
- Parameters:
buffer
- the buffer to append the tag to
-
-