|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.alfresco.repo.content.selector.RootElementNameContentWorkerSelector
public class RootElementNameContentWorkerSelector
A selector that looks at the root node of an XML document to determine which worker to provide. There are many ways to identify XML documents and this is probably the simplest. Alternate implementations might execute a series of xpath statements or look for specific namespace declarations in the document. The net result is the same, i.e. given an XML document, a worker is provided to the caller.
Constructor Summary | |
---|---|
RootElementNameContentWorkerSelector()
|
Method Summary | |
---|---|
ContentWorker |
getWorker(org.alfresco.service.cmr.repository.ContentReader reader)
Performs a match of the root element name to find the correct content worker. |
void |
init()
Checks the configuration. |
void |
setSupportedMimetypes(java.util.Set supportedMimetypes)
Optionally set the mimetypes supported. |
void |
setWorkers(java.util.Map workers)
Set the workers to choose from. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
java.lang.String |
toString()
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RootElementNameContentWorkerSelector()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public void setSupportedMimetypes(java.util.Set supportedMimetypes)
supportedMimetypes
- the list of mimetypes. The default is text/xml.public void setWorkers(java.util.Map workers)
workers
- a map of ContentWorker instances
keyed by root element namepublic void init()
public ContentWorker getWorker(org.alfresco.service.cmr.repository.ContentReader reader)
getWorker
in interface ContentWorkerSelector
reader
- the content reader, providing the actual stream metadata
and even the stream, if required.
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |