org.elkoserver.server.context.caps
Class ContextKeyCap
java.lang.Object
org.elkoserver.server.context.Mod
org.elkoserver.server.context.caps.Cap
org.elkoserver.server.context.caps.ContextKeyCap
- All Implemented Interfaces:
- Cloneable, DispatchTarget, Encodable, ContextKey, ItemMod, ObjectCompletionWatcher, UserMod
public class ContextKeyCap
- extends Cap
- implements ItemMod, UserMod, ContextKey
Capability to enable entry to one or more entry controlled contexts.
| Methods inherited from class org.elkoserver.server.context.Mod |
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object |
ContextKeyCap
@JSONMethod(value="contexts")
public ContextKeyCap(JSONObject raw,
String[] contexts)
throws JSONDecodingException
- JSON-driven constructor.
- Parameters:
contexts - Array of refs for the contexts to which this key grants
entry permission.
- Throws:
JSONDecodingException
enablesEntry
public boolean enablesEntry(String contextRef)
- Test if this capability enables entry to a particular context.
- Specified by:
enablesEntry in interface ContextKey
- Parameters:
contextRef - Reference string of the context of interest.
- Returns:
- true if this capability enables entry to the context designated
by 'contextRef', false if not.
encode
public JSONLiteral encode(EncodeControl control)
- Encode this mod for transmission or persistence.
- Specified by:
encode in interface Encodable
- Parameters:
control - Encode control determining what flavor of encoding
should be done.
- Returns:
- a JSON literal representing this object.