Qore jni Module  1.1.0
org.qore.lang.mapper.Mapper Class Reference

Java wrapper for the Mapper.Mapper class in Qore. More...

Inheritance diagram for org.qore.lang.mapper.Mapper:
org.qore.jni.QoreObjectWrapper org.qore.lang.tablemapper.AbstractSqlStatementOutboundMapper org.qore.lang.tablemapper.InboundTableMapper org.qore.lang.tablemapper.RawSqlStatementOutboundMapper org.qore.lang.tablemapper.SqlStatementOutboundMapper org.qore.lang.tablemapper.InboundIdentityTableMapper

Public Member Methods

 Mapper (QoreObject obj)
 creates the object as a wrapper for the Qore object
 
Object getRuntime (String key) throws Throwable
 get current runtime option value for a key More...
 
String getFieldName (String fname) throws Throwable
 returns a descriptive name of the given field if possible, otherwise returns the field name itself
 
HashMap< String, Object > validKeys () throws Throwable
 returns a list of valid field keys for this class (can be overridden in subclasses) More...
 
HashMap< String, Object > validTypes () throws Throwable
 returns a list of valid field types for this class (can be overridden in subclasses) More...
 
HashMap< String, Object > optionKeys () throws Throwable
 returns a list of valid constructor options for this class (can be overridden in subclasses) More...
 
HashMap< String, Object > getInputRecord () throws Throwable
 returns the value of the "input" option More...
 
HashMap< String, Object > getOutputRecord () throws Throwable
 returns the value of the "output" option More...
 
HashMap< String, Object > [] mapAll (Map< String, Object >[] recs) throws Throwable
 maps all input records and returns the mapped data as a list of output records More...
 
HashMap< String, Object > [] mapAll (Map< String, Object > recs) throws Throwable
 maps all input records and returns the mapped data as a list of output records More...
 
HashMap< String, Object > mapData (Map< String, Object > rec) throws Throwable
 processes the input record and returns a Map<String, Object> of the mapped values where the keys in the Map<String, Object> returned are the target field names; the order of the fields in the Map<String, Object> returned is the same order as the keys in the map hash. More...
 
- Public Member Methods inherited from org.qore.jni.QoreObjectWrapper
 QoreObjectWrapper (QoreObject obj)
 creates the wrapper object with the Qore object
 
void release ()
 releases the Qore object; do not call any further methods on the object after this call
 
QoreObject getQoreObject ()
 returns the Qore object
 
String className ()
 returns the class name for the Qore object
 
boolean instanceOf (String class_name)
 returns true if the object is an instance of the given class
 

Additional Inherited Members

- Private Attributes inherited from org.qore.jni.QoreObjectWrapper
QoreObject obj
 the wrapper Qore object
 

Detailed Description

Java wrapper for the Mapper.Mapper class in Qore.

Note
Loads and initializes the Qore library and the jni module in static initialization if necessary

Member Function Documentation

◆ getInputRecord()

HashMap<String, Object> org.qore.lang.mapper.Mapper.getInputRecord ( ) throws Throwable
inline

returns the value of the "input" option

Note
null is returned if no input record is set

◆ getOutputRecord()

HashMap<String, Object> org.qore.lang.mapper.Mapper.getOutputRecord ( ) throws Throwable
inline

returns the value of the "output" option

Note
null is returned if no output record is set

◆ getRuntime()

Object org.qore.lang.mapper.Mapper.getRuntime ( String  key) throws Throwable
inline

get current runtime option value for a key

Parameters
keythe runtime option key
Returns
a runtime value if the key exists in the current runtime option hash and is set
See also
mapper_runtime_handling
Since
Mapper 1.1

◆ mapAll() [1/2]

HashMap<String, Object> [] org.qore.lang.mapper.Mapper.mapAll ( Map< String, Object > []  recs) throws Throwable
inline

maps all input records and returns the mapped data as a list of output records

this method applies the mapData() method to all input records and returns the resulting list

Parameters
recsthe list of input records
Returns
the mapped data as a list of output records
Exceptions
MISSING-INPUTa field marked mandatory is missing
STRING-TOO-LONGa field value exceeds the maximum value and the 'trunc' key is not set
INVALID-NUMBERthe field is marked as numeric but the input value contains non-numeric data

◆ mapAll() [2/2]

HashMap<String, Object> [] org.qore.lang.mapper.Mapper.mapAll ( Map< String, Object >  recs) throws Throwable
inline

maps all input records and returns the mapped data as a list of output records

this method applies the mapData() method to all input records and returns the resulting list

Parameters
recsa Map<String, Object> of lists of input records
Returns
the mapped data as a list of output records
Exceptions
MISSING-INPUTa field marked mandatory is missing
STRING-TOO-LONGa field value exceeds the maximum value and the 'trunc' key is not set
INVALID-NUMBERthe field is marked as numeric but the input value contains non-numeric data

◆ mapData()

HashMap<String, Object> org.qore.lang.mapper.Mapper.mapData ( Map< String, Object >  rec) throws Throwable
inline

processes the input record and returns a Map<String, Object> of the mapped values where the keys in the Map<String, Object> returned are the target field names; the order of the fields in the Map<String, Object> returned is the same order as the keys in the map hash.

Parameters
recthe record to translate
Returns
a Map<String, Object> of field values in the target format based on the input data and processed according to the logic in the map hash
Exceptions
MISSING-INPUTa field marked mandatory is missing
STRING-TOO-LONGa field value exceeds the maximum value and the 'trunc' key is not set
INVALID-NUMBERthe field is marked as numeric but the input value contains non-numeric data
Note
  • each time this method is executed successfully, the record count is updated (see getCount() and resetCount())
  • uses Mapper::Mapper::mapDataIntern() to map the data, then Mapper::Mapper::logOutput() is called for each output row

◆ optionKeys()

HashMap<String, Object> org.qore.lang.mapper.Mapper.optionKeys ( ) throws Throwable
inline

returns a list of valid constructor options for this class (can be overridden in subclasses)

Returns
a list of valid constructor options for this class (can be overridden in subclasses)

◆ validKeys()

HashMap<String, Object> org.qore.lang.mapper.Mapper.validKeys ( ) throws Throwable
inline

returns a list of valid field keys for this class (can be overridden in subclasses)

Returns
a list of valid field keys for this class (can be overridden in subclasses)

◆ validTypes()

HashMap<String, Object> org.qore.lang.mapper.Mapper.validTypes ( ) throws Throwable
inline

returns a list of valid field types for this class (can be overridden in subclasses)

Returns
a list of valid types for this class (can be overridden in subclasses)

The documentation for this class was generated from the following file: