psdi.common.parse

Class AttributeNode

  • All Implemented Interfaces:
    TreeNode


    public class AttributeNode
    extends TreeNodeAdapter
    The attribute node returns the value of a Mbo attribute. The datatype of this node could be anything, depending on the attribute. As well as a public constructor, a factory method is given. This is so special nodes can be created for :yes and :no and others.
    • Constructor Summary

      Constructors 
      Constructor and Description
      AttributeNode(java.lang.String attribute)
      Constructor takes operands
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected java.lang.String childrenInfoString()
      Sub-classes should override this method to return the result of toString on each child, separated by new lines.
      static TreeNode createNode(java.lang.String attribute)
      Factory constructor may create special nodes of other types.
      int getAttributeDataType(MboRemote mbo)
      Figures out the type of node this is from the Maximo Data Dictionary.
      java.lang.String getAttributeName()
      Special method that simply returns the name of the attribute.
      boolean getBoolean(MboRemote mbo)
      Returns the value of the attribute as a Boolean.
      java.util.Date getDate(MboRemote mbo)
      Returns the value of the atribute as a Date/Time.
      double getDouble(MboRemote mbo)
      Returns the value of the attribute as a double.
      int getInt(MboRemote mbo)
      Returns the value of the attribute as an integer.
      int getNodeDataType()
      The data type of this node depends on the operation & maybe the types of the operands.
      java.lang.String getString(MboRemote mbo)
      Returns the value of the attribute as a String.
      java.math.BigDecimal handleFormulas(MboRemote mbo, java.lang.String formulaProp) 
      protected java.lang.String parentInfoString()
      Sub-classes should override this method to create a string which provides information for the parent node only.
      void setOperands(MboRemote mbo, java.util.Vector operands)
      Sets the operands for custom class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AttributeNode

        public AttributeNode(java.lang.String attribute)
        Constructor takes operands
    • Method Detail

      • createNode

        public static TreeNode createNode(java.lang.String attribute)
                                   throws ParseException
        Factory constructor may create special nodes of other types.
        Throws:
        ParseException
        See Also:
        psdi.util.parse.YesNode, psdi.util.parse.NoNode, psdi.util.parse.DateNode, psdi.util.parse.UserNode, psdi.util.parse.PersonNode
      • getAttributeName

        public java.lang.String getAttributeName()
        Special method that simply returns the name of the attribute.
      • getBoolean

        public boolean getBoolean(MboRemote mbo)
                           throws MXException,
                                  java.rmi.RemoteException
        Returns the value of the attribute as a Boolean.
        Throws:
        MXException
        java.rmi.RemoteException
      • getDate

        public java.util.Date getDate(MboRemote mbo)
                               throws MXException,
                                      java.rmi.RemoteException
        Returns the value of the atribute as a Date/Time.
        Throws:
        MXException
        java.rmi.RemoteException
      • getString

        public java.lang.String getString(MboRemote mbo)
                                   throws MXException,
                                          java.rmi.RemoteException
        Returns the value of the attribute as a String.
        Throws:
        MXException
        java.rmi.RemoteException
      • handleFormulas

        public java.math.BigDecimal handleFormulas(MboRemote mbo,
                                                   java.lang.String formulaProp)
                                            throws java.rmi.RemoteException,
                                                   MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getDouble

        public double getDouble(MboRemote mbo)
                         throws MXException,
                                java.rmi.RemoteException
        Returns the value of the attribute as a double.
        Throws:
        MXException
        java.rmi.RemoteException
      • getInt

        public int getInt(MboRemote mbo)
                   throws MXException,
                          java.rmi.RemoteException
        Returns the value of the attribute as an integer.
        Throws:
        MXException
        java.rmi.RemoteException
      • getNodeDataType

        public int getNodeDataType()
        The data type of this node depends on the operation & maybe the types of the operands. This node can potentially be a String or Number.
      • getAttributeDataType

        public int getAttributeDataType(MboRemote mbo)
                                 throws MXException,
                                        java.rmi.RemoteException
        Figures out the type of node this is from the Maximo Data Dictionary. YORN attributes are considered strings in this instance; Durations are numbers.
        Throws:
        MXException
        java.rmi.RemoteException
      • parentInfoString

        protected java.lang.String parentInfoString()
        Sub-classes should override this method to create a string which provides information for the parent node only. The string created should be a single line.
        Specified by:
        parentInfoString in class TreeNodeAdapter
      • childrenInfoString

        protected java.lang.String childrenInfoString()
        Sub-classes should override this method to return the result of toString on each child, separated by new lines. If the node has no children, this method should return null or the empty string. If the node has 3 children the output should look like:

        \n
        \n

        Note there is no new line character after the last child.

        Specified by:
        childrenInfoString in class TreeNodeAdapter
      • setOperands

        public void setOperands(MboRemote mbo,
                                java.util.Vector operands)
                         throws MXException,
                                java.rmi.RemoteException
        Description copied from interface: TreeNode
        Sets the operands for custom class.
        Throws:
        MXException
        java.rmi.RemoteException