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
ConstructorsModifierConstructorDescriptionprotected
AbstractCommand
(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 String
final String
getJSP()
protected final String
Returns the "friendly name" for this command's JSP, namely a beatified version of the JSP's name without the .jsp suffix.abstract String
getName()
final String
final Object
final String
abstract Command
targetedCommand
(Object target) final String
toString()
Returns a String representation of the Command.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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 benull
target
- 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:
targetedCommand
in interfaceCommand
- See Also:
-
getContentTemplate
- Specified by:
getContentTemplate
in interfaceCommand
- See Also:
-
getJSP
-
getName
-
getRequestContext
- Specified by:
getRequestContext
in interfaceCommand
- See Also:
-
getTarget
-
getURLPattern
- Specified by:
getURLPattern
in 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.
-