|
|||||||||
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.SimpleTagImpl
public class SimpleTagImpl
This class provides a concrete implementation of the Tag
class. Besides that it serves to provide MathTools with a simple way to produce proper
XML tags of any necessary complexity. It is similar to MathXML.wrapTag()
but with many more features! SimpleTagImpl
acts as a container
for tag information; it maintains an internal StringBuffer for content and, of course, the Hashtable for attributes. In addition to this it provides instance
methods to shadow each of Tag
's static factory methods.
This class can be used to create any XML tags, up to full documents. Methods that operate on this instance return a self-reference to allow method chaining
and tags are easy to create and edit. SimpleTagImpl
is not really meant to be subclassed. It is primarily meant for low-level XML tag construction.
This might not be the easiest way to do things, but it is easier than trying to slap together Strings manually. It is best used for quick construction of one
or two highly-specialized tags. For stricter, more frequent, or greater needs it is probably better to create a markup language package using Tag
and StyleInfo
.
Field Summary |
---|
Fields inherited from class cox.jmatt.java.MathTools.markup.Tag |
---|
myTagName |
Constructor Summary | |
---|---|
SimpleTagImpl()
Standard constructor used for scripting or other purposes. |
|
SimpleTagImpl(java.lang.String pTagName)
Constructor to create a named tag. |
Method Summary | |
---|---|
protected java.lang.String |
_content()
Fetch the content of the internal StringBuffer. |
protected void |
_setContent(java.lang.String pContent)
Set or clear the current tag contents. |
SimpleTagImpl |
addContent(java.lang.String pContent)
Add content to what's currently there. |
java.lang.String |
closeNewTag(java.lang.String pTagName)
Instance form of Tag.closeTag() . |
static SimpleStyleImpl |
createStyleImpl()
Fetch a SimpleStyleImpl if needed. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getAttributes()
Return a copy of the current attributes. |
java.lang.String |
getContent()
Fetch the current content. |
static SimpleTagImpl |
getNewInstance()
Instance method to create a new blank SimpleTagImpl instance. |
SimpleTagImpl |
getNewInstance(java.lang.String pName)
Instance method to create a new named SimpleTagImpl instance. |
SimpleStyleImpl |
getNewStyleImpl()
Create and return a SimpleStyleImpl |
boolean |
isValidString(java.lang.String pStr)
Instance form of Tag.validString() . |
java.lang.String |
makeNewTag(java.lang.String pTagName,
java.util.Hashtable<java.lang.String,java.lang.String> pAttributes,
java.lang.String pContent)
Instance form of Tag.makeTag() . |
static SimpleTagImpl |
newInstance()
Static method to create a new blank SimpleTagImpl instance. |
static SimpleTagImpl |
newInstance(java.lang.String pName)
Static method to create a new named SimpleTagImpl instance. |
java.lang.String |
openNewTag(java.lang.String pTagName,
java.util.Hashtable<java.lang.String,java.lang.String> pAttributes,
boolean isEmpty)
Instance form of Tag.openTag() . |
SimpleTagImpl |
setAttribute(java.lang.String pKey,
java.lang.String pValue)
Set or remove an attribute value. |
SimpleTagImpl |
setContent(java.lang.String pContent)
Send a String to the _setContent() method. |
SimpleTagImpl |
setTagName(java.lang.String pTagName)
This method can change the tag name, just in case such a thing is needed. |
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 |
---|
public SimpleTagImpl()
public SimpleTagImpl(java.lang.String pTagName)
Method Detail |
---|
public static SimpleStyleImpl createStyleImpl()
SimpleStyleImpl
if needed.
public static SimpleTagImpl newInstance(java.lang.String pName)
SimpleTagImpl
instance.
public SimpleTagImpl getNewInstance(java.lang.String pName)
SimpleTagImpl
instance.
public static SimpleTagImpl newInstance()
SimpleTagImpl
instance.
public static SimpleTagImpl getNewInstance()
SimpleTagImpl
instance.
public java.lang.String openNewTag(java.lang.String pTagName, java.util.Hashtable<java.lang.String,java.lang.String> pAttributes, boolean isEmpty)
Tag.openTag()
. Arguments are per that method.
public java.lang.String closeNewTag(java.lang.String pTagName)
Tag.closeTag()
. Arguments are per that method. (This method name is a bit odd but it is consistent!)
public java.lang.String makeNewTag(java.lang.String pTagName, java.util.Hashtable<java.lang.String,java.lang.String> pAttributes, java.lang.String pContent)
Tag.makeTag()
. Arguments are per that method.
public boolean isValidString(java.lang.String pStr)
Tag.validString()
. Just because it's there.
public SimpleStyleImpl getNewStyleImpl()
SimpleStyleImpl
public SimpleTagImpl setTagName(java.lang.String pTagName)
protected java.lang.String _content()
_content
in class Tag
public java.lang.String getContent()
protected void _setContent(java.lang.String pContent)
_setContent
in class Tag
public SimpleTagImpl setContent(java.lang.String pContent)
_setContent()
method.
public SimpleTagImpl addContent(java.lang.String pContent)
public SimpleTagImpl setAttribute(java.lang.String pKey, java.lang.String pValue)
public java.util.Hashtable<java.lang.String,java.lang.String> getAttributes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |