public class RootElementNameContentWorkerSelector<W extends ContentWorker> extends DefaultHandler implements ContentWorkerSelector<ContentWorker>
Constructor and Description |
---|
RootElementNameContentWorkerSelector() |
Modifier and Type | Method and Description |
---|---|
W |
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(Set<String> supportedMimetypes)
Optionally set the mimetypes supported.
|
void |
setWorkers(Map<String,W> workers)
Set the workers to choose from.
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
String |
toString() |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
public RootElementNameContentWorkerSelector()
public void setSupportedMimetypes(Set<String> supportedMimetypes)
supportedMimetypes
- the list of mimetypes. The default is text/xml.public void setWorkers(Map<String,W> workers)
workers
- a map of ContentWorker instances
keyed by root element namepublic void init()
public W getWorker(org.alfresco.service.cmr.repository.ContentReader reader)
getWorker
in interface ContentWorkerSelector<ContentWorker>
reader
- the content reader, providing the actual stream metadata
and even the stream, if required.public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
Copyright © 2005–2017 Alfresco Software. All rights reserved.