Class RestXqFunction

  • All Implemented Interfaces:
    Comparable<WebFunction>

    public final class RestXqFunction
    extends WebFunction
    This class represents a single RESTXQ function.
    Author:
    BaseX Team 2005-23, BSD License, Christian Gruen
    • Field Detail

      • path

        public org.basex.http.restxq.RestXqPath path
        Path (can be null).
    • Constructor Detail

      • RestXqFunction

        public RestXqFunction​(StaticFunc function,
                              WebModule module,
                              QueryContext qc)
        Constructor.
        Parameters:
        function - associated user function
        module - web module
        qc - query context
    • Method Detail

      • parseAnnotations

        public boolean parseAnnotations​(Context ctx)
                                 throws QueryException,
                                        IOException
        Description copied from class: WebFunction
        Checks a function for REST and permission annotations. This function is called both when a module is parsed, and when the function is prepared for evaluation.
        Specified by:
        parseAnnotations in class WebFunction
        Parameters:
        ctx - database context
        Returns:
        true if function contains relevant annotations
        Throws:
        QueryException - query exception
        IOException - I/O exception
      • matches

        public boolean matches​(HTTPConnection conn,
                               QNm err,
                               boolean perm)
        Checks if an HTTP request matches this function and its constraints.
        Parameters:
        conn - HTTP connection
        err - error code (assigned if error function is to be called)
        perm - permission flag
        Returns:
        result of check
      • consumedType

        public MediaType consumedType​(MediaType type)
        Returns the most specific consume type for the specified type.
        Parameters:
        type - media type
        Returns:
        most specific type
      • error

        public QueryException error​(String msg,
                                    Object... ext)
        Description copied from class: WebFunction
        Creates an exception with the specified message.
        Specified by:
        error in class WebFunction
        Parameters:
        msg - message
        ext - error extension
        Returns:
        exception
      • compareTo

        public int compareTo​(WebFunction func)