Interface FieldArrayMapper


public interface FieldArrayMapper
Maps HFIELDDATAArray to List and Map and back.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    appendTypedMapping(DDC definition, Map<String,com.lexmark.saperion.PropertyType> properties, com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray existingProperties)
    This method maps the given properties to native types inserting them to an existing native field array.
    List<com.lexmark.saperion.PropertyType>
    genericMapping(com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray nativeData)
    Creates a list of Objects that matches the given native odbc fields
    com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray
    genericMapping(List<com.lexmark.saperion.PropertyType> objects)
    Creates a native odbc field array (HFIELDDATAArray) with values that match to the given java objects.
    Map<String,com.lexmark.saperion.PropertyType>
    typedMapping(DDC definition, com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray nativeData)
    Reads the values from the given native odbc field array to a named property map.
    com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray
    typedMapping(DDC definition, Map<String,com.lexmark.saperion.PropertyType> properties)
    Creates a native odbc field array (HFIELDDATAArray) with values that match to the given java objects.
  • Method Details

    • genericMapping

      com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray genericMapping(List<com.lexmark.saperion.PropertyType> objects) throws com.lexmark.saperion.exceptions.EcmException
      Creates a native odbc field array (HFIELDDATAArray) with values that match to the given java objects. Since saperion document definition can hold 200 fields maximum objects can at most have 200 elements.
      Parameters:
      objects - the objects to map to native odbc fields
      Returns:
      a native odbc field array (HFIELDDATAArray) with values that match to the given java objects.
      Throws:
      com.lexmark.saperion.exceptions.EcmException - if an element of objects cannot be matched or if objects.size() > 200
    • genericMapping

      List<com.lexmark.saperion.PropertyType> genericMapping(com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray nativeData) throws com.lexmark.saperion.exceptions.EcmException
      Creates a list of Objects that matches the given native odbc fields
      Parameters:
      nativeData - the native odbc fields
      Returns:
      a list of Objects that matches the given native odbc fields
      Throws:
      com.lexmark.saperion.exceptions.EcmException
    • typedMapping

      com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray typedMapping(DDC definition, Map<String,com.lexmark.saperion.PropertyType> properties) throws com.lexmark.saperion.exceptions.EcmException
      Creates a native odbc field array (HFIELDDATAArray) with values that match to the given java objects. Since saperion document definition can hold 200 fields maximum objects can at most have 200 elements. The result will hold values in the order they are defined in the definition identified by their name (in the definition and the given properties) and will have a type as defined in the definition.
      Parameters:
      definition - the DDC that defines the property types
      properties - the properties to map identified by name
      Returns:
      a native odbc field array (HFIELDDATAArray) with values that match to the given java objects
      Throws:
      com.lexmark.saperion.exceptions.EcmException - if an element of objects cannot be matched or if objects.size() > 200
    • appendTypedMapping

      void appendTypedMapping(DDC definition, Map<String,com.lexmark.saperion.PropertyType> properties, com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray existingProperties) throws com.lexmark.saperion.exceptions.EcmException
      This method maps the given properties to native types inserting them to an existing native field array. Fields not set in the input properties will not be changed in the existing properties.
      Parameters:
      definition - the DDC that defines the property types
      properties - the properties to map identified by name
      existingProperties - a native odbc field array (HFIELDDATAArray) to add the values that match to the given java objects
      Throws:
      com.lexmark.saperion.exceptions.EcmException - if an element of objects cannot be matched or if objects.size() > 200
    • typedMapping

      Map<String,com.lexmark.saperion.PropertyType> typedMapping(DDC definition, com.saperion.jna.applsrv.m2j.natives.HFIELDDATAArray nativeData) throws com.lexmark.saperion.exceptions.EcmException
      Reads the values from the given native odbc field array to a named property map. Obtains the type of every properties from the given definition
      Parameters:
      definition - the DDC that defines the property types
      nativeData - the native odbc field array to map
      Returns:
      the values from the given native odbc field array as a named property map.
      Throws:
      com.lexmark.saperion.exceptions.EcmException