public class DefaultDocumentParserFactory extends Object implements IDocumentParserFactory, IXMLConfigurable
XML configuration usage (not required since default):
<documentParserFactory class="com.norconex.importer.parser.DefaultDocumentParserFactory" format="text|xml" />
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FORMAT |
Constructor and Description |
---|
DefaultDocumentParserFactory()
Creates a new document parser factory of "text" format.
|
DefaultDocumentParserFactory(String format)
Creates a new document parser factory of the given format.
|
Modifier and Type | Method and Description |
---|---|
protected IDocumentParser |
getFallbackParser() |
String |
getFormat() |
IDocumentParser |
getParser(String documentReference,
ContentType contentType)
Gets a parser based on content type, regardless of document reference
(ignoring it).
|
void |
loadFromXML(Reader in) |
protected void |
registerFallbackParser(IDocumentParser parser) |
protected void |
registerNamedParser(ContentType contentType,
IDocumentParser parser) |
void |
saveToXML(Writer out) |
void |
setFormat(String format) |
public static final String DEFAULT_FORMAT
public DefaultDocumentParserFactory()
public DefaultDocumentParserFactory(String format)
format
- dependent on parser expectations but typically, one
of "text" or "xml"public final IDocumentParser getParser(String documentReference, ContentType contentType)
getParser
in interface IDocumentParserFactory
documentReference
- document referencecontentType
- content typepublic String getFormat()
public void setFormat(String format)
protected final void registerNamedParser(ContentType contentType, IDocumentParser parser)
protected final void registerFallbackParser(IDocumentParser parser)
protected final IDocumentParser getFallbackParser()
public void loadFromXML(Reader in) throws IOException
loadFromXML
in interface IXMLConfigurable
IOException
public void saveToXML(Writer out) throws IOException
saveToXML
in interface IXMLConfigurable
IOException
Copyright © 2009-2014 Norconex Inc.. All Rights Reserved.