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.PersistentSequenceandBeanModelNodeSeq.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> voidaccept(BeanNodeVisitor<U> visitor, U data)Accepts a visitor.voidaddChild(BeanModelNodeSeq<?> seq)Add a sequence of nodes as a child of this node.voidaddChild(SimpleBeanModelNode child)Add a node to the children of this node.voidaddProperty(java.lang.String propertyKey, java.lang.Object value, java.lang.Class<?> type)Add one more property with its value.booleanequals(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.inthashCode()-
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:
getChildrenNodesin 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:BeanModelNodeAccepts a visitor.- Specified by:
acceptin classBeanModelNode
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-