Sign in Join
FPDoc Onlineexperiment

TJSONApplier class

In unit fpJsonApply

Component class for applying (merging) JSON objects

Declaration

pascal
TJSONApplier = class(TComponent)

Inheritance

  1. TJSONApplier
  2. TComponent
  3. TPersistent
  4. TObject

Description

The TJSONApplier class is a component that provides functionality to apply (merge) elements from one JSON object to another. It supports loading JSON objects from files or working with existing objects in memory, with various configuration options for controlling the merge behavior. The component can merge at specific paths within JSON structures, handle type conflicts, control case sensitivity, and manage object ownership.

Errors

Raises EJSON exceptions when:

  • Source or apply JSON objects are empty
  • JSON files do not contain valid JSON objects
  • Specified paths are not found in the JSON structures

See also

Properties

SourceJSONpublicSource JSON object to merge into
ApplyJSONpublicJSON object containing elements to apply to the source
DestJSONpublicDestination JSON object containing the merge result
OwnsJSONpublicSet specifying which JSON objects are owned by the component
SourceFileNamepublishedFilename to load source JSON from if SourceJSON is not set
SourcePathpublishedJSON path in source object where merging should start
ApplyFileNamepublishedFilename to load apply JSON from if ApplyJSON is not set
ApplyPathpublishedJSON path in apply object where merging data should be taken from
DestFileNamepublishedFilename to write the destination JSON to after merging
CloneSourcepublishedControls whether to make a clone copy of source JSON before applying changes
CaseInsensitivepublishedControls whether property name matching is case sensitive
ForceCorrectTypepublishedControls whether to overwrite properties when types differ between source and apply JSON
RemoveNonExistingpublishedControls whether to remove properties from source that do not exist in apply JSON
FormattedpublishedControls whether output JSON is formatted with indentation and line breaks

Methods

Applyprotected
SaveDestJSONprotected
destroypublicDestructor that frees owned JSON objects and cleans up resources
ExecutepublicExecutes the JSON merge operation from apply JSON to source JSON

Inherited

From TComponent (75)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle Create DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.