|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.simonstl.moe.CoreComponent
|
+--com.simonstl.moe.Mutable
The Mutable class provides a foundation for generic MOE objects. Mutable objects can store text, unordered content, or ordered content, and they can change personality at the flip of a setBasicType(int _type) switch.
The next step for Mutable is creating a toString() which supports calls to a visitor class identified either through setString() or a Java com.simonstl.moe.Mutable property.
version 0.01 is the initial release and contains plenty of bogus placeholder functionality.
| Field Summary | |
protected int |
basicType
|
protected java.lang.String |
textContent
|
| Fields inherited from class com.simonstl.moe.CoreComponent |
annotations, complete, componentType, content, context, name, parent, unorderedContent |
| Fields inherited from interface com.simonstl.moe.CoreComponentI |
ATTRIBUTE, CDATA, CHARS, COMMENT, CONTAINER, DOCTYPE, DOCUMENT, ELEMENT, END_ATTRIBUTE, END_CDATA, END_COMMENT, END_CONTAINER, END_DOCTYPE, END_DOCUMENT, END_ELEMENT, END_NAMESPACE, END_PI, END_PROPERTY, GEN_ENTITY_END, GEN_ENTITY_REF, GEN_ENTITY_START, IG_WHITESPACE, NAMESPACE_DECL, PI, PROPERTY, UNPARSED, VALUE, XML_DECL |
| Constructor Summary | |
Mutable()
|
|
| Method Summary | |
void |
addContent(CoreComponentI newComponent)
Adds content to this component. |
void |
clearContent()
Clears the content for this component. |
java.lang.Object |
clone()
Clone implementation uses MutableComponentI, adds text if necessary. |
int |
getBasicType()
The basic type for Mutable is whatever it's been set to be. |
ComponentListI |
getContent()
Returns the content for this component as a list of nodes. |
java.lang.String |
getTextContent()
Returns the content for this component as a string. |
boolean |
listen(CoreComponentI component)
For now, the Mutable class passes listening to its superclass. |
void |
print()
Prints a representation of the component to STDOUT |
void |
setBasicType(int _type)
Set the basic type of this object, per the constants defined in the CoreComponentI interface. |
void |
setContent(java.lang.String _content)
Sets the content for this component as a string. |
java.lang.String |
toString()
Need to force configurable ref to visitor class |
java.lang.String |
toString(ComponentSetI namespaceContext)
Need to force configurable ref to visitor class |
| Methods inherited from class com.simonstl.moe.CoreComponent |
add, addAll, addUnorderedContent, annotate, clearAll, clearName, clearUnorderedContent, getAllAnnotations, getAnnotations, getIsComplete, getLocalName, getName, getNsURI, getParent, getPrefix, getQName, getTypes, getUnorderedContent, hasAnnotation, hasAnnotationOfType, hasAnnotations, hashCode, removeAllAnnotations, removeAnnotation, setContent, setIsComplete, setLocalName, setName, setNsURI, setParent, setPrefix, setQName, setUnorderedContent, textComponent |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.simonstl.moe.CoreComponentI |
addUnorderedContent, clearAll, clearName, clearUnorderedContent, getIsComplete, getLocalName, getName, getNsURI, getParent, getPrefix, getQName, getUnorderedContent, hashCode, setContent, setIsComplete, setLocalName, setName, setNsURI, setParent, setPrefix, setQName, setUnorderedContent |
| Methods inherited from interface com.simonstl.moe.AnnotableI |
addAll, annotate, getAllAnnotations, getAnnotations, getTypes, hasAnnotation, hasAnnotationOfType, hasAnnotations, removeAllAnnotations, removeAnnotation |
| Field Detail |
protected java.lang.String textContent
protected int basicType
| Constructor Detail |
public Mutable()
| Method Detail |
public void setContent(java.lang.String _content)
CoreComponentIsetContent in interface CoreComponentIsetContent in class CoreComponentpublic void addContent(CoreComponentI newComponent)
CoreComponentIaddContent in interface CoreComponentIaddContent in class CoreComponentpublic void clearContent()
CoreComponentIclearContent in interface CoreComponentIclearContent in class CoreComponentpublic java.lang.String getTextContent()
CoreComponentIgetTextContent in interface CoreComponentIgetTextContent in class CoreComponentpublic ComponentListI getContent()
CoreComponentIgetContent in interface CoreComponentIgetContent in class CoreComponentpublic void print()
CoreComponentIprint in interface CoreComponentIprint in class CoreComponentpublic java.lang.String toString()
toString in interface CoreComponentItoString in class CoreComponentpublic java.lang.String toString(ComponentSetI namespaceContext)
toString in interface CoreComponentIpublic int getBasicType()
getBasicType in interface CoreComponentIgetBasicType in class CoreComponentpublic void setBasicType(int _type)
MutableComponentICoreComponentI interface.
public static final int DOCUMENT=0; public static final int END_DOCUMENT=1; public static final int ELEMENT=2; public static final int END_ELEMENT=3; public static final int ATTRIBUTE=4; public static final int END_ATTRIBUTE=5; public static final int COMMENT=6; public static final int END_COMMENT=7; public static final int PI=8; public static final int END_PI=9; public static final int DOCTYPE=10; public static final int END_DOCTYPE=11; public static final int CDATA=12; public static final int END_CDATA=13; public static final int XML_DECL=18; public static final int NAMESPACE_DECL=20; public static final int END_NAMESPACE=21; public static final int GENERIC=64; public static final int END_GENERIC=65; public static final int GEN_ENTITY_START=130; public static final int GEN_ENTITY_END=131; public static final int GEN_ENTITY_REF=250; public static final int IG_WHITESPACE=252; public static final int CHARS=254; public static final int UNPARSED=258;This permits the creation of classes which change type depending on context.
setBasicType in interface MutableComponentI
public boolean listen(CoreComponentI component)
throws MOEException
listen in interface CoreComponentIlisten in class CoreComponentpublic java.lang.Object clone()
clone in interface CoreComponentIclone in class CoreComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||