fferpcore.DataSourceglobal with sharing abstract class DataSource The fferpcore.DataSource class is used to collate all of the fields required for a message and generate a query to obtain the values. It represents a list of input records for use with message generation. fferpcore.DataSource instances are used with the fferpcore.MessageDescriptionService to provide data from which to build messages. The service will use the fferpcore.MessageDescription to prepare the fferpcore.DataSource by asking it to require fields, lookups and one to many relationships. It will then query the fferpcore.DataSource and use the fferpcore.MessageDescription to generate the messages. Methods
requireFieldglobal virtual void requireField(SObjectField field) Requires that this data source queries the field provided. This method is called by the Declarative Publish framework or by custom message Nodes during the preparation phase of declarative message building. Input Parameters
Sample Code
requireFieldglobal virtual void requireField(String fieldName) This method is called by the Declarative Publish framework or by custom message Nodes during the preparation phase of declarative message building. Input Parameters
Sample Code
requireFieldglobal virtual void requireField(String fieldName, fferpcore.Intent intent) Ensure the given field is included in the data. Input Parameters
requireglobal virtual void require(fferpcore.Path path) Requires that this data source queries the path provided. This method is called by the Declarative Publish framework or by custom message Nodes during the preparation phase of declarative message building. Input Parameters
requireLookupFieldglobal abstract fferpcore.DataSource requireLookupField(SObjectField field) Requires that this data source queries the lookup provided. This method is called by the Declarative Publish framework or by custom message Nodes during the preparation phase of declarative message building. Input Parameters
Return ValueA DataSource representing the target of the lookup. Sample Code
requireLookupFieldglobal virtual fferpcore.DataSource requireLookupField(String name) Requires that this data source queries the lookup provided by its name. This method is called by the Declarative Publish framework or by custom message Nodes during the preparation phase of declarative message building. Input Parameters
Return ValueA DataSource representing the target of the lookup or null if one cannot be found. Sample Code
requireLookupFieldglobal virtual fferpcore.DataSource requireLookupField(String name, fferpcore.Intent intent) Ensure the given lookup is included in the data. Input Parameters
Return ValueThe DataSource of the related data. requireOneToManyFieldglobal virtual fferpcore.DataSource requireOneToManyField(fferpcore.DataSource.BackReference backReference) Ask that this data source to query the given Master/Detail relationship. This method is called by the Declarative Publish framework or by custom message Nodes during the preparation phase of declarative message building. Input Parameters
Return ValueA DataSource representing the target of the lookup. Sample Code
requireOneToManyFieldglobal virtual fferpcore.DataSource requireOneToManyField(String name) Ensure the given child data is included in the data. Input Parameters
Return ValueThe DataSource of the child data. requireOneToManyFieldglobal virtual fferpcore.DataSource requireOneToManyField(String name, fferpcore.Intent intent) Ensure the given child data is included in the data. Input Parameters
Return ValueThe DataSource of the child data. runQueryglobal abstract Iterator<fferpcore.DataSource.Row> runQuery() Load the data. This must only be performed on the top level DataSource, not any of the DataSources returned by the requireLookupField or requireOneToManyField methods. This method will be called by the Declarative Publish framework. Return ValueAn iterator of fferpcore.DataSource.Row objects containing the required data. Sample Code
fferpcore.DataSource.Rowglobal inherited sharing abstract class Row implements Navigable A Row in the result set of the Data Source. This class implements the following interfaces: Methods
getFieldValueglobal abstract Object getFieldValue(SObjectField field) Input Parameters
Return ValueThe value of the given field. If the field has not previously been requested, the behavior of this method is not guaranteed. Sample Code
getFieldValueglobal virtual Object getFieldValue(String field) Gets the value of a field using the field name string provided. This method was added in Foundations version 3.1. The base class implementation returns null. Input Parameters
Return ValueThe value of the given field. If the field has not previously been requested, the behavior of this method is not guaranteed. Sample Code
getRelationglobal abstract fferpcore.DataSource.Row getRelation(SObjectField field) Input Parameters
Return ValueA Row representing the requested object, or null if the lookup is null. If the field has not previously been requested, the behavior of this method is not guaranteed. Sample Code
getRelationglobal virtual fferpcore.DataSource.Row getRelation(String fieldName) Input Parameters
Return ValueA Row representing the requested object, or null if the lookup is null. If the field has not previously been requested, the behavior of this method is not guaranteed. Sample Code
getOneToManyglobal virtual Iterator<fferpcore.DataSource.Row> getOneToMany(fferpcore.DataSource.BackReference backReference) Input Parameters
Return ValueAn iterator of Rows representing the detail records for this master record. An empty iterator is returned if there are no detail rows. If the field has not previously been requested, the behavior of this method is not guaranteed. Sample Code
getOneToManyglobal virtual Iterator<fferpcore.DataSource.Row> getOneToMany(String fieldName) Obtain the child data with the given name. Input Parameters
Return ValueAn iterator of each child DataSource.Row. getValueglobal virtual Object getValue(fferpcore.Path path) Locates a specific value in the row at the given path. Input Parameters
Return ValueThe specific value at the given path. putglobal virtual void put(String fieldName, Object data) Set the data of the given field. Input Parameters
addErrorglobal virtual void addError(String fieldName, String errorMessage) Add an error to the given field. Input Parameters
fferpcore.DataSource.BackReferenceglobal inherited sharing virtual class BackReference Specifies the way in which a detail object relates to its master. Contains the detail ObjectType and lookup field. Designed for use as a key in maps. This class is immutable. Methods
BackReferenceglobal BackReference(SObjectType detailObjectType, SObjectField detailToMasterLookupField) Input Parameters
Sample Code
getDetailObjectTypeglobal SObjectType getDetailObjectType() Return ValueThe object type at the detail end of the link. See constructor for example use. getDetailToMasterLookupFieldglobal SObjectField getDetailToMasterLookupField() Return ValueThe field that the detail uses to reference its master. See constructor for example use. getParentObjectTypeglobal virtual SObjectType getParentObjectType() Return ValueThe parent SObjectType, if provided. getPrimaryKeyFieldglobal virtual SObjectField getPrimaryKeyField() Return ValueThe primary key field on the Master side of the relationship. The field that the back reference points to. This will be the ID field on the master. See constructor for example use. equalsglobal virtual Boolean equals(Object other) Implementation of the Equals method. Returns true if 'other' is an identical BackReference. hashCodeglobal virtual Integer hashCode() Implementation of the hashCode() method allowing use as Map keys and Set values. Hash codes returned are only expected to be stable within one execution context and cannot be shared across execution contexts. This may impact any attempt to serialise a Map or Set containing BackReferences. |