Class RedirectCommand

java.lang.Object
org.apache.wiki.ui.AbstractCommand
org.apache.wiki.ui.RedirectCommand
All Implemented Interfaces:
Command

public final class RedirectCommand
extends AbstractCommand

Defines Commands for redirections to off-site special pages. RedirectCommands do not have associated permissions; the requiredPermission() method will always return null. When combined with a supplied String url, the AbstractCommand.getTarget() method will return a String, the AbstractCommand.getURLPattern() method will return the supplied target URL, and AbstractCommand.getJSP() method will return the "cleansed" URL.

Since:
2.4.22
  • Field Details

  • Method Details

    • targetedCommand

      public Command targetedCommand​(java.lang.Object target)
      Creates and returns a targeted Command by combining a URL (as String) with this Command. The supplied target object must be non-null and of type String. The URL passed to the constructor is actually an URL pattern, but it will be converted to a JSP page if it is a partial URL. If it is a full URL (beginning with http:// or https://), it will be "passed through" without conversion, and the URL pattern will be null.
      Specified by:
      targetedCommand in interface Command
      Specified by:
      targetedCommand in class AbstractCommand
      Parameters:
      target - the object to combine
      Returns:
      the new, targeted Command
      Throws:
      java.lang.IllegalArgumentException - if the target is not of the correct type
      See Also:
      Command.targetedCommand(Object)
    • getName

      public java.lang.String getName()
      Description copied from interface: Command
      Returns the human-friendly name for this command.
      Specified by:
      getName in interface Command
      Specified by:
      getName in class AbstractCommand
      Returns:
      the name
      See Also:
      Command.getName()
    • requiredPermission

      public java.security.Permission requiredPermission()
      No-op; always returns null.
      Returns:
      the required permission, or null if not required
      See Also:
      Command.requiredPermission()