Package org.apache.wiki.ui
Class AbstractCommand
java.lang.Object
org.apache.wiki.ui.AbstractCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
GroupCommand,PageCommand,RedirectCommand,WikiCommand
Abstract, immutable Command implementation class. All of the fields in this class are
final. This class is thread-safe.- Since:
- 2.4.22
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCommand(String requestContext, String urlPattern, String contentTemplate, Object target) Constructs a new Command with a specified wiki context, URL pattern, content template and target. -
Method Summary
Modifier and TypeMethodDescriptionfinal Stringfinal StringgetJSP()protected final StringReturns the "friendly name" for this command's JSP, namely a beatified version of the JSP's name without the .jsp suffix.abstract StringgetName()final Stringfinal Objectfinal Stringabstract CommandtargetedCommand(Object target) final StringtoString()Returns a String representation of the Command.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.wiki.api.core.Command
requiredPermission
-
Constructor Details
-
AbstractCommand
protected AbstractCommand(String requestContext, String urlPattern, String contentTemplate, Object target) Constructs a new Command with a specified wiki context, URL pattern, content template and target. The URL pattern is used to derive the JSP; if it is a "local" JSP (that is, it does not contain thehttp://orhttps://prefixes), then the JSP will be a cleansed version of the URL pattern; symbols (such as%u) will be removed. If the supplied URL pattern points to a non-local destination, the JSP will be set to the value supplied, unmodified.- Parameters:
requestContext- the request contexturlPattern- the URL patterncontentTemplate- the content template; may benulltarget- the target of the command, such as a WikiPage; may benull- Throws:
IllegalArgumentException- if the request content or URL pattern isnull
-
-
Method Details
-
targetedCommand
- Specified by:
targetedCommandin interfaceCommand- See Also:
-
getContentTemplate
- Specified by:
getContentTemplatein interfaceCommand- See Also:
-
getJSP
-
getName
-
getRequestContext
- Specified by:
getRequestContextin interfaceCommand- See Also:
-
getTarget
-
getURLPattern
- Specified by:
getURLPatternin interfaceCommand- See Also:
-
getJSPFriendlyName
Returns the "friendly name" for this command's JSP, namely a beatified version of the JSP's name without the .jsp suffix.- Returns:
- the friendly name
-
toString
Returns a String representation of the Command.
-