java.lang.Object
org.scopemvc.view.servlet.xml.ModelToXML
- public class ModelToXML
- extends java.lang.Object
Converts a model into an XML document (as SAX events
driving a ContentHandler). Uses a PropertyIDGenerator to
create "path" attributes for all elements, and "id" attributes
for model elements.
Handles circular references using the "ID" and "IDREF" pattern.
(data id='_root')
(name path='name')Steve(/name)
(pets path='pets')
(element index='0' path='pets.0')
(data id='pets.0')
(name path='pets.0.name')Trevor(/name)
(/data)
(/element)
(/pets)
(/data)
- Version:
- $Revision: 1.5 $ $Date: 2002/01/26 09:46:20 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
private static final org.apache.commons.logging.Log LOG
ID_ATTRIBUTE
protected static final java.lang.String ID_ATTRIBUTE
- See Also:
- Constant Field Values
IDREF_ATTRIBUTE
protected static final java.lang.String IDREF_ATTRIBUTE
- See Also:
- Constant Field Values
CDATA_TYPE
protected static final java.lang.String CDATA_TYPE
- See Also:
- Constant Field Values
PATH_ATTRIBUTE
protected static final java.lang.String PATH_ATTRIBUTE
- See Also:
- Constant Field Values
COLLECTION_ELEMENT
protected static java.lang.String COLLECTION_ELEMENT
- Element to contain contents of a collection model.
COLLECTION_INDEX_ATTRIBUTE
protected static java.lang.String COLLECTION_INDEX_ATTRIBUTE
- Attribute to index the contents of a collection model.
MODEL_ELEMENT
protected static java.lang.String MODEL_ELEMENT
- Element to contain a model object.
idAttributes
protected org.xml.sax.helpers.AttributesImpl idAttributes
idrefAttributes
protected org.xml.sax.helpers.AttributesImpl idrefAttributes
pathIndexAttributes
protected org.xml.sax.helpers.AttributesImpl pathIndexAttributes
indexAttributes
protected org.xml.sax.helpers.AttributesImpl indexAttributes
pathAttributes
protected org.xml.sax.helpers.AttributesImpl pathAttributes
EMPTY_ATTRIBUTES
protected static final org.xml.sax.Attributes EMPTY_ATTRIBUTES
ModelToXML
public ModelToXML()
init
protected void init()
- Initialise the Attributes that are reused during SAX generation.
modelToXML
public void modelToXML(java.lang.Object inModel,
org.xml.sax.ContentHandler inContentHandler,
PropertyIDGenerator inIDGenerator)
throws java.lang.Exception
propertiesToXML
protected void propertiesToXML(java.lang.Object inModel,
org.xml.sax.ContentHandler inContentHandler,
PropertyIDGenerator inIDGenerator,
IdRefMap inIdRefMap)
throws java.lang.Exception