Class WebResponse

java.lang.Object
org.basex.http.web.WebResponse
Direct Known Subclasses:
WsResponse

public abstract class WebResponse extends Object
This abstract class defines common methods of Web responses.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Details

    • ctx

      protected final Context ctx
      Database context.
    • qc

      protected QueryContext qc
      Query context.
  • Constructor Details

    • WebResponse

      protected WebResponse(Context ctx)
      Constructor.
      Parameters:
      ctx - database context
  • Method Details

    • create

      public final WebResponse.Response create(WebFunction function, Object data, boolean body) throws QueryException, IOException, javax.servlet.ServletException
      Creates the Response.
      Parameters:
      function - function to be evaluated
      data - additional data (result, function, error, can be null)
      body - serialize body
      Returns:
      response type
      Throws:
      IOException - I/O Exception
      QueryException - query exception
      javax.servlet.ServletException - servlet exception
    • init

      protected abstract void init(WebFunction function) throws QueryException, IOException
      Creates and returns a function instance that can be evaluated.
      Parameters:
      function - function template
      Throws:
      QueryException - query exception
      IOException - I/O exception
    • bind

      protected abstract void bind(Expr[] args, Object data) throws QueryException, IOException
      Binds values to the function parameters.
      Parameters:
      args - arguments
      data - additional data (result, function, error, can be null)
      Throws:
      QueryException - query exception
      IOException - I/O exception
    • serialize

      protected abstract WebResponse.Response serialize(boolean body) throws QueryException, IOException, javax.servlet.ServletException
      Serializes the response.
      Parameters:
      body - serialize body (if false, only the headers will be assigned)
      Returns:
      response type
      Throws:
      QueryException - query exception
      IOException - I/O exception
      javax.servlet.ServletException - servlet exception