|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.datatypes.AbstractListAware
org.millscript.millscript.datatypes.XmlElement
public final class XmlElement
XmlElement is a lightweight objects that plays the role of an XML element. It is deliberately NOT compatible with the W3C DOM interface. That interface includes "back-pointers" from children to their parents -- a terrible design error that is slowly but surely being recognized as such.
| Constructor Summary | |
|---|---|
XmlElement(org.millscript.commons.xml.api.Name n,
org.millscript.commons.xml.api.Attributes a,
java.lang.Object[] c)
Constructs a new XML element with the specified name, attributes and children. |
|
| Method Summary | |
|---|---|
org.millscript.commons.util.IList |
asList()
Returns this object as a List. |
java.lang.Object |
asOriginal(org.millscript.commons.util.IList<?> x)
Returns a new object wrapping the supplied List. |
java.lang.Object |
get(int n)
Returns the child at the specified position in this XML element. |
org.millscript.commons.xml.api.Attributes |
getAttributes()
Returns a map containing all the elements attribute names and values. |
java.lang.Object[] |
getChildren()
Returns an array of all this elements children. |
org.millscript.commons.xml.api.Name |
getName()
Returns this elements Name. |
void |
render(Renderer r)
This method is called to render the implementing object to the specified renderer. |
boolean |
sameAs(java.lang.Object x)
Compares the specified object with this object, to see if they are the same type. |
int |
size()
Returns the number of children this XML element has. |
java.lang.String |
tagName()
Returns the name of the XML element. |
Atom |
tagWord()
Returns the name of this XML element as an Atom. |
java.lang.String |
toString()
|
| Methods inherited from class org.millscript.millscript.datatypes.AbstractListAware |
|---|
asMap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XmlElement(org.millscript.commons.xml.api.Name n,
org.millscript.commons.xml.api.Attributes a,
java.lang.Object[] c)
n - the XML elements namea - the XML elements attributesc - the XML elements children| Method Detail |
|---|
public org.millscript.commons.util.IList asList()
ListAware
asList in interface ListAwareListAware.asList()public java.lang.Object asOriginal(org.millscript.commons.util.IList<?> x)
ListAware
asOriginal in interface ListAwarex - a List to wrap in a copy of this object.
ListAware.asOriginal(org.millscript.commons.util.IList)public java.lang.Object get(int n)
n - the position of the required child
public org.millscript.commons.xml.api.Attributes getAttributes()
public java.lang.Object[] getChildren()
public org.millscript.commons.xml.api.Name getName()
Name
public void render(Renderer r)
throws java.io.IOException
RenderableIf the implementing object is not a core part of MillScript you may need to query what type of renderer it is, so you can further customise your rendering as appropriate.
render in interface Renderabler - the renderer to render this object with
java.io.IOException - thrown if an IO problem occursRenderable.render(Renderer)public boolean sameAs(java.lang.Object x)
ListAware
sameAs in interface ListAwarex - Object to be compared for type with this object
true if the specified object is the same type as
this objectListAware.sameAs(java.lang.Object)public int size()
public java.lang.String tagName()
public Atom tagWord()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||