% MKSEntity is a class used to define the basic 
% entities exported by Cranium and Synapse. These 
% include chemicals, mixtures, techniques, and 
% references

% Version 2.0 - updated 2024-02-24
classdef MKSEntity < MKSBase
    
    % Properties
    properties
        props = MKSProperty.empty
        identifier = ""
        entityType = ""
    end

    % Methods
    methods

        % processJson - decoded json input
        function mksEnt = processJson(mksEnt, jsonStruct)

            % Parse each property structure
            for i = 1:numel(jsonStruct.Properties)

                % Create property object
                mksPrp = MKSProperty;

                % Parse json input
                mksPrp = mksPrp.processJson(jsonStruct.Properties(i));
                mksEnt.props(end+1) = mksPrp;
                
            end

            % Assign properties
            mksEnt.identifier = jsonStruct.Identifier;
            mksEnt.entityType = jsonStruct.EntityType;

        end
    end
end