public final class PluginDescription extends java.lang.Object implements ISerializable, IExtension
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ABBREVIATION
The abbreviation used for this class during serialization.
|
static int |
EVENT_PROPERTY_ADDED
Signals that a property has been added to the description.
|
static int |
EVENT_PROPERTY_CHANGED
Signals that a property of the description has been changed.
|
static int |
EVENT_PROPERTY_REMOVED
Signals that a property is about to be removed.
|
EXTENSION_COMPRESSION, EXTENSION_DISCOVERY, EXTENSION_ENCRYPTION, EXTENSION_ROUTING, EXTENSION_SEMANTIC, EXTENSION_SERIALIZATION, EXTENSION_TRANSCEIVER
Constructor and Description |
---|
PluginDescription()
Creates a new plug-in description.
|
PluginDescription(short ability,
short extension)
Creates a new plug-in description with the specified ability and
the specified extension.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(int type,
IListener listener)
Registers a listener for the specified types of events.
|
boolean |
equals(java.lang.Object o)
Determines whether the passed object equals this plug-in
description.
|
short |
getAbility()
Returns the ability of the plug-in.
|
short |
getExtension()
Returns the extension point that is supported by this plug-in.
|
java.lang.String[] |
getProperties()
Returns the property names that are defined by this plug-in
description.
|
java.lang.Object |
getProperty(java.lang.String key)
Returns the property with the specified key or null if it
is not set.
|
int |
hashCode()
Returns the hash code of the plug-in description.
|
boolean |
hasProperty(java.lang.String key)
Determines whether the specified property is set.
|
boolean |
isPropertyDynamic(java.lang.String key)
Determines whether the property at the specified key is
dynamic.
|
void |
readObject(IObjectInput input)
Deserializes the description from the given input stream.
|
boolean |
removeListener(int type,
IListener listener)
Unregisters the specified listener from the specified set of event types.
|
java.lang.Object |
setProperty(java.lang.String key,
java.lang.Object property,
boolean dynamic)
Sets a property to the specified value.
|
java.lang.Object |
unsetProperty(java.lang.String key)
Removes a property with the specified key.
|
void |
writeObject(IObjectOutput output)
Serializes the description to the given output stream.
|
public static final java.lang.String ABBREVIATION
public static final int EVENT_PROPERTY_ADDED
public static final int EVENT_PROPERTY_CHANGED
public static final int EVENT_PROPERTY_REMOVED
public PluginDescription()
public PluginDescription(short ability, short extension)
ability
- The ability of the plu-gin. The ability must be globally
unique. The default policy to assign abilities is to use the most
significant byte as plug-in identifier and the least significant byte as
unique id. Note that the ability is used to match plug-ins on different
devices, thus if two plug-ins with different tasks have the same id,
you might not be able to communicate with a remote device.extension
- The extension point of the plug-in. The possible extensions
are defined as constants in the extension interface.public void addListener(int type, IListener listener)
type
- The types to register for.listener
- The listener to registerpublic boolean removeListener(int type, IListener listener) throws java.lang.NullPointerException
type
- The types to unregister for.listener
- The listener to unregister.java.lang.NullPointerException
- Thrown if the listener is null.public java.lang.Object setProperty(java.lang.String key, java.lang.Object property, boolean dynamic)
key
- The key of the property to set, this may not be
null.property
- The value of the property.dynamic
- A boolean that determines whether the property
is dynamic. Dynamic properties are only used for local
communication.public java.lang.Object unsetProperty(java.lang.String key)
key
- The key of the property to remove, this may not
be null.public boolean isPropertyDynamic(java.lang.String key)
key
- The key of the property.public java.lang.Object getProperty(java.lang.String key)
key
- The key of the property to retrieve, this may
not be null.public boolean hasProperty(java.lang.String key)
key
- The key of the property to retrieve, this may
not be null.public java.lang.String[] getProperties()
public short getAbility()
public short getExtension()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The object to compare.public int hashCode()
hashCode
in class java.lang.Object
public void readObject(IObjectInput input) throws java.io.IOException
readObject
in interface ISerializable
input
- The stream to read from.java.io.IOException
- Thrown if the deserialization fails.public void writeObject(IObjectOutput output) throws java.io.IOException
writeObject
in interface ISerializable
output
- The stream to write to.java.io.IOException
- Thrown if the serialization fails.