Qizx fe-4.4p2 API

com.qizx.api
Interface ContentImporter


public interface ContentImporter

Import method for structured or semi-structured data.

Implementations of this interface read a document or data fragment represented in such formats as JSON, HTML, CSV, mail, RTF... and convert it into XML representation based on adhoc Schema or DTD.

An implementation must have a public constructor without arguments.


Field Summary
static String[] DEFAULT_IMPORTERS
          Content Importers available by default.
 
Method Summary
 void configure(Properties options)
          Configure with implementation-specific properties.
 String[] getNames()
          Returns a list of names that can be used to designate the data format imported by this object.
 void parse(XMLPushStream handler, String documentPath)
          Actual import work.
 void setInput(InputStream input)
          Takes the data input from a byte stream.
 void setInput(Reader input)
          Takes the data input from a character stream.
 void setInput(String data)
          Takes the data input from a String.
 

Field Detail

DEFAULT_IMPORTERS

static final String[] DEFAULT_IMPORTERS
Content Importers available by default.

Method Detail

getNames

String[] getNames()
Returns a list of names that can be used to designate the data format imported by this object. For example a CSV importer would return "csv", an HTML5 importer would return {"html5", "html"} etc.


configure

void configure(Properties options)
               throws DataModelException
Configure with implementation-specific properties.

Parameters:
options - a set of properties,
Throws:
DataModelException

setInput

void setInput(String data)
              throws DataModelException
Takes the data input from a String.

Parameters:
data - a String
Throws:
DataModelException

setInput

void setInput(InputStream input)
              throws DataModelException
Takes the data input from a byte stream.

Parameters:
input - a byte stream
Throws:
DataModelException

setInput

void setInput(Reader input)
              throws DataModelException
Takes the data input from a character stream.

Parameters:
input - a character stream
Throws:
DataModelException

parse

void parse(XMLPushStream handler,
           String documentPath)
           throws DataModelException
Actual import work.

Parameters:
handler - a push-style handler similar to XMLEventWriter. In order to use SAX2 rather than this interface, it only needs to be wrapped in a SAXToPushStream adapter: new SAXToPushStream(handler) returns an object which is both a DefaultHandler and a LexicalHandler
documentPath - path of the resulting document in the XML Library. For information purpose.
Throws:
DataModelException

© 2010 Axyana Software