public class SaxEventHandlerDelegate extends org.xml.sax.helpers.DefaultHandler
XmlInputTransformer to delegate SAX Parse events to the
relevant handlers. Its primary method is read(java.io.InputStream) which takes in an
InputStream returns a Metacard, populated with all the Attributes parsed
by the eventHandlers| Constructor and Description |
|---|
SaxEventHandlerDelegate() |
SaxEventHandlerDelegate(List<SaxEventHandler> eventHandlers) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Takes in a sax event from
parser and passes it to the eventHandlers |
void |
endDocument()
Takes in a sax event from
parser and passes it to the eventHandlers |
void |
endElement(String namespaceURI,
String localName,
String qName)
Takes in a sax event from
parser and passes it to the eventHandlers |
void |
endPrefixMapping(String prefix) |
Metacard |
getMetacard(String id) |
MetacardType |
getMetacardType(String id)
Defines and returns a
DynamicMetacardType based on component Sax Event Handlers and
what attributes they populate |
org.apache.commons.io.input.TeeInputStream |
getMetadataStream(InputStream inputStream,
OutputStream outputStream) |
SaxEventHandlerDelegate |
read(InputStream inputStream)
Takes in an
InputStream returns a Metacard, populated with all the Attributes parsed by the eventHandlers |
void |
startDocument()
Takes in a sax event from
parser and passes it to the eventHandlers |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
Takes in a sax event from
parser and passes it to the eventHandlers |
void |
startPrefixMapping(String prefix,
String uri)
Takes in a sax event from
parser and passes it to the eventHandlers |
error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warningpublic SaxEventHandlerDelegate()
public SaxEventHandlerDelegate(List<SaxEventHandler> eventHandlers)
public SaxEventHandlerDelegate read(InputStream inputStream) throws CatalogTransformerException
InputStream returns a Metacard, populated with all the Attributes parsed by the eventHandlersinputStream - an XML document that can be parsed into a MetacardMetacard, populated with all the Attributes parsed by the eventHandlersCatalogTransformerExceptionpublic void startDocument()
throws SAXException
parser and passes it to the eventHandlersstartDocument in interface ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void endDocument()
throws SAXException
parser and passes it to the eventHandlersendDocument in interface ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
parser and passes it to the eventHandlersstartElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandleruri - the URI that is passed in by SaxEventHandlerDelegatelocalName - the localName that is passed in by SaxEventHandlerDelegateqName - the qName that is passed in by SaxEventHandlerDelegateattributes - the attributes that are passed in by SaxEventHandlerDelegateSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
parser and passes it to the eventHandlerscharacters in interface ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerch - the ch that is passed in by SaxEventHandlerDelegatestart - the start that is passed in by SaxEventHandlerDelegatelength - the length that is passed in by SaxEventHandlerDelegateSAXExceptionpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
parser and passes it to the eventHandlersendElement in interface ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlernamespaceURI - the namespaceURI that is passed in by SaxEventHandlerDelegatelocalName - the localName that is passed in by SaxEventHandlerDelegateqName - the qName that is passed in by SaxEventHandlerDelegateSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
parser and passes it to the eventHandlersstartPrefixMapping in interface ContentHandlerstartPrefixMapping in class org.xml.sax.helpers.DefaultHandlerprefix - the prefix that is passed in by SaxEventHandlerDelegateuri - the uri that is passed in by SaxEventHandlerDelegateSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic org.apache.commons.io.input.TeeInputStream getMetadataStream(InputStream inputStream, OutputStream outputStream)
public MetacardType getMetacardType(String id)
DynamicMetacardType based on component Sax Event Handlers and
what attributes they populateThis work is licensed under a Creative Commons Attribution 4.0 International License.