Class StopConditions


  • public class StopConditions
    extends Object
    Static methods for creating common Table.StopCondition's.
    • Constructor Detail

      • StopConditions

        public StopConditions()
    • Method Detail

      • endMarker

        public static Table.StopCondition endMarker​(Session session,
                                                    String markerField,
                                                    String markerValue,
                                                    boolean ignoreCase,
                                                    boolean testBefore,
                                                    boolean contains,
                                                    String isTrueFunction,
                                                    int maxPages)
        Returns a StopCondition where the end is indicated by a particular field having a particular value.
        Parameters:
        session - The session.
        markerField - The name of the marker field.
        markerValue - The value the marker field has when the end of the table is reached.
        ignoreCase - True if the text comparison should ignore case.
        testBefore - True if the test should be done before processing the page.
        contains - True if the text comparison should be contains() rather than equals().
        isTrueFunction - An optional javascript isTrue function.
        maxPages - the maximum number of pages to retrieve
        Returns:
        a StopCondition.
      • emptyMarker

        public static Table.StopCondition emptyMarker​(Session session,
                                                      String markerField,
                                                      boolean testBefore,
                                                      int maxPages)
        Returns a StopCondition where the end is indicated by a particular field becoming empty.
        Parameters:
        session - The session.
        markerField - The name of the marker field.
        testBefore - True if the test should be done before processing the page.
        maxPages - the maximum number of pages to retrieve
        Returns:
        a StopCondition.
      • twoFieldsMatch

        public static Table.StopCondition twoFieldsMatch​(Session session,
                                                         String markerField1,
                                                         String markerField2,
                                                         boolean ignoreCase,
                                                         boolean testBefore,
                                                         boolean contains,
                                                         int maxPages)
        Returns a StopCondition where the end is reached when two particular fields contain the same value. An example of this is "page x of y" where the "x" and the "y" are the two fields. When the "x" is equal to the "y", you're at the end.
        Parameters:
        session - The session.
        markerField1 - The name of the first marker field.
        markerField2 - The name of the second marker field.
        ignoreCase - True if the text comparison should ignore case.
        testBefore - True if the test should be done before processing the page.
        contains - True if the text comparison should be contains() rather than equals().
        maxPages - the maximum number of pages to retrieve
        Returns:
        a StopCondition.
      • columnContainsValue

        public static Table.StopCondition columnContainsValue​(Session session,
                                                              String markerField,
                                                              String markerValue,
                                                              boolean includeMarkerRow,
                                                              boolean ignoreCase,
                                                              boolean testBefore,
                                                              boolean contains,
                                                              int maxPages)
        Returns a StopCondition where the end is indicated by a particular column field having a particular value anywhere within it.
        Parameters:
        session - The session.
        markerField - The name of the marker column field.
        markerValue - The value the marker field contains when the end of the table is reached.
        includeMarkerRow - True if the row with the marker value in it should be included in the table's rows.
        ignoreCase - True if the text comparison should ignore case.
        testBefore - True if the test should be done before processing the page.
        contains - True if the text comparison should be contains() rather than equals().
        maxPages - the maximum number of pages to retrieve
        Returns:
        a StopCondition.
      • twoPagesMatch

        public static Table.StopCondition twoPagesMatch​(Session session,
                                                        Table table,
                                                        int maxPages)
        Returns a StopCondition where the end is reached when two consecutive pages match.
        Parameters:
        session - The session.
        table - The table.
        maxPages - the maximum number of pages to retrieve
        Returns:
        a StopCondition.
      • firstPageMatches

        public static Table.StopCondition firstPageMatches​(Session session,
                                                           Table table,
                                                           int maxPages)
        Returns a StopCondition where the end is reached when the first page appears again.
        Parameters:
        session - The session.
        table - The table.
        maxPages - the maximum number of pages to retrieve
        Returns:
        a StopCondition.
      • screenChanges

        public static Table.StopCondition screenChanges​(Session session,
                                                        com.rs.seagull.emulator.api.impl.TableImpl tableImpl,
                                                        int maxPages)
        Returns a StopCondition where the end is reached when the screen changes.
        Parameters:
        session - The session.
        tableImpl - The table.
        maxPages - the maximum number of pages to retrieve
        Returns:
        a StopCondition.
      • operatorError

        public static Table.StopCondition operatorError​(Session session,
                                                        com.rs.seagull.emulator.api.impl.TableImpl tableImpl,
                                                        int maxPages,
                                                        String resetKey)
        Returns a StopCondition where the end is reached when an operator error occurs.
        Parameters:
        session - The session.
        tableImpl - The table.
        maxPages - the maximum number of pages to retrieve
        resetKey - the reset key to use to reset an operator error
        Returns:
        a StopCondition.