Class SimpleBeanModelNode
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.beans.BeanModelNode
-
- net.sourceforge.pmd.util.fxdesigner.util.beans.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, seeSettingsPersistenceUtil.PersistentSequence
andBeanModelNodeSeq
.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 Summary
Constructors Constructor Description SimpleBeanModelNode(java.lang.Class<?> nodeType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <U> void
accept(BeanNodeVisitor<U> visitor, U data)
Accepts a visitor.void
addChild(BeanModelNodeSeq<?> seq)
Add a sequence of nodes as a child of this node.void
addChild(SimpleBeanModelNode child)
Add a node to the children of this node.void
addProperty(java.lang.String propertyKey, java.lang.Object value, java.lang.Class<?> type)
Add one more property with its value.boolean
equals(java.lang.Object o)
java.util.Map<java.lang.Class<?>,BeanModelNode>
getChildrenByType()
Returns a map of children by type.java.util.List<? extends BeanModelNode>
getChildrenNodes()
java.lang.Class<?>
getNodeType()
Get the type of the settings owner represented by this node.java.util.Set<BeanModelNodeSeq<?>>
getSequenceProperties()
Gets the sequences of nodes registered as children.java.util.Map<java.lang.String,java.lang.Class<?>>
getSettingsTypes()
Returns a map of property names to their type.java.util.Map<java.lang.String,java.lang.Object>
getSettingsValues()
Returns a map of property names to their value.int
hashCode()
-
Methods inherited from class net.sourceforge.pmd.util.fxdesigner.util.beans.BeanModelNode
childrenAccept
-
-
-
-
Method Detail
-
addProperty
public void addProperty(java.lang.String propertyKey, java.lang.Object value, java.lang.Class<?> type)
Add one more property with its value.- Parameters:
propertyKey
- Unique name identifying the property.value
- Valuetype
- 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 java.util.Map<java.lang.String,java.lang.Object> getSettingsValues()
Returns a map of property names to their value.
-
getSettingsTypes
public java.util.Map<java.lang.String,java.lang.Class<?>> getSettingsTypes()
Returns a map of property names to their type.
-
getChildrenByType
public java.util.Map<java.lang.Class<?>,BeanModelNode> getChildrenByType()
Returns a map of children by type.
-
getChildrenNodes
public java.util.List<? extends BeanModelNode> getChildrenNodes()
- Overrides:
getChildrenNodes
in classBeanModelNode
-
getSequenceProperties
public java.util.Set<BeanModelNodeSeq<?>> getSequenceProperties()
Gets the sequences of nodes registered as children.
-
getNodeType
public java.lang.Class<?> getNodeType()
Get the type of the settings owner represented by this node.
-
accept
protected <U> void accept(BeanNodeVisitor<U> visitor, U data)
Description copied from class:BeanModelNode
Accepts a visitor.- Specified by:
accept
in classBeanModelNode
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-