Package snap.props

Class PropNode

java.lang.Object
snap.props.PropNode

public class PropNode extends Object
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 Details

    • PropNode

      public PropNode()
      Constructor.
  • Method Details

    • getClassName

      public String getClassName()
      Returns the native object class name.
    • setClassName

      public void setClassName(String aName)
      Sets the native object class name.
    • getXmlName

      public String getXmlName()
      Returns the XML name of node if from XML.
    • setXmlName

      public void setXmlName(String aValue)
      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

      public Object getPropValue(String aPropName)
      Returns a node value (String, PropNode, PropNode[]) for given prop name.
    • setPropValue

      public void setPropValue(String aPropName, Object nodeValue)
      Sets a node value (String, PropNode, PropNode[]) for given prop name.
    • setPropValue

      public void setPropValue(Prop aProp, Object nodeValue)
    • getPropValueAsString

      public String getPropValueAsString(String aPropName)
      Returns the prop value as string.
    • getPropValuesAsArray

      public PropNode[] getPropValuesAsArray()
      Returns all values as PropNode array.
    • getProps

      public List<Prop> getProps()
      Returns the list of configured props.
    • getPropNames

      public String[] getPropNames()
      Returns the list of configured prop names.
    • isEmpty

      public boolean isEmpty()
      Whether node is empty.
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • toStringProps

      public String toStringProps()
      Standard toStringProps implementation.