Class DefaultRSQLArgumentParser

    • Constructor Detail

      • DefaultRSQLArgumentParser

        public DefaultRSQLArgumentParser()
    • Method Detail

      • parseArguments

        public List<Object> parseArguments​(String selector,
                                           cz.jirutka.rsql.parser.ast.ComparisonOperator operator,
                                           List<String> arguments,
                                           Class<?> rootType)
        Description copied from interface: RSQLArgumentParser
        Returns string-based arguments into their real typed equivalents.
        Specified by:
        parseArguments in interface RSQLArgumentParser
        Parameters:
        selector - an RSQL selector, usually a field
        operator - operator from the selector to the arguments
        arguments - what will be parsed out
        rootType - the type that this is being parsed for. This is generally used at the repository layer so this is usually a repository class
        Returns:
        typed equivalents of arguments after parsing
      • parseArguments

        public List<Object> parseArguments​(String selector,
                                           cz.jirutka.rsql.parser.ast.ComparisonOperator operator,
                                           List<String> arguments,
                                           Class<?> rootType,
                                           FilterHelper.LinkField linkField)
        Description copied from interface: RSQLArgumentParser
        Returns string-based arguments into their real typed equivalents.
        Specified by:
        parseArguments in interface RSQLArgumentParser
        Parameters:
        selector - an RSQL selector, usually a field
        operator - operator from the selector to the arguments
        arguments - what will be parsed out
        rootType - the type that this is being parsed for. This is generally used at the repository layer so this is usually a repository class
        linkField - Specifies additional information for this selector denoting a Link annotated field. May be null if the selector does not reference a link field.
        Returns:
        typed equivalents of arguments after parsing
      • parseString

        protected String parseString​(String argument)
      • parseNumeric

        protected Number parseNumeric​(Class<?> selectorType,
                                      String argument)
        Parse a String into a number object. Strings containing integers are converted to Longs, while decimal strings are converted to BigDecimal.
        Parameters:
        selectorType - The type of the selector
        argument - the argument to convert
      • parseBoolean

        protected Boolean parseBoolean​(String argument)
        Parse a String into a Boolean object.
        Parameters:
        argument - the argument to convert