|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cybertory.MSS.XMLHandler
The base class for code associated with handled data types,
including functionality for generating XML Schema and parsing
the corresponding XML data.
There's also a lot of static code behind the methods
schemaDocument()
and parseXMLDocument(org.jdom.Document, org.cybertory.MSS.ExternalDataFactory[])
.
Field Summary | |
protected java.lang.Class |
handledClass
map of handlers keyed by short name for class |
Constructor Summary | |
protected |
XMLHandler(java.lang.Class handledClass)
Constructor (never accessed by user code since abstract). |
Method Summary | |
protected abstract boolean |
allowBackwardRef()
Allow multiple elements for this data type ? |
protected abstract boolean |
allowMultiple()
|
protected static org.jdom.Element |
alternateElement(java.lang.String parseLabel,
boolean forExternal)
Create the element for either "ext_*" or "ref_*" with given parse label. |
int |
compareTo(java.lang.Object o)
To implement Comparable |
protected java.util.List |
extractChildren(org.jdom.Element parentElem,
org.jdom.filter.Filter childFilter,
boolean required)
|
protected static XMLHandler[] |
getAllHandlers()
|
static java.lang.Class[] |
getHandledClasses(java.lang.Class superClass)
Given a class (or interface), return its handled subclasses. |
protected static XMLHandler |
getHandler(java.lang.Class cls)
Return the handler instance associated with a handled data type. |
protected static XMLHandler[] |
getHandlersDefs()
|
XMLChildFilter |
getXMLChildFilter(boolean allowExternalData)
|
XMLChildFilter |
getXMLChildFilter(java.lang.String parseLabel,
boolean allowExternalData)
|
java.lang.Class |
handledClass()
Return the Class object for the data type handled by this wrapper. |
static void |
handlersReport(java.io.PrintStream output)
The Class whose data is parsed by this handler |
protected abstract boolean |
needsTypedef()
Allow data in the "defs" section, with later backward references ? |
protected java.lang.Object |
parseChildren(org.jdom.Element parentElem,
org.jdom.filter.Filter childFilter,
XMLAltData altData,
boolean required)
Parse zero or more children of the same data type. |
protected abstract java.lang.Object |
parseElement(org.jdom.Element elem,
XMLAltData altData)
Given that the element already extracted from it's context, parse the data (whose type should match that of the handler). |
static Scan[] |
parseRequest(org.jdom.Element parentElem,
XMLAltData altData)
|
static Scan[] |
parseXMLDocument(org.jdom.Document doc,
ExternalDataFactory[] extDataFactories)
Parse the entire XML document requesting microarray image scans. |
static org.jdom.Document |
schemaDocument()
Return a JDOM Document for the entire schema of the XML for
generating images. |
protected org.jdom.Element |
schemaInContext(boolean required,
boolean allowExternalData)
|
protected org.jdom.Element |
schemaInContext(boolean required,
boolean allowExternalData,
java.lang.String description)
Return an element for a particular context |
protected org.jdom.Element |
schemaInContext(java.lang.String parseLabel,
boolean required,
boolean allowExternalData)
|
protected org.jdom.Element |
schemaInContext(java.lang.String parseLabel,
boolean required,
boolean allowExternalData,
java.lang.String description)
Return an element for a particular context |
protected org.jdom.Element |
schemaTypedef()
Generate Schema type definition for the class (using JDOM). |
java.lang.String |
typeDescription()
|
abstract java.lang.String |
xmlTypeName()
Return the label to be used in the name of schema type defs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final java.lang.Class handledClass
Constructor Detail |
protected XMLHandler(java.lang.Class handledClass)
Method Detail |
public static void handlersReport(java.io.PrintStream output)
public static java.lang.Class[] getHandledClasses(java.lang.Class superClass)
superClass
- the class for whom the subclasses are desired
protected static XMLHandler[] getAllHandlers()
protected static XMLHandler[] getHandlersDefs()
public static org.jdom.Document schemaDocument() throws XMLUnhandledTypeException
Document
for the entire schema of the XML for
generating images. All of the XMLHandler
instances must be
created before this will work.
Document
for the image generation schema
XMLUnhandledTypeException
public static Scan[] parseXMLDocument(org.jdom.Document doc, ExternalDataFactory[] extDataFactories) throws XMLParseException, XMLUnhandledTypeException
Scan
objects which can then
be rendered (and saved to files).
XMLParseException
XMLUnhandledTypeException
public static Scan[] parseRequest(org.jdom.Element parentElem, XMLAltData altData) throws XMLParseException, XMLUnhandledTypeException
XMLParseException
XMLUnhandledTypeException
protected static XMLHandler getHandler(java.lang.Class cls) throws XMLUnhandledTypeException
cls
- the Class of interest
XMLUnhandledTypeException
protected abstract boolean allowMultiple()
protected abstract boolean allowBackwardRef()
protected abstract boolean needsTypedef()
public java.lang.String typeDescription()
protected org.jdom.Element schemaTypedef() throws XMLUnhandledTypeException
XMLUnhandledTypeException
protected static org.jdom.Element alternateElement(java.lang.String parseLabel, boolean forExternal)
parseLabel
- forExternal
- indicates this should be an external data element
rather than a backward ref element.protected org.jdom.Element schemaInContext(boolean required, boolean allowExternalData) throws XMLUnhandledTypeException
XMLUnhandledTypeException
protected org.jdom.Element schemaInContext(boolean required, boolean allowExternalData, java.lang.String description) throws XMLUnhandledTypeException
allowExternalData
- indicates whether to add an "externalData"
element.
XMLUnhandledTypeException
protected org.jdom.Element schemaInContext(java.lang.String parseLabel, boolean required, boolean allowExternalData) throws XMLUnhandledTypeException
XMLUnhandledTypeException
protected org.jdom.Element schemaInContext(java.lang.String parseLabel, boolean required, boolean allowExternalData, java.lang.String description) throws XMLUnhandledTypeException
allowExternalData
- indicates whether to add an
"externalData" element.
XMLUnhandledTypeException
protected java.lang.Object parseChildren(org.jdom.Element parentElem, org.jdom.filter.Filter childFilter, XMLAltData altData, boolean required) throws XMLParseException, XMLUnhandledTypeException
parentElem
- the JDOM element under which the data should be found.childFilter
- a JDOM element filter object applied on the childrenaltData
- Alternate source of data: external and cached datarequired
- indicates if it's not OK for the data to be absent
XMLParseException
XMLUnhandledTypeException
protected java.util.List extractChildren(org.jdom.Element parentElem, org.jdom.filter.Filter childFilter, boolean required) throws XMLParseException
XMLParseException
protected abstract java.lang.Object parseElement(org.jdom.Element elem, XMLAltData altData) throws XMLParseException, XMLUnhandledTypeException
elem
- the JDOM element containing the dataaltData
- the background data context for parsing
XMLParseException
XMLUnhandledTypeException
public java.lang.Class handledClass()
public abstract java.lang.String xmlTypeName()
public XMLChildFilter getXMLChildFilter(boolean allowExternalData)
public XMLChildFilter getXMLChildFilter(java.lang.String parseLabel, boolean allowExternalData)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |