|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wiki.ui.AbstractCommand
public abstract class AbstractCommand

Abstract, immutable Command implementation class. All of the fields in this
class are final. This class is thread-safe.
| Constructor Summary | |
|---|---|
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. |
| Method Summary | |
|---|---|
static Command[] |
allCommands()
Returns a defensively-created array of all static Commands. |
String |
getContentTemplate()
Returns the content template associated with a Command, such as PreferencesContent.jsp. |
String |
getJSP()
Returns the JSP associated with the Command. |
protected String |
getJSPFriendlyName()
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()
Returns the human-friendly name for this command. |
String |
getRequestContext()
Returns the request context associated with this Command. |
Object |
getTarget()
Returns the target associated with a Command, if it was created with one. |
String |
getURLPattern()
Returns the URL pattern associated with this Command. |
abstract Command |
targetedCommand(Object target)
Creates and returns a targeted Command by combining a target, such as a WikiPage or GroupPrincipal into the existing Command. |
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.ui.Command |
|---|
requiredPermission |
| Constructor Detail |
|---|
protected AbstractCommand(String requestContext,
String urlPattern,
String contentTemplate,
Object target)
http:// or https:// prefixes),
then the JSP will be a cleansed version of the URL pattern;
symbols (such as %u) will removed. If it the supplied
URL pattern points to a non-local destination, the JSP will be set
to the value supplied, unmodified.
requestContext - the request contexturlPattern - the URL patterncontentTemplate - the content template; may be nulltarget - the target of the command, such as a WikiPage; may be
null
IllegalArgumentException - if the request content or URL pattern is
null| Method Detail |
|---|
public static final Command[] allCommands()
public abstract Command targetedCommand(Object target)
Commandtarget object is of the
correct type. This method is guaranteed to return a non-null
Command (unless the target is an incorrect type).
targetedCommand in interface Commandtarget - the object to combine, such as a GroupPrincipal or WikiPage
Command.targetedCommand(Object)public final String getContentTemplate()
CommandPreferencesContent.jsp. For Commands that are not
page-related, this method will always return null.
Calling methods should always check to see if the result
of this method is null.
getContentTemplate in interface CommandCommand.getContentTemplate()public final String getJSP()
Commandnull
result, although in some cases the result may be an empty string.
getJSP in interface CommandCommand.getJSP()public abstract String getName()
Command
getName in interface CommandCommand.getName()public final String getRequestContext()
Commandnull String.
getRequestContext in interface CommandCommand.getRequestContext()public final Object getTarget()
CommandCommand.targetedCommand(Object) will
always return a non-null object. Calling
methods should always check to see if the result of this method
is null.
getTarget in interface CommandCommand.getTarget()public final String getURLPattern()
Commandnull String.
getURLPattern in interface CommandCommand.getURLPattern()protected final String getJSPFriendlyName()
public final String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||