|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.xml.sax.helpers.DefaultHandler
|
+--com.solarmetric.rd.meta.XMLMetaDataParser
Custom SAX parser used by the system to quickly parse metadata files. Subclasses should handle the processing of the metadata content.
| Constructor Summary | |
XMLMetaDataParser()
|
|
| Method Summary | |
protected void |
addResult(java.lang.Object result)
Add a result to be returned from the current parse. |
void |
characters(char[] ch,
int start,
int length)
|
void |
clear()
Clears the cache of parsed resource names. |
protected java.lang.ClassLoader |
currentClassLoader()
Return the class loader to use when resolving resources and loading classes. |
protected abstract void |
endElement(java.lang.String name)
Override this method marking the end of some element. |
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName)
|
void |
error(org.xml.sax.SAXParseException se)
|
void |
fatalError(org.xml.sax.SAXParseException se)
|
java.net.URL |
findMetaData(java.lang.Class type)
Find the metadata resource for the given class. |
protected void |
finish()
Override this method to finish up after a parse; this is only called if no errors are encountered during parsing. |
java.lang.ClassLoader |
getClassLoader()
Return the class loader set for loading related types. |
protected java.lang.String |
getCurrentLocation()
|
protected java.io.Reader |
getDocType()
Override this method to return any DOCTYPE declaration
that should be dynamically included in xml documents that will be
validated. |
protected abstract java.lang.String |
getExtension()
Override this method to return the extension used for metadata resources. |
com.solarmetric.rd.meta.Location |
getLocation()
|
org.apache.commons.logging.Log |
getLog()
Return the log to write to. |
java.util.Collection |
getResults()
Return the results from the last parse. |
protected java.io.File |
getSourceFile()
Return the file of the source being parsed. |
protected java.lang.String |
getSourceName()
Return the name of the source file being parsed. |
protected java.lang.String |
getText()
Return the text value within the current node. |
boolean |
isValidating()
Return true if this is a validating parser, false otherwise. |
void |
parse(java.lang.Class type)
Parse the metadata for the given type. |
void |
parse(java.io.File file)
Parse the metadata for the given file. |
void |
parse(java.io.Reader xml,
java.lang.String sourceName)
Parse the metadata in the given reader. |
void |
parse(java.net.URL url)
Parse the metadata for the given URL. |
protected void |
reset()
Override this method to clear any state and ready the parser for a new document. |
void |
setClassLoader(java.lang.ClassLoader loader)
Set the class loader to use for loading related types. |
void |
setDocumentLocator(org.xml.sax.Locator loc)
|
void |
setLocation(com.solarmetric.rd.meta.Location location)
|
void |
setLog(org.apache.commons.logging.Log log)
Set the log to write to. |
void |
setValidating(boolean validating)
Set whether or not the parser should validate. |
protected abstract void |
startElement(java.lang.String name,
org.xml.sax.Attributes attrs)
Override this method marking the start of some element. |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
|
protected void |
throwException(java.lang.String msg)
Throws a SAXException with the source file name and the given error message. |
protected void |
throwException(java.lang.String msg,
java.lang.Exception cause)
Throws a SAXException with the source file name and the given error message. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XMLMetaDataParser()
| Method Detail |
public java.lang.ClassLoader getClassLoader()
currentClassLoader()
method, which will default to the current thread's context loader
if no class loader has been set.
public void setClassLoader(java.lang.ClassLoader loader)
protected java.lang.ClassLoader currentClassLoader()
public boolean isValidating()
MetaDataParser
isValidating in interface MetaDataParserpublic void setValidating(boolean validating)
MetaDataParser
setValidating in interface MetaDataParserpublic org.apache.commons.logging.Log getLog()
MetaDataParser
getLog in interface MetaDataParserpublic void setLog(org.apache.commons.logging.Log log)
MetaDataParser
setLog in interface MetaDataParserpublic java.util.Collection getResults()
MetaDataParser
getResults in interface MetaDataParserpublic void setDocumentLocator(org.xml.sax.Locator loc)
setDocumentLocator in interface org.xml.sax.ContentHandlersetDocumentLocator in class org.xml.sax.helpers.DefaultHandlerpublic com.solarmetric.rd.meta.Location getLocation()
public void setLocation(com.solarmetric.rd.meta.Location location)
public java.net.URL findMetaData(java.lang.Class type)
findMetaData in interface MetaDataParser
public void parse(java.lang.Class type)
throws java.io.IOException
MetaDataParser
parse in interface MetaDataParserjava.io.IOExceptionMetaDataParser.findMetaData(java.lang.Class)
public void parse(java.net.URL url)
throws java.io.IOException
MetaDataParser
parse in interface MetaDataParserjava.io.IOExceptionMetaDataParser.parse(Class)
public void parse(java.io.File file)
throws java.io.IOException
MetaDataParser
parse in interface MetaDataParserjava.io.IOExceptionMetaDataParser.parse(Class)
public void parse(java.io.Reader xml,
java.lang.String sourceName)
throws java.io.IOException
MetaDataParser
parse in interface MetaDataParserxml - reader containing the metadata to parsesourceName - the name of the source being parsed, for use
in error messages
java.io.IOExceptionMetaDataParser.parse(Class)public void clear()
MetaDataParser
clear in interface MetaDataParser
public void error(org.xml.sax.SAXParseException se)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException se)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void characters(char[] ch,
int start,
int length)
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandler
protected abstract void startElement(java.lang.String name,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void endElement(java.lang.String name)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected abstract java.lang.String getExtension()
protected void addResult(java.lang.Object result)
protected void finish()
super.finish () to resolve superclass state.
protected void reset()
super.reset () to clear superclass state.
protected java.io.Reader getDocType()
throws java.io.IOException
DOCTYPE declaration
that should be dynamically included in xml documents that will be
validated. Returns null by default.
java.io.IOExceptionprotected java.lang.String getText()
protected java.lang.String getSourceName()
protected java.io.File getSourceFile()
protected java.lang.String getCurrentLocation()
protected void throwException(java.lang.String msg)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void throwException(java.lang.String msg,
java.lang.Exception cause)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||