Class GroupingExpression

    • Constructor Detail

      • GroupingExpression

        protected GroupingExpression​(java.lang.String image,
                                     java.lang.String label,
                                     java.lang.Integer level)
    • Method Detail

      • resolveLevel

        public void resolveLevel​(int level)
        Resolves the conceptual level of this expression. This level represents the type of data that is consumed by this expression, where level 0 is a single hit, level 1 is a group, level 2 is a list of groups, and so forth. This method verifies the input level against the expression type, and recursively resolves the level of all argument expressions.
        Parameters:
        level - The level of the input data.
        Throws:
        java.lang.IllegalArgumentException - Thrown if the level of this expression could not be resolved.
        java.lang.IllegalStateException - Thrown if type failed to accept the number of arguments provided.
      • getLevel

        public int getLevel()
        Returns the conceptual level of this expression.
        Returns:
        the level.
        Throws:
        java.lang.IllegalArgumentException - thrown if the level of this expression has not been resolved.
        See Also:
        resolveLevel(int)
      • getLevelOrNull

        protected final java.lang.Integer getLevelOrNull()
      • asString

        public static java.lang.String asString​(java.util.List<GroupingExpression> lst)
        Returns a string description of the given list of expressions. This is a comma-separated list of the expressions own GroupingNode.toString() output.
        Parameters:
        lst - The list of expressions to output.
        Returns:
        The string description.
      • asImage

        public static java.lang.String asImage​(java.lang.Object obj)
        Returns a string representation of an object that can be used in the 'image' constructor argument of GroupingNode. This method ensures that strings are quoted, and that all complex characters are escaped.
        Parameters:
        obj - The object to output.
        Returns:
        The string representation.
      • setLabel

        public GroupingExpression setLabel​(java.lang.String label)
        Description copied from class: GroupingNode
        Assigns a label to this grouping expression. The label is applied to the results of this expression so that they can be identified by the caller when processing the output.
        Overrides:
        setLabel in class GroupingNode
        Parameters:
        label - The label to assign to this.
        Returns:
        This, to allow chaining.