|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.persistence.XMLStreamWriter
Class XMLStreamWriter writes an AttributeList
object to an XML file. This list may contain AttributeList,
AttributeSet and Attributes instances. All
Constraint objects that have been assigned to the objects
will be stored in the XML file as well.
XML File Structure:
- LIST:
<list name=NAME>
(LIST | SET | ATTRIBUTE)*
(constraint)+
</list>
NAME: Name of list (in a set this has to be unique)
- SET:
<set name=NAME>
(SET | ATTRIBUTE)*
</set>
NAME: String name of this set (in a set this has to be unique)
- ATTRIBUTE:
<attribute name=NAME type=TYPE value=VALUE>
(CONSTRAINT)+
</attribute>
NAME: String name of this attribute (in a set this has to be unique)
TYPE: Full classname of the value of this attribute
VALUE: Initial value of the instance of this valueobject
- CONSTRAINT:
<constraint>
<![cdata[(EXPR)]]>
</constraint>
(Instead of the cdata-Part a text node is allowed, too:
<constraint>value==0</constraint>
But concerning the special characters (">", ...) it should not be used.)
- EXPR:
String expression that can be parsed by a ConstraintParser.
Structure of AttributeList:
- LIST:
AttributeList, containing attributes of following types:
(LIST-ATTRIBUTE | SET-ATTRIBUTE | ATTRIBUTE)*
May contain a valid constraint of any type.
- LIST-ATTRIBUTE:
Attribute with name and value.
In a set the name has to be unique.
The name will be stored as name of the list.
The value is of type AttributeList.
Must not contain a Constraint, as this is ignored when writing to XML.
Instead the Constraint should be assigned to the AttributeList
directly. The list itself may contain the following attributes:
(LIST-ATTRIBUTE | SET-ATTRIBUTE | ATTRIBUTE)*
- SET-ATTRIBUTE:
Attribute with name and value.
In a set the name has to be unique.
The name will be stored as name of the set. The value is of type AttributeSet.
Must not contain a Constraint, as this is ignored when writing to XML.
Instead the Constraint should be assigned to the AttributeSet directly.
The set itself may contain the following attributes:
(SET-ATTRIBUTE | ATTRIBUTE)*
- ATTRIBUTE:
Any Attribute with a name and value. In a set the name has to be unique.
The value may be of any type that can be recreated/stored by
parseToObject() (or storeToString() of XMLWriter).
| Constructor Summary | |
XMLStreamWriter(java.io.OutputStream outStream)
Creates a new XMLStreamWriter based on the given
OutputStream. |
|
XMLStreamWriter(java.io.OutputStream outStream,
boolean omitXMLHeader)
Creates a new XMLStreamWriter based on the given OutputStream.
|
|
| Method Summary | |
void |
write(AttributeList attributeList)
This method writes the information given by an AttributeList
to a data storage. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XMLStreamWriter(java.io.OutputStream outStream)
XMLStreamWriter based on the given
OutputStream.
outStream - the OutputStream that should be used to
write out the document.
public XMLStreamWriter(java.io.OutputStream outStream,
boolean omitXMLHeader)
OutputStream.
The
omitXMLHeader flag indicates whether to leave out the xml
declaration header.
outStream - the OutputStream that should be used to
write out the document.omitXMLHeader - a switch to omit the xml header of the document.| Method Detail |
public void write(AttributeList attributeList)
throws WriteException
WriterAttributeList
to a data storage.
write in interface WriterattributeList - list holding the information to write.
WriteException - is thrown whenever an error occurs while writing
out the information stored in the AttributeList.AttributeList
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||