◆ JsonBuilderElement()
FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.JsonBuilderElement | ( | ILogger< JsonBuilderElement > | logger, |
IEnumerable< JsonConverter > | jsonConverters, | ||
Func< IPipeline, FlowElementBase< IJsonBuilderElementData, IElementPropertyMetaData >, IJsonBuilderElementData > | elementDataFactory | ||
) |
Constructor
- Parameters
-
- logger - The logger for this instance to use.
- jsonConverters - A collection of JsonConverter instances that will be used when serializing the data.
- elementDataFactory - The factory function to use when creating a new element data instance.
Member Function Documentation
◆ AddErrors()
static void FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.AddErrors ( IFlowData data, Dictionary< String, object > allProperties ) static protectedAdd any errors in the flow data object to the dictionary
- Parameters
-
- data -
- allProperties -
- Exceptions
-
- ArgumentNullException - Thrown if one of the supplied parameters is null
◆ AddJsonValuesForProperty()
virtual void FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.AddJsonValuesForProperty ( IFlowData flowData, Dictionary< string, object > jsonValues, string dataPath, string name, object value, PipelineConfig config, bool includeValueDataOnly ) protected virtualAdd entries to the supplied jsonValues dictionary to represent the supplied property name and value.
- Parameters
-
- flowData - The IFlowData for the current request.
- jsonValues - A dictionary containing the key/value pairs that are going to appear in the JSON output. This method will add new entries to this dictionary for the supplied property.
- dataPath - The . separated name of the container that the supplied property will be added to. For example, 'location' or 'devices.profiles'
- name - The name of the property to add to jsonValues.
- value - The value of the property to add to jsonValues.
- config - The configuration to use.
- includeValueDataOnly - Flag used to indicate if additional meta-data properties should be written or not. These are needed when the JSON is going to be used by the
JavaScriptBuilderElement
to generate content for use on the client. They are not needed to simply serialize the values stored in aspect properties.- Exceptions
-
- ArgumentNullException - Thrown if required parameters are null
◆ BuildJson() [1/2]
virtual string FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.BuildJson ( IFlowData data, PipelineConfig config ) protected virtualCreate and populate a JSON string from the specified data.
- Parameters
-
- data -
- config - The configuration to use
- Returns
- A string containing the data in JSON format.
◆ BuildJson() [2/2]
static string FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.BuildJson ( Dictionary< string, object > allProperties ) static protectedBuild the JSON
- Parameters
-
- allProperties - A dictionary containing the data to convert to JSON. Key is the element data key. Value is a
containing the property names and values for that element.Dictionary\<string, object\>- Returns
◆ GetAllProperties()
virtual Dictionary<string, object> FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.GetAllProperties ( IFlowData data, PipelineConfig config ) protected virtualGet all the properties.
- Parameters
-
- data -
- config - The configuration to use
- Returns
- Exceptions
-
- ArgumentNullException - Thrown if the supplied flow data is null.
◆ GetJavaScriptProperties()
virtual IList<string> FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.GetJavaScriptProperties ( IFlowData data, IList< string > availableProperties ) protected virtualGet the names of all properties from the given IFlowData instance that have type 'JavaScript'.
- Parameters
-
- data - The IFlowData to get properties from.
- availableProperties - A list of the full string names (i.e. prefixed with the element data key for the element that populates that property) of the available properties in dot-separated format.
- Returns
- A list of the full string names of the properties that are of type 'JavaScript'
- Exceptions
-
- ArgumentNullException - Thrown if the supplied flow data is null.
◆ GetSequenceNumber()
static int FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.GetSequenceNumber ( IFlowData data ) static protectedGet the sequence number from the evidence.
- Parameters
-
- data -
- Returns
- Exceptions
-
- ArgumentNullException - Thrown if the supplied flow data is null.
- PipelineException - Thrown if sequence number is not present in the evidence.
◆ GetValues()
virtual Dictionary<string, object> FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.GetValues ( IFlowData flowData, string dataPath, IReadOnlyDictionary< string, object > sourceData, PipelineConfig config ) protected virtualGet the names and values for all the JSON properties required to represent the given source data.
The method adds meta-properties as required such as *nullreason, *delayexecution, etc.
- Parameters
-
- flowData - The IFlowData for the current request.
- dataPath - The . separated name of the container that the supplied data will be added to. For example, 'location' or 'devices.profiles'
- sourceData - The source data to use when populating the result.
- config - The configuration to use.
- Returns
- A new dictionary with string keys and object values.
- Exceptions
-
- ArgumentNullException - Thrown if required parameters are null
◆ ManagedResourcesCleanup()
override void FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.ManagedResourcesCleanup ( ) protected virtualCleanup of an managed resources.
Implements FiftyOne.Pipeline.Core.FlowElements.FlowElementBase< IJsonBuilderElementData, IElementPropertyMetaData >.
PipelineConfig config ) protected virtualGet the names and values for all the JSON properties required to represent the given source data.
The method adds meta-properties as required such as *nullreason, *delayexecution, etc.
- Parameters
-
- flowData - The IFlowData for the current request.
- dataPath - The . separated name of the container that the supplied data will be added to. For example, 'location' or 'devices.profiles'
- sourceData - The source data to use when populating the result.
- config - The configuration to use.
- Returns
- A new dictionary with string keys and object values.
- Exceptions
-
- ArgumentNullException - Thrown if required parameters are null
◆ ManagedResourcesCleanup()
override void FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.ManagedResourcesCleanup ( ) protected virtualCleanup of an managed resources.
Implements FiftyOne.Pipeline.Core.FlowElements.FlowElementBase< IJsonBuilderElementData, IElementPropertyMetaData >.
◆ ProcessInternal()
override void FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.ProcessInternal ( IFlowData data ) protectedTransform the data in the flow data instance into a JSON object.
- Parameters
-
- data - The IFlowData
- Exceptions
-
- ArgumentNullException - Thrown if the supplied flow data is null.
◆ UnmanagedResourcesCleanup()
override void FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.UnmanagedResourcesCleanup ( ) protected virtualCleanup any unmanaged resources
Implements FiftyOne.Pipeline.Core.FlowElements.FlowElementBase< IJsonBuilderElementData, IElementPropertyMetaData >.
Member Data Documentation
◆ ElementDataKey
override string FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.ElementDataKey => "json-builder" The key to identify this engine's element data instance within IFlowData.
◆ EvidenceKeyFilter
override IEvidenceKeyFilter FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.EvidenceKeyFilter Initial value:=>_evidenceKeyFilterA filter that identifies the evidence items that this element can make use of.
JsonBuilder does not make use of any evidence so this filter will never match anything.
◆ Properties
override IList<IElementPropertyMetaData> FiftyOne.Pipeline.JsonBuilder.FlowElement.JsonBuilderElement.Properties Initial value:=>_propertiesThe meta-data for the properties populated by this element.
- allProperties - A dictionary containing the data to convert to JSON. Key is the element data key. Value is a