Package snap.props
Class PropNode
java.lang.Object
snap.props.PropNode
A class to represent a PropObject and its property values as both native and String values. This middle ground
greatly facilitates conversion of PropObjects to/from XML, JSON, etc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the native object class name.String[]
Returns the list of configured prop names.getProps()
Returns the list of configured props.getPropValue
(String aPropName) Returns a node value (String, PropNode, PropNode[]) for given prop name.getPropValueAsString
(String aPropName) Returns the prop value as string.PropNode[]
Returns all values as PropNode array.Returns the XML name of node if from XML.boolean
isEmpty()
Whether node is empty.boolean
Returns whether this PropNode needs to declare actual class namevoid
setClassName
(String aName) Sets the native object class name.void
setNeedsClassDeclaration
(boolean aValue) Sets whether this PropNode needs to declare actual class namevoid
setPropValue
(String aPropName, Object nodeValue) Sets a node value (String, PropNode, PropNode[]) for given prop name.void
setPropValue
(Prop aProp, Object nodeValue) void
setXmlName
(String aValue) Sets the XML name of node if from XML.toString()
Standard toString implementation.Standard toStringProps implementation.
-
Constructor Details
-
PropNode
public PropNode()Constructor.
-
-
Method Details
-
getClassName
Returns the native object class name. -
setClassName
Sets the native object class name. -
getXmlName
Returns the XML name of node if from XML. -
setXmlName
Sets the XML name of node if from XML. -
isNeedsClassDeclaration
public boolean isNeedsClassDeclaration()Returns whether this PropNode needs to declare actual class name -
setNeedsClassDeclaration
public void setNeedsClassDeclaration(boolean aValue) Sets whether this PropNode needs to declare actual class name -
getPropValue
Returns a node value (String, PropNode, PropNode[]) for given prop name. -
setPropValue
Sets a node value (String, PropNode, PropNode[]) for given prop name. -
setPropValue
-
getPropValueAsString
Returns the prop value as string. -
getPropValuesAsArray
Returns all values as PropNode array. -
getProps
Returns the list of configured props. -
getPropNames
Returns the list of configured prop names. -
isEmpty
public boolean isEmpty()Whether node is empty. -
toString
Standard toString implementation. -
toStringProps
Standard toStringProps implementation.
-