|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcox.jmatt.java.MathTools.markup.Tag
cox.jmatt.java.MathTools.markup.html.BaseHTag
public abstract class BaseHTag
This is the abstract superclass for all HTML tag classes. Since HTML's structure is incredibly flexible (and possibly convoluted!) there are no 'subclass
chains' involved with this package. Instead each tag class implements the behavior that is absolutely required for that tag. Proper structure is up to the
user! The only intelligence applied innately is whether the tag should be added to a document's <head> or <body> and the TagKeys enum
handles that.
As with the SVG package, HTML uses CSS (only!) to provide styling and presentation information. The tacit assumption is that an external stylesheet is
provided so nothing analogous to the StylePen
class is used here.
Since most of the tags represented in this package may have content rudimentary content handling is supplied. Content is held in an internal buffer until needed and returned as a String when that happens. No XML-escaping is done so that must be handled manually!
Nested Class Summary | |
---|---|
static class |
BaseHTag.TagKeys
This enum holds information and default values for the various tag classes, all of which subclass BaseHTag . |
Field Summary |
---|
Fields inherited from class cox.jmatt.java.MathTools.markup.Tag |
---|
myTagName |
Constructor Summary | |
---|---|
protected |
BaseHTag(BaseHTag.TagKeys pKey)
Standard constructor for building HTML tag classes. |
Method Summary | |
---|---|
protected void |
_addTag(BaseHTag pTag)
Add a tag to the content. |
protected java.lang.String |
_content()
Return the contents of the internal StringBuffer . |
protected void |
_enableCopy()
This method enables tag copying. |
protected void |
_setContent(java.lang.String pContent)
Handle the internal buffer. |
void |
addCDATA(java.lang.String pData)
Add non-null, non-blank content enclosed in a CDATA block. |
void |
addContent(java.lang.String pContent)
Add content to the current tag. |
java.lang.String |
getID()
Fetch a copy of the tag's ID if one is set. |
java.lang.String |
getRawContent()
Fetch the content of the tag, unaltered and unedited. |
java.lang.String |
getTagKey()
Return the String name of this tag's TagKeys constant. |
java.lang.String |
getTagName()
Return the current tag name. |
boolean |
isInBody()
Determine where to add this tag to the HTML document: true for body, false for head. |
void |
setClicked(java.lang.String pClickHandler)
This method is provided for (external!!) script interactions. |
void |
setCSS(java.lang.String pRuleName)
Set or clear the (CSS) 'class=' attribute for the tag. |
void |
setName(java.lang.String pName)
This method sets the tag's 'name=' attribute and not the name of the tag itself! Since is is common among HTML tags it is handled here. |
void |
setStyle(java.lang.String pStyle)
Set or clear the tag's (inline CSS) 'style=' attribute. |
Methods inherited from class cox.jmatt.java.MathTools.markup.Tag |
---|
_addAttribute, _addAttributes, _addNAttribute, _asBoolean, _asDouble, _asInt, _attributes, _clampNAttribute, _clampNAttribute, _fixKey, _setEnableXMLTag, badPizza, closeTag, configureTag, configureTagFromGlobalPizza, makeTag, openTag, reset, setID, toString, validString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BaseHTag(BaseHTag.TagKeys pKey)
Method Detail |
---|
public boolean isInBody()
TagKeys
constant.
protected final void _enableCopy()
public java.lang.String getTagKey()
TagKeys
constant.
public java.lang.String getTagName()
public java.lang.String getID()
public void setName(java.lang.String pName)
public void setCSS(java.lang.String pRuleName)
public void setStyle(java.lang.String pStyle)
public void setClicked(java.lang.String pClickHandler)
public java.lang.String getRawContent()
_content()
method may not dump their content via this method. Use with care!
protected java.lang.String _content()
StringBuffer
. May be blank but will never be null.
_content
in class Tag
protected void _setContent(java.lang.String pContent)
_setContent
in class Tag
public void addContent(java.lang.String pContent)
public void addCDATA(java.lang.String pData)
addContent()
.
protected void _addTag(BaseHTag pTag)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |