Class ImportedObject
java.lang.Object
io.jmix.dataimport.extractor.data.ImportedObject
- All Implemented Interfaces:
RawValuesSource
Represents an object in JSON or XML with the following info:
JSON example:
The "customer" object represents
- Data field name: for JSON - field name, for XML - tag name
- Raw values map: for JSON - raw values of JSON object fields by field names, for XML: values of child tags by tag names
JSON example:
The "customer" object represents
ImportedObject
with data field name = "customer" and two raw values: "name" and "email".
[ { "orderNumber": "#001", "orderDate": "12/07/2021", "orderAmount": 100, "customer": { "name": "Shelby Robinson", "email": "robinson@mail.com" } } ]
XML example:
The "customer" tag represents ImportedObject
with data field name = "customer" and two raw values: "name" and "email".
<orders> <order> <number>#001</number> <amount>50.5</amount> <date>12/02/2021 12:00</date> <customer> <name>Parker Leighton</name> <email>leighton@mail.com</email> </customer> </order> </orders>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddRawValue
(String dataFieldName, Object value) Adds a raw value of specified data fieldgetRawValue
(String dataFieldName) Gets a raw value of the specified data fieldvoid
setDataFieldName
(String dataFieldName) void
setRawValues
(Map<String, Object> rawValues) Sets a map containing raw values of data fields.toString()
-
Field Details
-
dataFieldName
-
rawValues
-
-
Constructor Details
-
ImportedObject
public ImportedObject()
-
-
Method Details
-
getRawValues
- Specified by:
getRawValues
in interfaceRawValuesSource
- Returns:
- map that contains raw values by data field names
-
setRawValues
Description copied from interface:RawValuesSource
Sets a map containing raw values of data fields.- Specified by:
setRawValues
in interfaceRawValuesSource
- Parameters:
rawValues
- map with raw values
-
getDataFieldName
-
setDataFieldName
-
addRawValue
Description copied from interface:RawValuesSource
Adds a raw value of specified data field- Specified by:
addRawValue
in interfaceRawValuesSource
- Parameters:
dataFieldName
- data field namevalue
- raw value- Returns:
- current instance of raw values source
-
getRawValue
Description copied from interface:RawValuesSource
Gets a raw value of the specified data field- Specified by:
getRawValue
in interfaceRawValuesSource
- Parameters:
dataFieldName
- data field name- Returns:
- extracted raw value
-
toString
-