Package com.portal.pcm
Class FList
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,Map<Field,Object>
The
FList class is the Java expression of the Portal flist
(field list)
structure and associated functions. An flist is a collection of 'Field -
Value'
pairs. The field is a predefined constant, and the value is of a type
determined by
the field. Flists are used by opcodes to pass data from the application to
the database.
For more information and examples of flists, see Understanding Oracle BRM
Flists and
Storable classes in the Oracle BRM online documentation.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends theFListpassed in onto the currentFList.asString()Creates a string representation of theFList.createFromJsonObject(JsonNode jsonNode) This method allows you to obtain FList from JsonNode Object.createFromJsonString(String jsonString) This method allows you to obtain FList from JSON String.static FListcreateFromString(String str) Creates a newFListfrom a string representation.static FListcreateFromString(String str, long defDB) Creates a newFListfrom a string representation.static FListDeprecated.As of 6.5SP2_EBF - this does not properly supportstatic FListcreateFromXML(Reader reader) Converts the XML in the given stream into an FListCopies all levels of anFList, including array elements and substructures.deepClone(int proto_vers) Copies all levels of anFList, including array elements and substructures.voiddump()Displays theFListto the standard output.static StringFormats BigDecimal To stringget(ArrayField field) Returns theSparseArrayvalue associated with a field of typeArrayField.byte[]get(BinStrField field) Returns a byte[] value associated with a field of typeBinStrField.Returns theBuffervalue associated with a field of typeBufField.get(DecimalField field) Returns aBigDecimalvalue associated with a field of typeDecimalField.Returns theIntegervalue associated with a field of typeEnumField.Returns anEBufExceptionvalue associated with a field of typeErrField.get(Int64Field field) Returns theLongvalue associated with a field of typeInt64Field.Returns theIntegervalue associated with a field of typeIntField.Deprecated.Num is no longer supported.Returns aPoidvalue associated with a field of typeObjField.Returns thePoidvalue associated with a field of typePoidField.Returns theStringvalue associated with a field of typeStrField.get(SubStructField field) Returns anFListvalue associated with a field of typeSubstruct.get(TStampField field) Returns theDatevalue associated with a field of typeTStampField.Deprecated.Uint is no longer supported.Returns a set of the fields in theFList.Returns a collection of the values in theFList.getElement(ArrayField field, int elementID) Returns an element associated with an array of typeArrayField.Returns anObjectvalue associated with a field of type field.Deprecated.see getAllFields()intgetSize()Returns the number of fields in theFList.Deprecated.see getAllValues()booleanChecks theFListkeys for a specified field.static StringparseBigDecimalNum(String valStr) Parse the input string which is required by BigDecimalvoidImplements the java.io.Externalizable interface.voidRemoves a single field from anFList.voidClears theFListby removing all contained objects.voidset(ArrayField field, SparseArray value) Adds anArrayFieldand its value to theFList.voidset(BinStrField field, byte[] value) Adds aBinStrFieldand its value to theFList.voidAdds aBufFieldand its value to theFList.voidset(DecimalField field, BigDecimal value) Adds aDecimalFieldand its value to theFList.voidAdds anEnumFieldand its value to theFList.voidAdds anEnumFieldand its value to theFList.voidset(ErrField field, EBufException value) Adds aErrFieldand its value to theFList.voidAdds a field to theFListand assigns it a null value.voidset(Int64Field field, long value) Adds anInt64Fieldand its value to theFList.voidset(Int64Field field, Long value) Adds anInt64Fieldand its value to theFList.voidAdds anIntFieldand its value to theFList.voidAdds anIntFieldand its value to theFList.voidDeprecated.Num is no longer supported.voidDeprecated.Num is no longer supported.voidAdds aObjFieldand its value to theFList.voidAdds aPoidFieldand its value to theFList.voidAdds aStrFieldand its value to theFList.voidset(SubStructField field, FList value) Adds aSubStructFieldand its value to theFList.voidset(TStampField field, Date value) Adds aTStampFieldand its value to theFList.voidDeprecated.Uint is no longer supported.voidDeprecated.Uintis no longer supported.voidsetElement(ArrayField field, int elementID) Adds a null element to anArrayFieldin theFList.voidsetElement(ArrayField field, int elementID, FList value) Adds an element to anArrayFieldin theFList.voidDeprecated.This method is public to ensure operability.voidDeprecated.This method is public to ensure operability.This method allows you to obtain this FList as a JSON object.toJsonObject(Map<String, String> fieldMap) This method allows you to obtain this FList as a JSON object.This method allows you to obtain this FList as a JSON beautified string.toJsonString(Map<String, String> fieldMap) This method allows you to obtain this FList as a JSON beautified string.This method allows you to obtain this FList as a JSON compact string.toJsonStringCompact(Map<String, String> fieldMap) This method allows you to obtain this FList as a JSON compact string.toString()Deprecated.use asString() in stead.This method allows you to obtain this FList as an XML DocumenttoXMLDocument(int xmlType, boolean newStyle) An extended toXMLDocument method to support multiple XML formats.toXMLDocument(int xmlType, boolean newStyle, Map<String, String> fieldMap) An extended toXMLDocument method to support multiple XML formats.toXMLDocument(Map<String, String> fieldMap) This method allows you to obtain this FList as an XML DocumentThis method allows you to obtain this FList as an XML stringtoXMLString(int xmlType, boolean newStyle) An extended toXMLString method to support multiple XML formats.toXMLString(int xmlType, boolean newStyle, Map<String, String> fieldMap) An extended toXMLString method to support multiple XML formats.toXMLString(Map<String, String> fieldMap) This method allows you to obtain this FList as an XML stringvoidImplements the java.io.Externalizable interface.Methods inherited from class java.util.Hashtable
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, values
-
Field Details
-
nullObj
-
NEWLINE
-
-
Constructor Details
-
FList
public FList()Constructs an empty instance ofFList.
-
-
Method Details
-
deepClone
Copies all levels of anFList, including array elements and substructures. The copied fields and their values are duplicated, so no memory is shared between the twoFLists.- Parameters:
proto_vers- - The version of protocol- Returns:
- The duplicate
FList. - Throws:
EBufException
-
deepClone
Copies all levels of anFList, including array elements and substructures. The copied fields and their values are duplicated, so no memory is shared between the twoFLists.- Returns:
- The duplicate
FList. - Throws:
EBufException- results when an error occurs. Assumes caller is using 15.0 protocol version
-
append
Appends theFListpassed in onto the currentFList. Matching fields will be overwritten.- Parameters:
list- AnFListto append. It cannot be null.- Throws:
EBufException- thrown if an error occurs
-
writeExternal
Implements the java.io.Externalizable interface. This method writes the contents of this class to the output stream, which makes it available for future use. It's unlikely you will need to use this method.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- The destination for the output.- Throws:
IOException- thrown when an error occurs.
-
readExternal
Implements the java.io.Externalizable interface. This method reads the contents of this class saved by thewriteExternalmethod. It's unlikely you will need to use this method.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- The object containing the saved data.- Throws:
IOException- thrown when an error occurs.ClassNotFoundException- thrown when the class can't be found.
-
removeAllFields
public void removeAllFields()Clears theFListby removing all contained objects. -
remove
Removes a single field from anFList. Subfields cannot be removed, only whole arrays or substruct fields.- Parameters:
field- The field to remove.
-
getFields
Deprecated.see getAllFields()Returns an enumeration of the fields in theFList.- Returns:
- An enumeration of the fields.
-
getValues
Deprecated.see getAllValues()Returns an enumeration of the values in theFList.- Returns:
- An enumeration of the values.
-
getAllFields
Returns a set of the fields in theFList.- Returns:
- A Set of the fields.
-
getAllValues
Returns a collection of the values in theFList.- Returns:
- A collection of the values.
-
getSize
public int getSize()Returns the number of fields in theFList. Subfields are not counted.- Returns:
- The number of fields in
FList.
-
hasField
Checks theFListkeys for a specified field.- Parameters:
field- The field being requested.- Returns:
trueif theFListcontains the specified field, even if the field has a null value.
-
set
Adds a field to theFListand assigns it a null value. This method must be used to add a field that does not yet have a value. Specify the field name and type in the field object.- Parameters:
field- The field to add.
-
set
Adds anIntFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field's int type value. This value cannot be null.
-
set
Deprecated.Uint is no longer supported.Adds aUIntFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field's int type value. This value cannot be null.
-
set
Adds anEnumFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field's int type value. This value cannot be null.
-
set
Adds anIntFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sIntegertype value. This value cannot be null.
-
set
Deprecated.Uintis no longer supported.Adds aUIntFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sIntegertype value. This value cannot be null.
-
set
Adds anEnumFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sIntegertype value. This value cannot be null.
-
set
Deprecated.Num is no longer supported.Adds aNumFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field's double type value. This value cannot be null.
-
set
Deprecated.Num is no longer supported.Adds aNumFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sDoubletype value. This value cannot be null.
-
set
Adds aStrFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sStringtype value. This value cannot be null.
-
set
Adds aBufFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sBuffertype value. This value cannot be null.
-
set
Adds aPoidFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sPoidtype value. This value cannot be null.
-
set
Adds aTStampFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sDatetype value. This value cannot be null.
-
set
Adds anInt64Fieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sLongtype value. This value cannot be null.
-
set
Adds anInt64Fieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'slongtype value.
-
set
Adds anArrayFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sSparseArraytype value. This value cannot be null.
-
setElement
Adds an element to anArrayFieldin theFList.- Parameters:
field- The field to add.elementID- The element ID of the field to add to the array.value- The new element'sFListtype value. This value cannot be null.
-
setElement
Adds a null element to anArrayFieldin theFList.- Parameters:
field- The field to add.elementID- The element ID of the field to add to the array.
-
set
Adds aSubStructFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sFListtype value. This value cannot be null.
-
set
Adds aObjFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sPoidtype value. This value cannot be null.
-
set
Adds aBinStrFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field's byte[] type value. This value cannot be null.
-
set
Adds aErrFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sEBufExceptiontype value. This value cannot be null.
-
set
Adds aDecimalFieldand its value to theFList.- Parameters:
field- The field to add.value- The new field'sBigDecimaltype value. This value cannot be null.
-
get
Returns theIntegervalue associated with a field of typeIntField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Deprecated.Uint is no longer supported.Returns theIntegervalue associated with a field of typeUIntField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns theIntegervalue associated with a field of typeEnumField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Deprecated.Num is no longer supported.Returns theDoublevalue associated with a field of typeNumField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns theStringvalue associated with a field of typeStrField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns theBuffervalue associated with a field of typeBufField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns thePoidvalue associated with a field of typePoidField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns theDatevalue associated with a field of typeTStampField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns theLongvalue associated with a field of typeInt64Field.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns theSparseArrayvalue associated with a field of typeArrayField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
getElement
Returns an element associated with an array of typeArrayField.- Parameters:
field- TheArrayFieldobject from which to retrieve the element.elementID- The array element ID of the element to retrieve.- Returns:
- An
FListassociated with the field name and element ID. Its value can be null. - Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns anFListvalue associated with a field of typeSubstruct.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns aPoidvalue associated with a field of typeObjField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns a byte[] value associated with a field of typeBinStrField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns anEBufExceptionvalue associated with a field of typeErrField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
get
Returns aBigDecimalvalue associated with a field of typeDecimalField.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
getField
Returns anObjectvalue associated with a field of type field.- Parameters:
field- The field to look up.- Returns:
- The value associated with the field object. It can be null.
- Throws:
EBufException- occurs when the field doesn't exist.
-
setField
Deprecated.This method is public to ensure operability. It's for internal use only as it provides no type protection.Sets the value of an arbitrary field.- Parameters:
field- The field to set.value- The value of the field.
-
setField
Deprecated.This method is public to ensure operability. It's for internal use only as it provides no type protection.Sets the value of an arbitrary element in an array object.- Parameters:
fld- The field to set.elementID- The element to set.value- The value of the field.
-
createFromXML
Deprecated.As of 6.5SP2_EBF - this does not properly supportConverts the XML in the given stream into an FList- Parameters:
is- The input stream containing an XML representation of an FList- Returns:
- The FList represented by the given XML string
- Throws:
EBufException- double byte characters. Use the Reader form of the method instead.
-
createFromXML
Converts the XML in the given stream into an FList- Parameters:
reader- - The Reader object containing the XML representation of an FList- Returns:
- The FList represented by the given XML string
- Throws:
EBufException
-
toXMLString
This method allows you to obtain this FList as an XML string- Returns:
- The FList as an XML string
- Throws:
EBufException
-
toXMLString
This method allows you to obtain this FList as an XML string- Parameters:
fieldMap- A mapping between PIN_FLD names and custom names. To be used during XML transformation.- Returns:
- The FList as an XML string
- Throws:
EBufException
-
toXMLString
An extended toXMLString method to support multiple XML formats.- Parameters:
xmlType- The possible values are PIN_XML_TYPE, PIN_XML_BY_SHORT_NAME and PIN_XML_NOTIFICATION.newStyle- If yes, the fields are represented in Hungarian/Cammel Case notation. i.e BillInfo else the fields are represented as BILL_INFO- Returns:
- Returns XML in String representation in a String object.
- Throws:
EBufException- of different types.
-
toXMLString
public String toXMLString(int xmlType, boolean newStyle, Map<String, String> fieldMap) throws EBufExceptionAn extended toXMLString method to support multiple XML formats.- Parameters:
xmlType- The possible values are PIN_XML_TYPE, PIN_XML_BY_SHORT_NAME and PIN_XML_NOTIFICATION.newStyle- If yes, the fields are represented in Hungarian/Cammel Case notation. i.e BillInfo else the fields are represented as BILL_INFOfieldMap- A mapping between PIN_FLD names and custom names. To be used during XML transformation.- Returns:
- Returns XML in String representation in a String object.
- Throws:
EBufException- of different types.
-
toXMLDocument
This method allows you to obtain this FList as an XML Document- Returns:
- The FList as an XML Document
- Throws:
EBufException
-
toXMLDocument
This method allows you to obtain this FList as an XML Document- Parameters:
fieldMap- A mapping between PIN_FLD names and custom names. To be used during XML transformation.- Returns:
- The FList as an XML Document
- Throws:
EBufException
-
toXMLDocument
An extended toXMLDocument method to support multiple XML formats.- Parameters:
xmlType- The possible values are PIN_XML_TYPE, PIN_XML_BY_SHORT_NAME and PIN_XML_NOTIFICATION.newStyle- If yes, the fields are represented in Hungarian/Cammel Case notation. i.e BillInfo else the fields are represented as BILL_INFO- Returns:
- Returns XML in String representation in a String object.
- Throws:
EBufException- of different types.
-
toXMLDocument
public Document toXMLDocument(int xmlType, boolean newStyle, Map<String, String> fieldMap) throws EBufExceptionAn extended toXMLDocument method to support multiple XML formats.- Parameters:
xmlType- The possible values are PIN_XML_TYPE, PIN_XML_BY_SHORT_NAME and PIN_XML_NOTIFICATION.newStyle- If yes, the fields are represented in Hungarian/Cammel Case notation. i.e BillInfo else the fields are represented as BILL_INFOfieldMap- A mapping between PIN_FLD names and custom names. To be used during XML transformation.- Returns:
- Returns XML in String representation in a String object.
- Throws:
EBufException- of different types.
-
createFromJsonString
This method allows you to obtain FList from JSON String.- Parameters:
jsonString- Input json string.- Returns:
- The FList object converted from JSON String.
- Throws:
EBufException
-
createFromJsonObject
This method allows you to obtain FList from JsonNode Object.- Parameters:
jsonNode- Input JsonNode object representing flist.- Returns:
- The FList object converted from JSON String.
- Throws:
EBufException
-
toJsonString
This method allows you to obtain this FList as a JSON beautified string.- Returns:
- The FList as an JSOn String.
- Throws:
EBufException
-
toJsonString
This method allows you to obtain this FList as a JSON beautified string.- Parameters:
fieldMap- A mapping between PIN_FLD names and custom names. To be used during XML transformation.- Returns:
- The FList as an JSOn String.
- Throws:
EBufException
-
toJsonStringCompact
This method allows you to obtain this FList as a JSON compact string.- Returns:
- The FList as an JSON String.
- Throws:
EBufException
-
toJsonStringCompact
This method allows you to obtain this FList as a JSON compact string.- Parameters:
fieldMap- A mapping between PIN_FLD names and custom names. To be used during XML transformation.- Returns:
- The FList as an JSON String.
- Throws:
EBufException
-
toJsonObject
This method allows you to obtain this FList as a JSON object.- Returns:
- The FList as an JSON String.
- Throws:
EBufException
-
toJsonObject
This method allows you to obtain this FList as a JSON object.- Parameters:
fieldMap- A mapping between PIN_FLD names and custom names. To be used during XML transformation.- Returns:
- The FList as an JSON String.
- Throws:
EBufException
-
toString
Deprecated.use asString() in stead.Creates a string representation of theFList. This method can be restricted not to convert FList to String by providing the entry infranet.flist.tostring.enable=false in Infranet.properties file -
asString
Creates a string representation of theFList. This is un-restricted in the way if called it will return String conversion of FList.- Returns:
- A String representation of this
FList.
-
createFromString
Creates a newFListfrom a string representation.- Parameters:
str- A string descriptions of an flist. For example:0 PIN_FLD_POID POID [0] 0.0.0.1 /account -1 0 0 PIN_FLD_LAST_NAME STR [0] "Mouse" 0 PIN_FLD_FIRST_NAME STR [0] "Mickey" 0 PIN_FLD_INT_VAL INT [0] 42 ...- Returns:
- An
FListwith the key/value pairs specified in the string. - Throws:
EBufException- results when an error occurs.
-
createFromString
Creates a newFListfrom a string representation.- Parameters:
str- A String description of an FList. Specify the database portion of the string as '$DB' if you want to use thedefDBparameter.defDB- A specific database number. If thestrparameter contains the substring '$DB', the database number specified in this parameter replaces it and theFListreturned contains the database number. If thestrparameter contains a database number, thedefDBparameter is ignored.- Returns:
- An
FListwith the key/value pairs specified in the string. - Throws:
EBufException- results when an error occurs.- See Also:
-
dump
public void dump()Displays theFListto the standard output. -
parseBigDecimalNum
Parse the input string which is required by BigDecimal- Throws:
ParseException
-
formatBigDecimalNum
Formats BigDecimal To string
-