public class FlistToJson
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
convert(FList flist)
Root method to convert the FList input to JSON Object
|
void |
dumpJsonObject()
Method to dump the JSON object to standard out.
|
static FlistToJson |
getInstance()
Public method to instantiate this class.
|
static FlistToJson |
getInstance(java.util.Map<java.lang.String,java.lang.String> fieldMap)
Public method to instantiate this class.
|
JsonNode |
getJsonObject()
Method to get the Root JSON Object node.
|
protected java.lang.String |
getMappedFieldName(java.lang.String pinFldName)
This method checks to see if the given field is specified in a map
|
static void |
main(java.lang.String[] args)
Main method to test this class independently.
|
void |
serializeToFile(java.io.File file)
Utility function to write the current JSOn object to file.
|
java.lang.String |
toJSONString()
Method to convert the JSON Object to string.
|
java.lang.String |
toJSONStringCompact()
Method to convert the JSON Object to string in a compact form.
|
public static FlistToJson getInstance()
public static FlistToJson getInstance(java.util.Map<java.lang.String,java.lang.String> fieldMap)
fieldMap
- A mapping between PIN_FLD names and custom names. To be used
during XML transformation.public void convert(FList flist) throws EBufException
flist
- The FList object that needs conversion.EBufException
- Throws generic portal exception.protected java.lang.String getMappedFieldName(java.lang.String pinFldName)
pinFldName
- Field name of the form PIN_FLD_XXXX.public java.lang.String toJSONString() throws JsonProcessingException
JsonProcessingException
public java.lang.String toJSONStringCompact() throws JsonProcessingException
JsonProcessingException
public JsonNode getJsonObject()
public void serializeToFile(java.io.File file) throws java.io.IOException
file
- File handle to which the JSON object needs to
written to.java.io.IOException
- IO Exceptionpublic void dumpJsonObject() throws JsonProcessingException
JsonProcessingException
public static void main(java.lang.String[] args)
args
- Filename with input flist.