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
public abstract class AbstractCommand extends java.lang.Object implements Command
Abstract, immutable Command implementation class. All of the fields in this class arefinal. This class is thread-safe.- Since:
- 2.4.22
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCommand(java.lang.String requestContext, java.lang.String urlPattern, java.lang.String contentTemplate, java.lang.Object target)Constructs a new Command with a specified wiki context, URL pattern, content template and target.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentTemplate()java.lang.StringgetJSP()protected java.lang.StringgetJSPFriendlyName()Returns the "friendly name" for this command's JSP, namely a beatified version of the JSP's name without the .jsp suffix.abstract java.lang.StringgetName()java.lang.StringgetRequestContext()java.lang.ObjectgetTarget()java.lang.StringgetURLPattern()abstract CommandtargetedCommand(java.lang.Object target)java.lang.StringtoString()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 Detail
-
AbstractCommand
protected AbstractCommand(java.lang.String requestContext, java.lang.String urlPattern, java.lang.String contentTemplate, java.lang.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:
java.lang.IllegalArgumentException- if the request content or URL pattern isnull
-
-
Method Detail
-
targetedCommand
public abstract Command targetedCommand(java.lang.Object target)
- Specified by:
targetedCommandin interfaceCommand- See Also:
Command.targetedCommand(Object)
-
getContentTemplate
public final java.lang.String getContentTemplate()
- Specified by:
getContentTemplatein interfaceCommand- See Also:
Command.getContentTemplate()
-
getJSP
public final java.lang.String getJSP()
- Specified by:
getJSPin interfaceCommand- See Also:
Command.getJSP()
-
getName
public abstract java.lang.String getName()
- Specified by:
getNamein interfaceCommand- See Also:
Command.getName()
-
getRequestContext
public final java.lang.String getRequestContext()
- Specified by:
getRequestContextin interfaceCommand- See Also:
Command.getRequestContext()
-
getTarget
public final java.lang.Object getTarget()
- Specified by:
getTargetin interfaceCommand- See Also:
Command.getTarget()
-
getURLPattern
public final java.lang.String getURLPattern()
- Specified by:
getURLPatternin interfaceCommand- See Also:
Command.getURLPattern()
-
getJSPFriendlyName
protected final java.lang.String 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
public final java.lang.String toString()
Returns a String representation of the Command.- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-