public class XMLToFlist extends 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 usinggetFList
.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 String |
EMPTY_STRING |
PIN_XML_BY_NAME, PIN_XML_BY_SHORT_NAME, PIN_XML_TYPE
Modifier | Constructor and Description |
---|---|
protected |
XMLToFlist(int xmlType)
Instantiate XML to Flist converter.
|
Modifier and Type | Method and Description |
---|---|
void |
changeDoc(InputStream xmlInputStream)
Sets the source of the XML document for the new schema support.
|
void |
convert(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 String |
getTimeStampInUnixFormat(String srcFormat,
String src)
This method gets timestamp in unix format, taking the input in
a format specified by the first argument.
|
static void |
main(String[] args)
Invokes the XML to flist converter from the command line.
|
static Node |
maskTree(Node inNode)
This method masks sensitive data in the xml
|
public static final 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
.XMLConstants
public 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(InputSource xmlInputSource) throws IOException, SAXException, ParserConfigurationException
xmlInputSource
- Input source containing XML content to be parsedIOException
- If any IO errors occur.SAXException
- If any parse errors occur.IllegalArgumentException
- If the InputStream is nullParserConfigurationException
DocumentHandler
public FList getFList()
public void changeDoc(InputStream xmlInputStream) throws IOException, SAXException, ParserConfigurationException
xmlInputStream
- Input stream containing XML content to be parsedIOException
- If any IO errors occur.SAXException
- If any parse errors occur.IllegalArgumentException
- If the InputStream is nullParserConfigurationException
DocumentHandler
public static String getTimeStampInUnixFormat(String srcFormat, String src)
srcFormat
- Input date formatsrc
- Input date in srcFormatpublic static Node maskTree(Node inNode)
inNode
- data requiring maskingpublic static void main(String[] args)
Usage: java com.portal.pcm.XMLToFlist -[n]ew filename
Copyright © 2003, 2023, Oracle and/or its affiliates.