Annotation Type ApiAction


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface ApiAction
    Registers an action with the API framework. This is then surfaced to callers. The list of parameters to the method is converted into HTTP style parameters. This is only processed if the Class also has an ApiModel annotation. An action method can return either void (and use default response settings) or an ApiResponse instance to provide custom data to be used in the response.
    See Also:
    TODO: List parameter mappings add more parameters
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean isDefault
      Specifies that this action is the default action for the specified HTTP method.
      java.lang.String method
      The HTTP Method to bind this action to.
      java.lang.String name
      A name for this action, which will be generated from the method name.
      java.lang.String resourcePath
      Allows specifying an alternate resource path to be used when constructing the HREF for the action.
      java.lang.String title
      Title of the Action, this is used in the Siren serialization and likely later surfaced as documentation.
      java.lang.String type
      The Content Type expected for the HTTP Request that triggers the action.
    • Element Detail

      • method

        java.lang.String method
        The HTTP Method to bind this action to.
        Returns:
        HTTP Method to Bind to
        Default:
        "POST"
      • name

        java.lang.String name
        A name for this action, which will be generated from the method name. For POST or PUT methods this will be passed as an ":operation" parameter like Sling operations. This parameter will be stripped before invoking the target action.
        Returns:
        name of the Action
        Default:
        ""
      • title

        java.lang.String title
        Title of the Action, this is used in the Siren serialization and likely later surfaced as documentation.
        Returns:
        the title of the Action
        Default:
        ""
      • type

        java.lang.String type
        The Content Type expected for the HTTP Request that triggers the action.
        Returns:
        The content type of the request
        Default:
        ""
      • isDefault

        boolean isDefault
        Specifies that this action is the default action for the specified HTTP method. When a request comes in to the resource and the framework cannot match an exact action for it it will be passed into this action. Only one default action is allowed per HTTP method, and none are required to be registered. Default actions are not serialized into the outputted JSON on a get.
        Returns:
        Whether or not this is the default action for the specified HTTP method
        Default:
        false
      • resourcePath

        java.lang.String resourcePath
        Allows specifying an alternate resource path to be used when constructing the HREF for the action. By default, the path of the current resource is used. This can be used to reference actions that are available at a specific URL instead of being available from the current resource.
        Returns:
        The resource path to use when constructing the HREF.
        Default:
        ""