psdi.app.rcncmprule

Class ComparisonRuleUtil

  • java.lang.Object
    • psdi.app.rcncmprule.ComparisonRuleUtil
  • All Implemented Interfaces:
    MboConstants


    public final class ComparisonRuleUtil
    extends java.lang.Object
    implements MboConstants
    Utility class for Comparison Rule.
    • Method Detail

      • throwNestedException

        public static void throwNestedException(MboRemote mbor,
                                                MXApplicationException mxae)
                                         throws MXException,
                                                java.rmi.RemoteException
        Static method to throw nested expression for Comparison Rule (include the tab name in the exception)
        Parameters:
        mbor -
        mxae -
        Throws:
        MXException
        java.rmi.RemoteException
      • throwNestedException

        public static void throwNestedException(MboSetRemote mbos,
                                                MXException mxe)
                                         throws MXException,
                                                java.rmi.RemoteException
        Static method to throw nested expression for Comparison Rule (include the tab name in the exception)
        Parameters:
        mbos -
        mxe -
        Throws:
        MXException
        java.rmi.RemoteException
      • isOperatorRequireValue

        public static boolean isOperatorRequireValue(java.lang.String strOpr)
        if Operator is NOTEMPTY or NOTNULL return false
        Parameters:
        strOpr -
        Returns:
      • replace

        public static final java.lang.String replace(java.lang.String s,
                                                     java.lang.String oldSubstring,
                                                     java.lang.String newSubstring)
        Replaces one substring with another. This method is similar to the String.replace() method, only it works with Strings instead of chars.
      • convertArrayToSQLString

        public static java.lang.String convertArrayToSQLString(java.lang.String[] stringArray)
        Convert a String array to a String to be used in a SQL statement
      • validClauseWithItem

        public static boolean validClauseWithItem(java.lang.String s)
        Validate the clause expression Do not allow:A+I, I+A Allow M (meaning A-I,I-A) only if it is the last expression A - ASSET I - ITEM M - MIX ASSET or ITEM (A-I or I-A) N - NOT Valid Note: This validation should come only after the main validation that make sure there are valid objects, operator and parenthesis
        Parameters:
        s - - clause expression
        Returns:
        A,I,M or N
      • prepareObjectsClauseString

        public static java.lang.String prepareObjectsClauseString(MboSetRemote mbos)
                                                           throws MXException,
                                                                  java.rmi.RemoteException
        Prepare clause for object evaluation The following characters are use: A - for Object ASSER or ASSETSPEC I - for Object ITEM or ITEMSPEC + - for Logical Operator AND - - for Logical Operator OR
        Parameters:
        mbos -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • updateUnitOfMeasureEnabledState

        public static boolean updateUnitOfMeasureEnabledState(Mbo mboAttrClause)
                                                       throws java.rmi.RemoteException,
                                                              MXException
        Updates the "enabled" state of the "Unit Of Measure" attribute.
        Returns:
        boolean The newly set "readonly" status of the "Unit of Measure" attribute.
        Throws:
        java.rmi.RemoteException
        MXException
      • calculateUnitOfMeasureReadOnlyState

        public static boolean calculateUnitOfMeasureReadOnlyState(Mbo mboAttrClause)
                                                           throws java.rmi.RemoteException,
                                                                  MXException
        Calculates the "Unit of Measure" attribute's "read-only" state as it has to be in the present situation. This method does NOT change the "read-only" or "required" states of the attribute.
        Parameters:
        mboAttrClause - An "Attribute Equality" MBO.
        Returns:
        The "read-only" state of the "Unit of Measure" attribute.
        Throws:
        java.rmi.RemoteException
        MXException