com.ibm.tivoli.maximo.report.expr

Class SafeDivideValidator

  • All Implemented Interfaces:
    Node.Visitor


    public class SafeDivideValidator
    extends ValueCollector
    Divide By Attribute tests an expression and for cases when a field attribute is being used in the denominator of the expression. It also finds places where a Function or Literal is being used, since those can lead to Divide By Zero as well.
    • Constructor Detail

      • SafeDivideValidator

        public SafeDivideValidator(java.lang.String objectname)
    • Method Detail

      • accept

        public boolean accept(Node n)
                       throws java.rmi.RemoteException,
                              MXException
        Description copied from class: Collector
        Return true if this node can be accepted by the Collector
        Overrides:
        accept in class ValueCollector
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getDenominator

        public java.lang.String getDenominator(Node divOperand)
                                        throws java.rmi.RemoteException,
                                               MXException
        returns the attribute that is in the denominator
        Parameters:
        divOperand -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getDenominatorNode

        public Node getDenominatorNode(Node divOperand)
                                throws java.rmi.RemoteException,
                                       MXException
        Get the attribute/function/keyword node that is being used in the denominoator portion of the divide expression.
        Parameters:
        divOperand -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • findLiteralInGroup

        protected Node findLiteralInGroup(Node sib)
                                   throws java.rmi.RemoteException,
                                          MXException
        Throws:
        java.rmi.RemoteException
        MXException