|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.simonstl.moe.CoreComponent
The CoreComponent class implements the bare minimum of functionality needed for objects to work with MOE.
Note that while this class implements the AnnotableI
interface, it delegates all of the work to an Annotations
object.
Similarly, all of the processing of the NamingI
interface is delegated to a Name
object.
version 0.01 is the initial release and contains plenty of bogus placeholder functionality.
Field Summary | |
protected AnnotableI |
annotations
contains the annotations - often type information - for this component. |
protected boolean |
complete
indicates whether the component contains all of its child parts. |
protected int |
componentType
an int identifying the base type of this component. |
protected ComponentList |
content
contains the ordered content (typically elements) for the component. |
protected CoreComponent |
context
used by listen(). |
protected Name |
name
contains the name information for component (if any) |
protected CoreComponentI |
parent
identifies the parent of this component. |
protected ComponentSet |
unorderedContent
contains the unordered content (typically attributes) for the component. |
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 | |
CoreComponent()
|
Method Summary | |
protected CoreComponentI |
add(CoreComponentI component,
CoreComponentI context)
|
void |
addAll(java.util.Map otherAnnotations)
|
void |
addContent(CoreComponentI newComponent)
Adds content to this component. |
void |
addUnorderedContent(CoreComponentI newComponent)
Adds an unordered component (usually an attribute) to a component. |
void |
annotate(java.lang.Object annotationType,
java.lang.Object annotation)
The annotate() method allows developers to add different kinds of annotation information to components. |
void |
clearAll()
Clears the name, namespace information, and content for this component. |
void |
clearContent()
Clears the content for this component. |
void |
clearName()
Clears the name and namespace information for this component. |
void |
clearUnorderedContent()
Clears the unordered content (usually attributes) for this component. |
java.lang.Object |
clone()
Non-clone implementation needs replacement. |
java.util.Map |
getAllAnnotations()
This method allows developers to retrieve all annotations at once. |
java.lang.Object |
getAnnotations(java.lang.Object ofAnnotationType)
This method allows developers to retrieve annotations of one particular type. |
abstract int |
getBasicType()
CoreComponent has no basic type - subclasses MUST provide one. |
ComponentListI |
getContent()
Returns the content for this component as a list of nodes. |
boolean |
getIsComplete()
Returns whether this object is complete (i.e., an element has ended). |
java.lang.String |
getLocalName()
Returns the local name for the component |
NamingI |
getName()
Returns the name object for the component. |
java.lang.String |
getNsURI()
Returns the URI reference value for the namespace. |
CoreComponentI |
getParent()
Returns the parent for the component. |
java.lang.String |
getPrefix()
Returns the prefix used to represent the namespace URI reference for this component. |
java.lang.String |
getQName()
Returns the Qualified Name (QName) for the component. |
java.lang.String |
getTextContent()
Returns the content for this component as a string. |
java.util.Set |
getTypes()
Returns a Set containing the types of all annotations stored in this object |
ComponentSetI |
getUnorderedContent()
Returns the unordered content for this component. |
boolean |
hasAnnotation(java.lang.Object annotation)
Indicates whether the provided object is stored as an annotation (of any type) |
boolean |
hasAnnotationOfType(java.lang.Object ofAnnotationType)
Indicates whether there are any annotations of the given type. |
boolean |
hasAnnotations()
|
int |
hashCode()
The hashCode() method uses nsURI+">"+localName to generate an int. |
boolean |
listen(CoreComponentI component)
Accepts new events. |
void |
print()
Prints a representation of the component to STDOUT |
void |
removeAllAnnotations()
This method allows developers to remove all annotations at once. |
void |
removeAnnotation(java.lang.Object ofAnnotationType)
This method allows developers to remove a single annotation. |
void |
setContent(ComponentListI _content)
Sets the content for this component as a list of nodes. |
void |
setContent(java.lang.String _content)
Sets the content for this component as a string. |
void |
setIsComplete(boolean _complete)
Sets whether this object is complete (i.e., an element has ended). |
void |
setLocalName(java.lang.String _localName)
Accepts a string which will serve as the local name for this component. |
void |
setName(NamingI _name)
Sets the name object for the component. |
void |
setNsURI(java.lang.String _nsURI)
Accepts a URI reference value which is used as the namespace for the component. |
void |
setParent(CoreComponentI _parent)
Sets the parent object for the component. |
void |
setPrefix(java.lang.String _prefix)
Accepts a string which serves as the prefix for this component. |
void |
setQName(java.lang.String QName)
Sets the Qualified Name (QName) for the component. |
void |
setUnorderedContent(ComponentSetI newContent)
Sets the unordered content for this component. |
protected CoreComponentI |
textComponent()
|
abstract java.lang.String |
toString()
Returns a representation of the component as a String. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.simonstl.moe.CoreComponentI |
toString |
Field Detail |
protected Name name
protected ComponentList content
protected ComponentSet unorderedContent
protected boolean complete
protected int componentType
protected AnnotableI annotations
protected CoreComponentI parent
protected CoreComponent context
Constructor Detail |
public CoreComponent()
Method Detail |
public int hashCode()
hashCode
in interface CoreComponentI
hashCode
in class java.lang.Object
public void setNsURI(java.lang.String _nsURI)
CoreComponentI
setNsURI
in interface CoreComponentI
public java.lang.String getNsURI()
CoreComponentI
getNsURI
in interface CoreComponentI
public void setLocalName(java.lang.String _localName)
CoreComponentI
setLocalName
in interface CoreComponentI
public java.lang.String getLocalName()
CoreComponentI
getLocalName
in interface CoreComponentI
public void setPrefix(java.lang.String _prefix)
CoreComponentI
setPrefix
in interface CoreComponentI
public java.lang.String getPrefix()
CoreComponentI
getPrefix
in interface CoreComponentI
public java.lang.String getQName()
getQName
in interface CoreComponentI
public void setQName(java.lang.String QName)
setQName
in interface CoreComponentI
public NamingI getName()
getName
in interface CoreComponentI
public void setName(NamingI _name)
setName
in interface CoreComponentI
public CoreComponentI getParent()
CoreComponentI
getParent
in interface CoreComponentI
public void setParent(CoreComponentI _parent)
CoreComponentI
setParent
in interface CoreComponentI
public void setContent(java.lang.String _content)
CoreComponentI
setContent
in interface CoreComponentI
public void setContent(ComponentListI _content)
CoreComponentI
setContent
in interface CoreComponentI
public void addContent(CoreComponentI newComponent)
CoreComponentI
addContent
in interface CoreComponentI
public void clearContent()
CoreComponentI
clearContent
in interface CoreComponentI
public java.lang.String getTextContent()
CoreComponentI
getTextContent
in interface CoreComponentI
public ComponentListI getContent()
CoreComponentI
getContent
in interface CoreComponentI
public void addUnorderedContent(CoreComponentI newComponent)
CoreComponentI
addUnorderedContent
in interface CoreComponentI
public void clearUnorderedContent()
CoreComponentI
clearUnorderedContent
in interface CoreComponentI
public ComponentSetI getUnorderedContent()
CoreComponentI
getUnorderedContent
in interface CoreComponentI
public void setUnorderedContent(ComponentSetI newContent)
CoreComponentI
setUnorderedContent
in interface CoreComponentI
public void clearName()
CoreComponentI
clearName
in interface CoreComponentI
public void clearAll()
CoreComponentI
clearAll
in interface CoreComponentI
public void print()
CoreComponentI
print
in interface CoreComponentI
public abstract java.lang.String toString()
CoreComponentI
toString
in interface CoreComponentI
toString
in class java.lang.Object
public void setIsComplete(boolean _complete)
CoreComponentI
setIsComplete
in interface CoreComponentI
public boolean getIsComplete()
CoreComponentI
getIsComplete
in interface CoreComponentI
public abstract int getBasicType()
getBasicType
in interface CoreComponentI
public boolean listen(CoreComponentI component) throws MOEException
CoreComponentI
listen
in interface CoreComponentI
public java.lang.Object clone()
clone
in interface CoreComponentI
clone
in class java.lang.Object
public void annotate(java.lang.Object annotationType, java.lang.Object annotation)
AnnotableI
annotate
in interface AnnotableI
public void addAll(java.util.Map otherAnnotations)
addAll
in interface AnnotableI
public java.lang.Object getAnnotations(java.lang.Object ofAnnotationType)
AnnotableI
getAnnotations
in interface AnnotableI
public java.util.Map getAllAnnotations()
AnnotableI
getAllAnnotations
in interface AnnotableI
public boolean hasAnnotationOfType(java.lang.Object ofAnnotationType)
AnnotableI
hasAnnotationOfType
in interface AnnotableI
public boolean hasAnnotation(java.lang.Object annotation)
AnnotableI
hasAnnotation
in interface AnnotableI
public boolean hasAnnotations()
hasAnnotations
in interface AnnotableI
public java.util.Set getTypes()
AnnotableI
getTypes
in interface AnnotableI
public void removeAnnotation(java.lang.Object ofAnnotationType)
AnnotableI
removeAnnotation
in interface AnnotableI
public void removeAllAnnotations()
AnnotableI
removeAllAnnotations
in interface AnnotableI
protected CoreComponentI add(CoreComponentI component, CoreComponentI context) throws MOEException
protected CoreComponentI textComponent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |