public final class KeyInfo extends Object
key info bit flags. Use this class as a utility to
get or set the bit flags when dealing with Message.KEY_INFO message.
The bit flags have following meaning:
KeyInfo.READABLE: if reading an existing key is supported.
KeyInfo.MODIFIABLE: if writing an existing key is supported.
KeyInfo.INSERTABLE if writing a new key is supported.
KeyInfo.INVOCABLE: if invoking an existing key is supported.
KeyInfo.REMOVABLE if removing an existing key is supported.
KeyInfo.INTERNAL if an existing key is internal.
KeyInfo.READ_SIDE_EFFECTS if Message.READ of the key value may have side-effects,
i.e. may change values of some keys, state of objects, etc.
KeyInfo.WRITE_SIDE_EFFECTS if Message.WRITE of the key value may have side-effects,
i.e. may change values of other keys, state of other objects, etc.
When a readable or writable flag is
true, it does not necessarily guarantee that subsequent Message.READ or
Message.WRITE message will succeed. Read or write can fail due to some momentary bad
state. An object field is expected not to be readable resp. writable when it's known that the
field can not be read (e.g. a bean property without a getter) resp. can not be written to (e.g. a
bean property without a setter). The same applies to invocable flag and Message.INVOKE
message.
| Modifier and Type | Field and Description |
|---|---|
static int |
INSERTABLE
Single bit that is set if
writing a new key is supported. |
static int |
INTERNAL
Single bit that is set if an existing key is internal.
|
static int |
INVOCABLE
Single bit that is set if
invoking an existing key is supported. |
static int |
MODIFIABLE
Single bit that is set if
writing an existing key is supported. |
static int |
NONE
Value of the key info if the key has no capability.
|
static int |
READ_SIDE_EFFECTS
Single bit that is set if
Message.READ may have side-effects. |
static int |
READABLE
Single bit that is set if
reading an existing key is supported. |
static int |
REMOVABLE
Single bit that is set if
removing an existing key is supported. |
static int |
WRITE_SIDE_EFFECTS
Single bit that is set if
Message.WRITE may have side-effects. |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasReadSideEffects(int infoBits)
Test if
Message.READ may have side-effects. |
static boolean |
hasWriteSideEffects(int infoBits)
Test if
Message.WRITE may have side-effects. |
static boolean |
isExisting(int infoBits)
Test if the bits represent an existing key.
|
static boolean |
isInsertable(int infoBits)
Test if
writing a new key is supported. |
static boolean |
isInternal(int infoBits)
Test if an existing key is internal.
|
static boolean |
isInvocable(int infoBits)
Test if
invoking an existing key is supported. |
static boolean |
isModifiable(int infoBits)
Test if
writing an existing key is supported. |
static boolean |
isReadable(int infoBits)
Test if
reading an existing key is supported. |
static boolean |
isRemovable(int infoBits)
Test if
writing a new key is supported. |
static boolean |
isWritable(int infoBits)
Test if
writing an existing or new key is supported. |
public static final int NONE
public static final int READABLE
reading an existing key is supported.KeyInfo.READ_SIDE_EFFECTS,
Constant Field Valuespublic static final int MODIFIABLE
writing an existing key is supported.KeyInfo.WRITE_SIDE_EFFECTS,
Constant Field Valuespublic static final int INVOCABLE
invoking an existing key is supported.public static final int INTERNAL
public static final int REMOVABLE
removing an existing key is supported.public static final int INSERTABLE
writing a new key is supported.public static final int READ_SIDE_EFFECTS
Message.READ may have side-effects. A read side-effect
means any change in runtime state that is observable by the guest language program. For
instance in JavaScript a property Message.READ may have side-effects if the property
has a getter function.public static final int WRITE_SIDE_EFFECTS
Message.WRITE may have side-effects. A write side-effect
means any change in runtime state, besides the write operation of the member, that is
observable by the guest language program. For instance in JavaScript a property
Message.WRITE may have side-effects if the property has a setter function.public static boolean isExisting(int infoBits)
public static boolean isReadable(int infoBits)
reading an existing key is supported.public static boolean isWritable(int infoBits)
writing an existing or new key is supported.public static boolean hasReadSideEffects(int infoBits)
Message.READ may have side-effects.public static boolean hasWriteSideEffects(int infoBits)
Message.WRITE may have side-effects.public static boolean isInvocable(int infoBits)
invoking an existing key is supported.public static boolean isInternal(int infoBits)
public static boolean isRemovable(int infoBits)
writing a new key is supported.public static boolean isModifiable(int infoBits)
writing an existing key is supported.public static boolean isInsertable(int infoBits)
writing a new key is supported.