Class SerializationState


  • public class SerializationState
    extends Object
    This is for things like State and Module objects that are to be references by uuid when serializing/deserializing to prevent infinite recursion. As state and modules (which include state) gets serialized, this holds running accounts of unique elements which are in turn serialized individually for the workspace.

    Created by Jeff Gaynor
    on 2/10/22 at 4:52 PM

    • Field Detail

      • processedInstances

        public Map<UUID,​MIWrapper> processedInstances
        Note that the processed instances work in two ways. During serialization, this list makes sure ther is no infinite recursion since instances can reference other modules. During deserialization, this is populated as instances are created and then these are re-used as needed, again avoiding potentially having the deserialization run away.

        Templates are stored separately, but instances are recreated from local state as needed.
      • skipBadModules

        public boolean skipBadModules
        If a module is missing or otherwise fails to load, just skip it, don't exit loading.
    • Constructor Detail

      • SerializationState

        public SerializationState()
    • Method Detail

      • processedState

        public boolean processedState​(UUID uuid)
      • processedState

        public boolean processedState​(State state)
      • processedTemplate

        public boolean processedTemplate​(Module module)
      • processedTemplate

        public boolean processedTemplate​(UUID uuid)
      • processedInstance

        public boolean processedInstance​(Module module)
      • processedInstance

        public boolean processedInstance​(UUID uuid)
      • addState

        public boolean addState​(State state)
        The state, returning true if it was added and false otherwise.
        Parameters:
        state -
        Returns:
      • getState

        public State getState​(UUID uuid)
      • getTemplate

        public Module getTemplate​(UUID uuid)
      • addTemplate

        public boolean addTemplate​(Module module)
      • addTemplates

        public void addTemplates​(MTStack templates)
      • addInstance

        public boolean addInstance​(MIWrapper miWrapper)
      • hasTemplates

        public boolean hasTemplates()
      • getVersion

        public String getVersion()
      • setVersion

        public void setVersion​(String version)
      • isVersion2_0

        public boolean isVersion2_0()
      • isFailOnMissingModules

        public boolean isFailOnMissingModules()
      • setFailOnMissingModules

        public void setFailOnMissingModules​(boolean failOnMissingModules)
      • getVariablesSerializationVersion

        public String getVariablesSerializationVersion()
      • setVariablesSerializationVersion

        public void setVariablesSerializationVersion​(String variablesSerializationVersion)
      • hasVariablesSerializationVersion

        public boolean hasVariablesSerializationVersion()