Class PageCommand

  • All Implemented Interfaces:
    Command

    public final class PageCommand
    extends AbstractCommand

    Defines Commands for editing, renaming, and viewing wiki pages. PageCommands can be combined with WikiPages to produce targeted Commands.

    Since:
    2.4.22
    • Method Detail

      • targetedCommand

        public Command targetedCommand​(java.lang.Object target)
        Creates and returns a targeted Command by combining a WikiPage with this Command. The supplied target object must be non-null and of type WikiPage.
        Specified by:
        targetedCommand in interface Command
        Specified by:
        targetedCommand in class AbstractCommand
        Parameters:
        target - the WikiPage to combine into the current Command
        Returns:
        the new targeted command
        Throws:
        java.lang.IllegalArgumentException - if the target is not of the correct type
        See Also:
        Command.targetedCommand(Object)
      • requiredPermission

        public java.security.Permission requiredPermission()
        Description copied from interface: Command
        Returns the Permission required to successfully execute this Command. If no Permission is required, this method returns null. For example, the static command org.apache.wiki.ui.PageCommand#VIEW doesn't require a permission because it isn't referring to a particular WikiPage. However, if this command targets a WikiPage called Main(via org.apache.wiki.ui.PageCommand#targetedCommand(Object), the resulting Command would require the permission PagePermission "yourWiki:Main", "view".
        Returns:
        the required permission, or null if not required
        See Also:
        Command.requiredPermission()