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 TypeMethodDescriptionvoid
Appends theFList
passed 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 FList
createFromString
(String str) Creates a newFList
from a string representation.static FList
createFromString
(String str, long defDB) Creates a newFList
from a string representation.static FList
Deprecated.As of 6.5SP2_EBF - this does not properly supportstatic FList
createFromXML
(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.void
dump()
Displays theFList
to the standard output.static String
Formats BigDecimal To stringget
(ArrayField field) Returns theSparseArray
value associated with a field of typeArrayField
.byte[]
get
(BinStrField field) Returns a byte[] value associated with a field of typeBinStrField
.Returns theBuffer
value associated with a field of typeBufField
.get
(DecimalField field) Returns aBigDecimal
value associated with a field of typeDecimalField
.Returns theInteger
value associated with a field of typeEnumField
.Returns anEBufException
value associated with a field of typeErrField
.get
(Int64Field field) Returns theLong
value associated with a field of typeInt64Field
.Returns theInteger
value associated with a field of typeIntField
.Deprecated.Num is no longer supported.Returns aPoid
value associated with a field of typeObjField
.Returns thePoid
value associated with a field of typePoidField
.Returns theString
value associated with a field of typeStrField
.get
(SubStructField field) Returns anFList
value associated with a field of typeSubstruct
.get
(TStampField field) Returns theDate
value 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 anObject
value associated with a field of type field.Deprecated.see getAllFields()int
getSize()
Returns the number of fields in theFList
.Deprecated.see getAllValues()boolean
Checks theFList
keys for a specified field.static String
parseBigDecimalNum
(String valStr) Parse the input string which is required by BigDecimalvoid
Implements the java.io.Externalizable interface.void
Removes a single field from anFList
.void
Clears theFList
by removing all contained objects.void
set
(ArrayField field, SparseArray value) Adds anArrayField
and its value to theFList
.void
set
(BinStrField field, byte[] value) Adds aBinStrField
and its value to theFList
.void
Adds aBufField
and its value to theFList
.void
set
(DecimalField field, BigDecimal value) Adds aDecimalField
and its value to theFList
.void
Adds anEnumField
and its value to theFList
.void
Adds anEnumField
and its value to theFList
.void
set
(ErrField field, EBufException value) Adds aErrField
and its value to theFList
.void
Adds a field to theFList
and assigns it a null value.void
set
(Int64Field field, long value) Adds anInt64Field
and its value to theFList
.void
set
(Int64Field field, Long value) Adds anInt64Field
and its value to theFList
.void
Adds anIntField
and its value to theFList
.void
Adds anIntField
and its value to theFList
.void
Deprecated.Num is no longer supported.void
Deprecated.Num is no longer supported.void
Adds aObjField
and its value to theFList
.void
Adds aPoidField
and its value to theFList
.void
Adds aStrField
and its value to theFList
.void
set
(SubStructField field, FList value) Adds aSubStructField
and its value to theFList
.void
set
(TStampField field, Date value) Adds aTStampField
and its value to theFList
.void
Deprecated.Uint is no longer supported.void
Deprecated.Uint
is no longer supported.void
setElement
(ArrayField field, int elementID) Adds a null element to anArrayField
in theFList
.void
setElement
(ArrayField field, int elementID, FList value) Adds an element to anArrayField
in theFList
.void
Deprecated.This method is public to ensure operability.void
Deprecated.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 stringvoid
Implements 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 twoFList
s.- 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 twoFList
s.- Returns:
- The duplicate
FList
. - Throws:
EBufException
- results when an error occurs. Assumes caller is using 15.0 protocol version
-
append
Appends theFList
passed in onto the currentFList
. Matching fields will be overwritten.- Parameters:
list
- AnFList
to 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:
writeExternal
in 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 thewriteExternal
method. It's unlikely you will need to use this method.- Specified by:
readExternal
in 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 theFList
by 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 theFList
keys for a specified field.- Parameters:
field
- The field being requested.- Returns:
true
if theFList
contains the specified field, even if the field has a null value.
-
set
Adds a field to theFList
and 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 anIntField
and 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 aUIntField
and 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 anEnumField
and 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 anIntField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sInteger
type value. This value cannot be null.
-
set
Deprecated.Uint
is no longer supported.Adds aUIntField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sInteger
type value. This value cannot be null.
-
set
Adds anEnumField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sInteger
type value. This value cannot be null.
-
set
Deprecated.Num is no longer supported.Adds aNumField
and 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 aNumField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sDouble
type value. This value cannot be null.
-
set
Adds aStrField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sString
type value. This value cannot be null.
-
set
Adds aBufField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sBuffer
type value. This value cannot be null.
-
set
Adds aPoidField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sPoid
type value. This value cannot be null.
-
set
Adds aTStampField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sDate
type value. This value cannot be null.
-
set
Adds anInt64Field
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sLong
type value. This value cannot be null.
-
set
Adds anInt64Field
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'slong
type value.
-
set
Adds anArrayField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sSparseArray
type value. This value cannot be null.
-
setElement
Adds an element to anArrayField
in theFList
.- Parameters:
field
- The field to add.elementID
- The element ID of the field to add to the array.value
- The new element'sFList
type value. This value cannot be null.
-
setElement
Adds a null element to anArrayField
in theFList
.- Parameters:
field
- The field to add.elementID
- The element ID of the field to add to the array.
-
set
Adds aSubStructField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sFList
type value. This value cannot be null.
-
set
Adds aObjField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sPoid
type value. This value cannot be null.
-
set
Adds aBinStrField
and 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 aErrField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sEBufException
type value. This value cannot be null.
-
set
Adds aDecimalField
and its value to theFList
.- Parameters:
field
- The field to add.value
- The new field'sBigDecimal
type value. This value cannot be null.
-
get
Returns theInteger
value 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 theInteger
value 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 theInteger
value 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 theDouble
value 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 theString
value 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 theBuffer
value 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 thePoid
value 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 theDate
value 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 theLong
value 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 theSparseArray
value 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
- TheArrayField
object from which to retrieve the element.elementID
- The array element ID of the element to retrieve.- Returns:
- An
FList
associated with the field name and element ID. Its value can be null. - Throws:
EBufException
- occurs when the field doesn't exist.
-
get
Returns anFList
value 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 aPoid
value 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 anEBufException
value 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 aBigDecimal
value 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 anObject
value 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 newFList
from 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
FList
with the key/value pairs specified in the string. - Throws:
EBufException
- results when an error occurs.
-
createFromString
Creates a newFList
from 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 thedefDB
parameter.defDB
- A specific database number. If thestr
parameter contains the substring '$DB', the database number specified in this parameter replaces it and theFList
returned contains the database number. If thestr
parameter contains a database number, thedefDB
parameter is ignored.- Returns:
- An
FList
with the key/value pairs specified in the string. - Throws:
EBufException
- results when an error occurs.- See Also:
-
dump
public void dump()Displays theFList
to the standard output. -
parseBigDecimalNum
Parse the input string which is required by BigDecimal- Throws:
ParseException
-
formatBigDecimalNum
Formats BigDecimal To string
-