|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.parser.ParserImpl
com.ibm.di.parser.xml.XMLParser2
public class XMLParser2
The Parser used to parse XML documents using the XLXP implementation of the StAX XML Parser. This parser is able to write XML using the same library.
Field Summary | |
---|---|
protected java.lang.String |
attrsDeclaration
the attributes declaration parameter as String |
protected java.lang.String |
charEncoding
String which value is used for decoding the InputStream and encoding the OutputStream |
protected boolean |
coalescing
shows whether any text characters and the CDATA section will be treated as text. |
protected java.io.ByteArrayOutputStream |
currentEntryAsXML
When parsing the XML the Parser will write in this stream so we have String representation of the returned Entry |
protected java.lang.String |
currentEntryAsXMLString
This variable just holds the current Entry as XML string so we do not decode the stream twice or more. |
static java.lang.String |
DEFAULT_ENCODING
The default encoding to use if the user have not specified one or we were unable to find the actual encoding |
protected static java.lang.String |
DUMMY_ROOT_NAME
This is the name of the root tag that will be plugged in to handle multiple root tag XMLs. |
protected java.lang.String[] |
entryTag
the value of the Entry Tag parameter. position 0 holds the declared prefix or null if none position 1 holds the declared localName or null if none position 2 holds the declared namespaceURI or null if none defined |
protected boolean |
firstWriteStart
shows if the start root elements are to be written for first time |
protected boolean |
indentOutput
shows whether the output should be indented |
protected java.lang.String |
nsMap
the prefix to namespaceURI map as String |
protected NamespacesTracker |
nsTracker
Used for tracking the written namespaces |
protected boolean |
skipXMLOnReading
skip repeating XML declarations when reading |
protected boolean |
skipXMLOnWriting
omit XML declaration in the beginning of the output |
protected boolean |
standaloneRoot
shows if the static roots should be output on each entry |
protected java.lang.String[] |
valueTag
the value of the Value Tag parameter. |
protected boolean |
wrapUnwrapEntry
Flag that shows whether the entry will be wrapped in a tag or not. |
protected java.lang.String |
xmlVersion
the XML version to put in XML declaration when writing |
protected SimpleXPathEvaluator |
xPath
this object is used for compiling the input parameters and when navigating through XML elements |
protected java.lang.String |
xPathStr
the raw Simple xPath string |
protected java.lang.String |
xsdPath
the XSD URLs String |
Fields inherited from class com.ibm.di.parser.ParserImpl |
---|
_debug, myConfiguration |
Constructor Summary | |
---|---|
XMLParser2()
Constructs the XMLParser2 object. |
Method Summary | |
---|---|
void |
closeParser()
This method closes the parser's streams |
java.io.ByteArrayInputStream |
getCurrentEntryAsXMLStream()
|
java.lang.String |
getCurrentEntryAsXMLString()
Converts current entry to XML. |
protected Log |
getLogger()
Retrieves log object. |
java.util.HashMap<java.lang.String,java.lang.String> |
getSchemaLocationFromXML()
This method runs through the XML and tries to find any XSD URLs |
java.lang.String |
getVersion()
print the version of the component |
protected void |
initInput()
Initializes the Input. |
protected void |
initOutput()
Initializes the Output. |
void |
initParser()
Initializes the parser. |
java.lang.Object |
querySchema(java.lang.Object schema)
Discover the schema for the Parser. For example, a XML Parser could return a representation of the XML Schema or the DTD referenced in a XML file. |
Entry |
readEntry()
Retrieves an Entry object from the XML document. |
void |
writeEntry(Entry entry)
Writes the passed as parameter Entry object as a XML data. |
Methods inherited from class com.ibm.di.parser.ParserImpl |
---|
debug, debugMode, flush, getClassInstance, getContext, getDebug, getInputStream, getOutputStream, getParam, getParser, getReader, getWriter, isDeltaSupported, logmsg, registerScriptBeans, setConfiguration, setContext, setDebug, setInputStream, setInputStream, setInputStream, setOutputStream, setOutputStream, setParam, setParser |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.di.parser.ParserInterface |
---|
flush, getContext, getDebug, getParam, getParser, getReader, getWriter, isDeltaSupported, registerScriptBeans, setConfiguration, setContext, setDebug, setInputStream, setInputStream, setInputStream, setOutputStream, setOutputStream, setParam, setParser |
Field Detail |
---|
public static final java.lang.String DEFAULT_ENCODING
protected static final java.lang.String DUMMY_ROOT_NAME
protected java.io.ByteArrayOutputStream currentEntryAsXML
protected java.lang.String currentEntryAsXMLString
protected java.lang.String xsdPath
protected java.lang.String xPathStr
protected java.lang.String nsMap
protected java.lang.String charEncoding
protected java.lang.String xmlVersion
protected java.lang.String attrsDeclaration
protected java.lang.String[] entryTag
protected java.lang.String[] valueTag
protected boolean wrapUnwrapEntry
protected boolean skipXMLOnWriting
protected boolean skipXMLOnReading
protected boolean coalescing
protected boolean firstWriteStart
protected boolean standaloneRoot
protected boolean indentOutput
protected SimpleXPathEvaluator xPath
protected NamespacesTracker nsTracker
Constructor Detail |
---|
public XMLParser2()
Method Detail |
---|
public void initParser() throws java.lang.Exception
initParser
in interface ParserInterface
initParser
in class ParserImpl
java.lang.Exception
- - if initialization error occursprotected void initInput() throws java.lang.Exception
java.lang.Exception
- - in case of a read error occurs.ParserImpl.setInputStream(java.io.Reader)
protected void initOutput() throws java.lang.Exception
java.lang.Exception
- - in case of write error occurs.public Entry readEntry() throws java.lang.Exception
readEntry
in interface ParserInterface
java.lang.Exception
- - if an error occurs while parsingpublic void writeEntry(Entry entry) throws java.lang.Exception
writeEntry
in interface ParserInterface
entry
- - the entry that should be written as XML
java.lang.Exception
- - in case of write error occurspublic java.lang.String getVersion()
getVersion
in interface VersionInfoInterface
public void closeParser() throws java.lang.Exception
closeParser
in interface ParserInterface
closeParser
in class ParserImpl
java.lang.Exception
- in case an error occurspublic java.io.ByteArrayInputStream getCurrentEntryAsXMLStream()
public java.lang.String getCurrentEntryAsXMLString() throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- - if the specified encoding is not supportedprotected Log getLogger()
public java.lang.Object querySchema(java.lang.Object schema) throws java.lang.Exception
querySchema
in interface ParserInterface
querySchema
in class ParserImpl
schema
- The object on which to discover schema
java.lang.Exception
- If an I/O error occurspublic java.util.HashMap<java.lang.String,java.lang.String> getSchemaLocationFromXML() throws java.lang.Exception
java.lang.Exception
- - in case parsing exception occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |