|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object users.AbstractCapability
public abstract class AbstractCapability
Convenience class implementing basic capability behavior.
For convenience you can derive all your capability classes from
AbstractCapability
, which will manage names and display names.
Constructor Summary | |
---|---|
AbstractCapability(String sName)
Create a new capability with a given name. |
Method Summary | |
---|---|
String |
getDisplayName()
Get the display name of this capability using the default locale. |
String |
getDisplayName(Locale l)
Get the display name of this capability according to a locale. |
String |
getName()
Get the capability's name. |
abstract Capability |
getToggled()
Get the capability that is the inverse to this one. |
abstract boolean |
isGranted()
Return the grant state of this capability. |
static void |
setDisplayNameResourceBundleName(String sBaseName)
Set the base name for the resouce bundle that contains the capabilities' display names. |
String |
toString()
Return a string representation of this capability. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractCapability(String sName)
sName
- the name of the capability.Method Detail |
---|
public String getName()
getName
in interface Capability
public String getDisplayName()
This is identical to
getDisplayName (Locale.getDefault());
getDisplayName
in interface Capability
public String getDisplayName(Locale l)
setDisplayNameResourceBundleName(java.lang.String)
.
getDisplayName
in interface Capability
l
- the locale according to which to get the display name
public abstract boolean isGranted()
isGranted
in interface Capability
public abstract Capability getToggled()
getToggled
in interface Capability
public String toString()
The format of the returned string is:
display name <name>: grant state
toString
in class Object
public static final void setDisplayNameResourceBundleName(String sBaseName)
capabilities.display_names.capability_name
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |