psdi.app.report

Class ExpressionHelper

  • java.lang.Object
    • psdi.app.report.ExpressionHelper
    • Field Detail

      • MX_NUMERIC_TYPES

        public static final java.lang.String[] MX_NUMERIC_TYPES
      • MX_DATE_TYPES

        public static final java.lang.String[] MX_DATE_TYPES
    • Constructor Detail

      • ExpressionHelper

        public ExpressionHelper()
    • Method Detail

      • isCompatibleDataType

        public static boolean isCompatibleDataType(java.lang.String mxDataType,
                                                   int jdbcDataType)
        Evaluates whether the specified Maximo data type is compatible with the specified type provided by the JDBC driver.
        Parameters:
        String - mxDataType the Maximo data type selected for the expression
        int - jdbcDataType the data type returned by the JDBC ResultSetMetaData for the calculated column
        Returns:
        true if the data types are compatible, false if not.
      • isCompatiblePrecision

        public static boolean isCompatiblePrecision(java.lang.String mxDataType,
                                                    int jdbcDataType)
        Determines if the mxDataType that is selected is less precise than the JDBC type.
        Parameters:
        mxDataType -
        jdbcDataType -
        Returns:
      • getExpressionDataType

        public static java.lang.Integer getExpressionDataType(java.lang.String expression,
                                                              java.lang.String objectName)
                                                       throws java.lang.Exception
        Validates the passed expression by executing a JDBC query against the passed object, Returns the resulting data type obtained from the ResultSetMetaData.
        Parameters:
        expression - the test expression
        objectName - the object to test the expression string against
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • isJDBCNumeric

        public static boolean isJDBCNumeric(int type)
        Determines whether the passed SQL data type from ResultSetMetaData is numeric.
        Parameters:
        type - the SQL data type
        Returns:
        true if the data type is numeric
      • isMxNumeric

        public static boolean isMxNumeric(java.lang.String type)
        Determines whether the passed Maximo data type is numeric.
        Parameters:
        type - the Maximo data type
        Returns:
        true if the data type is numeric
      • isJDBCDate

        public static boolean isJDBCDate(int type)
        Determines whether the passed SQL data type from ResultSetMetaData is a date type.
        Parameters:
        type - the SQL data type
        Returns:
        true if the data type is date, timestamp, or time
      • isMxDate

        public static boolean isMxDate(java.lang.String type)
        Determines whether the passed Maximo data type is a date type.
        Parameters:
        type - the Maximo data type
        Returns:
        true if the data type is date, timestamp, or time
      • isJDBCPrecise

        public static boolean isJDBCPrecise(int type)
        Determines whether the JDBC type is a type with a large precision.
        Parameters:
        type -
        Returns: