Class SimpleBeanModelNode


  • public class SimpleBeanModelNode
    extends BeanModelNode
    Represents a node in the settings owner tree, and stores the values of the properties that should be saved and restored. A node can have other nodes as children, in which case they are identified using their type at restore time. To persist the properties of multiple children with the same type, see SettingsPersistenceUtil.PersistentSequence and BeanModelNodeSeq.

    This intermediary representation decouples the XML representation from the business logic, allowing several parsers / serializers to coexist for different versions of the schema.

    Since:
    6.1.0
    Author:
    Clément Fournier
    • Constructor Detail

      • SimpleBeanModelNode

        public SimpleBeanModelNode​(Class<?> nodeType)
    • Method Detail

      • addProperty

        public void addProperty​(String propertyKey,
                                Object value,
                                Type type)
        Add one more property with its value.
        Parameters:
        propertyKey - Unique name identifying the property.
        value - Value
        type - Type of the property
      • addChild

        public void addChild​(BeanModelNodeSeq<?> seq)
        Add a sequence of nodes as a child of this node.
        Parameters:
        seq - Sequence of nodes
      • addChild

        public void addChild​(SimpleBeanModelNode child)
        Add a node to the children of this node.
        Parameters:
        child - Node
      • getSettingsValues

        public Map<String,​Object> getSettingsValues()
        Returns a map of property names to their value.
      • getSettingsTypes

        public Map<String,​Type> getSettingsTypes()
        Returns a map of property names to their type.
      • getChildrenByType

        public Map<Class<?>,​BeanModelNode> getChildrenByType()
        Returns a map of children by type.
      • getSequenceProperties

        public Set<BeanModelNodeSeq<?>> getSequenceProperties()
        Gets the sequences of nodes registered as children.
      • getNodeType

        public Class<?> getNodeType()
        Get the type of the settings owner represented by this node.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object