Interface Populator

All Known Implementing Classes:
LinearPopulator, MappedPopulator, SimplePopulator

public interface Populator
Author:
indroneel
  • Method Summary

    Modifier and Type
    Method
    Description
    create(dxt.moe.model.AnyData data, Class<?> targetType)
    Converts an AnyData to an object of the specified target type.
    populate(dxt.moe.model.AnyData data, String dataKey, TargetEntity entity, Object targetObj)
    Populates a target Java object using any data by invoking the provided method on the object.
  • Method Details

    • create

      Object create(dxt.moe.model.AnyData data, Class<?> targetType) throws dxt.moe.app.ConvertException
      Converts an AnyData to an object of the specified target type. The anydata encapsulates any one of a simple, linear or mapped data.
      Parameters:
      data - one of a simple, linear or mapped data to convert
      targetType - the target type to convert to
      Returns:
      an object of the specified target type
      Throws:
      dxt.moe.app.ConvertException - if the conversion fails
    • populate

      Status populate(dxt.moe.model.AnyData data, String dataKey, TargetEntity entity, Object targetObj) throws dxt.moe.app.ConvertException
      Populates a target Java object using any data by invoking the provided method on the object. The anydata encapsulates any one of a simple, linear or mapped data.
      Parameters:
      data - one of a simple, linear or mapped data
      dataKey - The key associated with the any data.
      entity - the target entity that encapsulates the target object and the method to invoke
      targetObj - the target Java object to populate
      Returns:
      a Status indicating the result of the population operation
      Throws:
      dxt.moe.app.ConvertException - if the population operation fails