public class XMLToFlist extends java.lang.Object implements XMLConstants
<?xml version="1.0" encoding="UTF-8"?>
<flist>
<POID xmlns="">0.0.0.1 /account 1234</POID>
<AR_ACCOUNT_OBJ xmlns="">0.0.0.1 /account 9876</AR_ACCOUNT_OBJ>
<INCLUDE_CHILDREN xmlns="">123</INCLUDE_CHILDREN>
<NAMEINFO elem="1">
<ADDRESS>10200 South De Anza Blvd</ADDRESS>
<CITY>Cupertino</CITY>
<CANON_COMPANY>Portal Software</CANON_COMPANY>
<CANON_COUNTRY>USA</CANON_COUNTRY>
</NAMEINFO>
<WRITE_ACCESS xmlns="">some string</WRITE_ACCESS>
</flist>
To use, get an instance of converter and specify an input stream containing
the xml data via convert. The generated flist is retrieved
using getFList.
Note: The XML formats this converter currently supports are
PIN_XML_BY_SHORT_NAME and PIN_XML_BY_NAME.
It is also possible to invoke this converter from the command line. See
main method for usage.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EMPTY_STRING |
PIN_XML_BY_NAME, PIN_XML_BY_SHORT_NAME, PIN_XML_NOTIFICATION, PIN_XML_TYPE| Modifier | Constructor and Description |
|---|---|
protected |
XMLToFlist(int xmlType)
Instantiate XML to Flist converter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeDoc(java.io.InputStream xmlInputStream)
Sets the source of the XML document for the new schema support.
|
void |
convert(org.xml.sax.InputSource xmlInputSource)
Set the source of the XML document.
|
FList |
getFList()
Get the flist represented by the XML.
|
static XMLToFlist |
getInstance()
Factory method to get an instance of the converter for default,
PIN_XML_BY_SHORT_NAME, XML format.
|
static XMLToFlist |
getInstance(int xmlType)
Factory method to get an instance of the converter for specified,
XML format.
|
static java.lang.String |
getTimeStampInUnixFormat(java.lang.String srcFormat,
java.lang.String src)
This method gets timestamp in unix format, taking the input in
a format specified by the first argument.
|
static void |
main(java.lang.String[] args)
Invokes the XML to flist converter from the command line.
|
static org.w3c.dom.Node |
maskTree(org.w3c.dom.Node inNode)
This method masks sensitive data in the xml
|
public static final java.lang.String EMPTY_STRING
protected XMLToFlist(int xmlType)
getInstance factory method to get an appropriate
instance.xmlType - Known XML types are defined in XMLConstants. The
XML formats this converter currently supports is
XMLConstants.PIN_XML_BY_SHORT_NAME.
XMLConstants.PIN_XML_BY_NAME.XMLConstantspublic static XMLToFlist getInstance()
public static XMLToFlist getInstance(int xmlType)
xmlType - Known XML types are defined in XMLConstants. The
XML formats this converter currently supports is
XMLConstants.PIN_XML_BY_SHORT_NAME.
XMLConstants.PIN_XML_BY_NAME.public void convert(org.xml.sax.InputSource xmlInputSource)
throws java.io.IOException,
org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException
xmlInputSource - Input source containing XML content to be parsedjava.io.IOException - If any IO errors occur.org.xml.sax.SAXException - If any parse errors occur.java.lang.IllegalArgumentException - If the InputStream is nulljavax.xml.parsers.ParserConfigurationExceptionDocumentHandlerpublic FList getFList()
public void changeDoc(java.io.InputStream xmlInputStream)
throws java.io.IOException,
org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException
xmlInputStream - Input stream containing XML content to be parsedjava.io.IOException - If any IO errors occur.org.xml.sax.SAXException - If any parse errors occur.java.lang.IllegalArgumentException - If the InputStream is nulljavax.xml.parsers.ParserConfigurationExceptionDocumentHandlerpublic static java.lang.String getTimeStampInUnixFormat(java.lang.String srcFormat,
java.lang.String src)
srcFormat - Input date formatsrc - Input date in srcFormatpublic static org.w3c.dom.Node maskTree(org.w3c.dom.Node inNode)
inNode - data requiring maskingpublic static void main(java.lang.String[] args)
Usage: java com.portal.pcm.XMLToFlist -[n]ew filename