com.skaringa.javaxml.handler.sax
Class ObjectXSDReader
java.lang.Object
com.skaringa.javaxml.handler.sax.AbstractXMLReader
com.skaringa.javaxml.handler.sax.ObjectXSDReader
- All Implemented Interfaces:
- org.xml.sax.XMLReader
public final class ObjectXSDReader
- extends AbstractXMLReader
A implementation of the SAX2 XMLReader interface.
This class is able to parse serializable objects and write their type
definition as an XML schema definition (XSD).
Method Summary |
void |
addUsedClass(java.lang.Class usedClass)
Add another class to document within the schema. |
void |
addUsedClasses(java.util.Collection usedClasses)
Add a collection of classes to document within the schema. |
void |
parseObject(java.lang.Object obj,
java.lang.Class type,
DocumentOutputHandlerInterface output)
Parse an object and generate messages for a DocumentOutputHandler
from its content. |
Methods inherited from class com.skaringa.javaxml.handler.sax.AbstractXMLReader |
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, getPropertyMap, parse, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectXSDReader
public ObjectXSDReader()
parseObject
public void parseObject(java.lang.Object obj,
java.lang.Class type,
DocumentOutputHandlerInterface output)
throws SerializerException
- Description copied from class:
AbstractXMLReader
- Parse an object and generate messages for a DocumentOutputHandler
from its content.
- Specified by:
parseObject
in class AbstractXMLReader
- Parameters:
obj
- The object to parse.type
- The type of the object.output
- The DocumentOutputHandler that gets the result messages.
- Throws:
SerializerException
- If the object can't be parsed or the
DocumentOutputHandler can't handle the result messages.- See Also:
AbstractXMLReader.parseObject(Object, Class, DocumentOutputHandlerInterface)
addUsedClass
public void addUsedClass(java.lang.Class usedClass)
- Add another class to document within the schema.
This is useful for generating schemas for collections,
because their component types are not documented in the class definition.
- Parameters:
usedClass
- The class used.
addUsedClasses
public void addUsedClasses(java.util.Collection usedClasses)
- Add a collection of classes to document within the schema.
This is useful for generating schemas for collections,
because their component types are not documented in the class definition.
- Parameters:
usedClasses
- A collection of classes used.