Package adams.doc.xml
Class AbstractSimpleTag
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- adams.doc.xml.AbstractTag
-
- adams.doc.xml.AbstractSimpleTag
-
- All Implemented Interfaces:
Serializable
,Cloneable
,MutableTreeNode
,TreeNode
- Direct Known Subclasses:
Anchor
,Code
,DefaultSimpleTag
,Paragraph
,Pre
,ProgramListing
,Screen
,Title
,Title
public abstract class AbstractSimpleTag extends AbstractTag
Ancestor for tags that have no children (only string content).- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Content
the content.protected boolean
m_ConvertEntities
whether to convert HTML entities.-
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 AbstractSimpleTag(String tag)
Initializes the tag.AbstractSimpleTag(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 element to the buffer.boolean
getAllowsChildren()
Returns true if this node is allowed to have children.String
getContent()
Returns the string content.boolean
getConvertEntities()
Returns whether HTML entities get converted or not.boolean
hasContent()
Checks whether there is any content to append.void
setAllowsChildren(boolean allows)
Does not allow children.void
setContent(String value)
Sets the content of the tag.void
setConvertEntities(boolean value)
Sets whether to convert HTML entities or not.-
Methods inherited from class adams.doc.xml.AbstractTag
appendEndTag, appendStartTag, doInsert, doValidate, getAttribute, getIndentation, getTag, hasAttribute, insert, isValidChild, postInsert, preInsert, removeAttribute, setAttribute, toEntities, toXML, validate
-
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, 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, setParent, setUserObject, toString
-
-
-
-
Field Detail
-
m_Content
protected String m_Content
the content.
-
m_ConvertEntities
protected boolean m_ConvertEntities
whether to convert HTML entities.
-
-
Method Detail
-
setAllowsChildren
public void setAllowsChildren(boolean allows)
Does not allow children.- Overrides:
setAllowsChildren
in classDefaultMutableTreeNode
- Parameters:
allows
- ignored, always false
-
getAllowsChildren
public boolean getAllowsChildren()
Returns true if this node is allowed to have children.- Specified by:
getAllowsChildren
in interfaceTreeNode
- Overrides:
getAllowsChildren
in classDefaultMutableTreeNode
- Returns:
- always false
-
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()
Description copied from class:AbstractTag
Checks whether there is any content to append.- Specified by:
hasContent
in classAbstractTag
- Returns:
- true if content available
-
setConvertEntities
public void setConvertEntities(boolean value)
Sets whether to convert HTML entities or not.
CAUTION: caller must ensure that content is XHTML compliant if this is turned off!- Parameters:
value
- if true then HTML entities get converted
-
getConvertEntities
public boolean getConvertEntities()
Returns whether HTML entities get converted or not.- Returns:
- true if HTML entities get converted
-
appendContent
protected void appendContent(StringBuilder buffer)
Appends the content of the element to the buffer.- Specified by:
appendContent
in classAbstractTag
- Parameters:
buffer
- the buffer to append the content to
-
-