public class LoadMetadataOPML
extends java.lang.Object
implements org.xml.sax.ContentHandler
Constructor and Description |
---|
LoadMetadataOPML(boolean debug)
Constructor for the LoadMetadataVocabs object that does nothing (uses
getMetadataVocabInstance() method to load and retrieve an instance of a
vocab).
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
(SAX) Element data (characters between tags)
|
void |
endDocument()
(SAX) Required by SAX, but not used here
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
(SAX) Invoked upon closing tag of an XML element
|
void |
endPrefixMapping(java.lang.String prefix)
(SAX) Required by SAX, but not used here
|
java.lang.String |
getConfigFile()
Gets the configFile attribute of the LoadMetadataVocabs object
|
static java.lang.String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log
files and output to standout:
|
java.lang.String |
getMessage()
Gets the message attribute of the LoadMetadataVocabs object
|
static MetadataVocab |
getMetadataVocabInstance(java.lang.String configFile)
Gets the metadataVocabInstance attribute of the LoadMetadataOPML class
|
static void |
getMetadataVocabInstance(java.lang.String configFile,
java.lang.String contextAttributeName,
javax.servlet.ServletContext servletContext,
java.lang.String vocabTextFile,
boolean debug)
Loads an instance of a MetadataVocab object and sets it as a servlet
context attribute.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
(SAX) Reports any whitespace that is ignored because it falls outside of
the DTD or schema definition--usefull for re-generating the file with
indents intact, though.
|
void |
load()
Load (or reload) the vocabulary
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
(SAX) Required by SAX, but not used here
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
(SAX) Sets the SAX locator, which indicates the current position of the
parser within the document (line number, column number).
|
void |
skippedEntity(java.lang.String name)
(SAX) Required by SAX, but not used here
|
void |
startDocument()
(SAX) Required by SAX, but not used here
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
(SAX) Invoked upon opening tag of an XML element
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
(SAX) Required by SAX, but not used here
|
public LoadMetadataOPML(boolean debug)
debug
- public static void getMetadataVocabInstance(java.lang.String configFile, java.lang.String contextAttributeName, javax.servlet.ServletContext servletContext, java.lang.String vocabTextFile, boolean debug)
servletContext
- The java servlet context in which to store the
loaded vocabulariesvocabTextFile
- Optional (can be NULL) file where vocabs get
listed as text strings (for use by log analysis/reporting)contextAttributeName
- The MetadataVocab instance is stored in app
scope as thisconfigFile
- Base loader file (lists groups/fields
listings)debug
- public static MetadataVocab getMetadataVocabInstance(java.lang.String configFile)
configFile
- public void load()
public java.lang.String getMessage()
public java.lang.String getConfigFile()
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
locator
- The new documentLocator valuepublic void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
prefix
- uri
- org.xml.sax.SAXException
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
endPrefixMapping
in interface org.xml.sax.ContentHandler
prefix
- org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
namespaceURI
- XML namespacelocalName
- local tag nameqName
- fully qualified tag nameatts
- tag attributesorg.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
namespaceURI
- XML namespacelocalName
- local tag nameqName
- fully qualified tag nameorg.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
ch
- character arraystart
- starting index of character datalength
- length of character dataorg.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
ch
- start
- length
- org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
target
- data
- org.xml.sax.SAXException
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
skippedEntity
in interface org.xml.sax.ContentHandler
name
- org.xml.sax.SAXException
public static java.lang.String getDateStamp()