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(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(String propertyKey, Object value, Type type)
Add one more property with its value.boolean
equals(Object o)
Map<Class<?>,BeanModelNode>
getChildrenByType()
Returns a map of children by type.List<? extends BeanModelNode>
getChildrenNodes()
Class<?>
getNodeType()
Get the type of the settings owner represented by this node.Set<BeanModelNodeSeq<?>>
getSequenceProperties()
Gets the sequences of nodes registered as children.Map<String,Type>
getSettingsTypes()
Returns a map of property names to their type.Map<String,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
-
-
-
-
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
- 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 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.
-
getChildrenNodes
public List<? extends BeanModelNode> getChildrenNodes()
- Overrides:
getChildrenNodes
in classBeanModelNode
-
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.
-
accept
protected <U> void accept(BeanNodeVisitor<U> visitor, U data)
Description copied from class:BeanModelNode
Accepts a visitor.- Specified by:
accept
in classBeanModelNode
-
-