Class ResponsePolicyDecision

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class ResponsePolicyDecision extends PolicyDecision

A policy decision for resource responses.

WebKitResponsePolicyDecision represents a policy decision for a resource response, whether from the network or the local system. A very common use case for these types of decision is deciding whether or not to download a particular resource or to load it normally.

  • Constructor Details

    • ResponsePolicyDecision

      public ResponsePolicyDecision(MemorySegment address)
      Create a ResponsePolicyDecision instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • ResponsePolicyDecision

      public ResponsePolicyDecision()
      Create a new ResponsePolicyDecision.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the ResponsePolicyDecision class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected ResponsePolicyDecision asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class PolicyDecision
      Returns:
      the instance as if it were its parent type
    • getRequest

      public URIRequest getRequest()

      Return the WebKitURIRequest associated with the response decision.

      Modifications to the returned object are not taken into account when the request is sent over the network, and is intended only to aid in evaluating whether a response decision should be taken or not. To modify requests before they are sent over the network the WebKitPage::send-request signal can be used instead.

      Returns:
      The URI request that is associated with this policy decision.
    • getResponse

      public URIResponse getResponse()
      Gets the value of the WebKitResponsePolicyDecision:response property.
      Returns:
      The URI response that is associated with this policy decision.
    • isMainFrameMainResource

      public boolean isMainFrameMainResource()
      Gets whether the request is the main frame main resource
      Returns:
      true if the request is the main frame main resouce or false otherwise
      Since:
      2.40
    • isMimeTypeSupported

      public boolean isMimeTypeSupported()

      Gets whether the MIME type of the response can be displayed in the WebKitWebView.

      Gets whether the MIME type of the response can be displayed in the WebKitWebView that triggered this policy decision request. See also webkit_web_view_can_show_mime_type().

      Returns:
      true if the MIME type of the response is supported or false otherwise
      Since:
      2.4
    • builder

      A ResponsePolicyDecision.Builder object constructs a ResponsePolicyDecision with the specified properties. Use the various set...() methods to set properties, and finish construction with ResponsePolicyDecision.Builder.build().
      Returns:
      the builder object