Protected
baseProtected
Readonly
contributionsProtected
latestReadonly
onEvent that emits to announce that the document has been rebuilt and the output has been updated
Protected
Readonly
optionsAdd or update one of the contribution documents for the composition process
Note: the order in which contribution documents are added can be considered indeterminate as it
depends on the order in which Map.forEach
iterates over the contributions. However, the order
matters when merging two arrays into one. Also, when options.ignoreDuplicateProperties
is is
true
, the order also matters when adding the same property to an object that is already
provided previously. Please let us know if you have trouble because of indeterminate
contribution ordering.
Name of the contributed document to combine
Content of the contributed document to combine
Recalculated output document given the new or updated contribution and existing other documents
Delete all present contribution documents for the composition process and return to the base document
Recalculated output document consisting only of the base document
Delete one of the contribution documents for the composition process
Name of the contributed document to delete
Recalculated output document given the remaining other documents
Run the document composition process given the starting document and all contributions. Throws if the output document fails to validate properly.
Recalculated output document given the starting and contributed documents
Protected
transformTransform the starting document that is given to the combiner. This transformation occurs after validating the base document and before combining any contributions.
WARNING: If you do not create the combiner with option copyDocuments: true
or clone inside
this method, this method will directly modify the baseDocument
passed in.
Initial input document. Already validated via validateBaseDocument
Transformed base document
Protected
transformTransform the contributed document associated with documentName
. This transformation occurs
after validating the contributed document and before combining with other documents.
WARNING: If you do not create the combiner with option copyDocuments: true
or clone inside
this method, this method will directly modify the contributed document
passed in.
Name of the contributed document to combine
Content of the contributed document to combine. Already validated via
validateContribution
Transformed contributed document
Protected
transformTransform the document that is the composition of the base document and all contribution
documents. This is the last step that will be run prior to validation via validateOutput
before this.latestOutput
is updated to the new output.
Final output document that could potentially be returned to callers. "Final" means no further contribution documents will be merged.
Update the starting document for composition process
Base JSON document/JS object that all other documents are added to
Recalculated output document given the new starting state and existing other documents
Protected
validateThrow an error if the provided document is not a valid starting document.
Base JSON document/JS object that all other documents are added to
Protected
validateThrow an error if the provided document is not a valid contribution document.
Name of the contributed document to combine
Content of the contributed document to combine
Protected
validateThrow an error if the provided output is not valid.
Output document that could potentially be returned to callers
Base class for any code that wants to compose JSON documents (primarily in the form of JS objects or arrays) together into a single output document.