|
OSGi™ Core Release 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.osgi.service.condpermadmin.ConditionInfo
public class ConditionInfo
Condition representation used by the Conditional Permission Admin service.
This class encapsulates two pieces of information: a Condition type
(class name), which must implement Condition
, and the arguments
passed to its constructor.
In order for a Condition represented by a ConditionInfo
to be
instantiated and considered during a permission check, its Condition class
must be available from the system classpath.
The Condition class must either:
getCondition
method that takes a
Bundle
object and a ConditionInfo
object as arguments. That
method must return an object that implements the Condition
interface.
Condition
interface and define a public constructor
that takes a Bundle
object and a ConditionInfo
object as
arguments.
Constructor Summary | |
---|---|
ConditionInfo(String encodedCondition)
Constructs a ConditionInfo object from the specified encoded
ConditionInfo string. |
|
ConditionInfo(String type,
String[] args)
Constructs a ConditionInfo from the specified type and args. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Determines the equality of two ConditionInfo objects. |
String[] |
getArgs()
Returns arguments of this ConditionInfo . |
String |
getEncoded()
Returns the string encoding of this ConditionInfo in a form
suitable for restoring this ConditionInfo . |
String |
getType()
Returns the fully qualified class name of the condition represented by this ConditionInfo . |
int |
hashCode()
Returns the hash code value for this object. |
String |
toString()
Returns the string representation of this ConditionInfo . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConditionInfo(String type, String[] args)
ConditionInfo
from the specified type and args.
type
- The fully qualified class name of the Condition represented
by this ConditionInfo
.args
- The arguments for the Condition. These arguments are
available to the newly created Condition by calling the
getArgs()
method.
NullPointerException
- If type
is null
.public ConditionInfo(String encodedCondition)
ConditionInfo
object from the specified encoded
ConditionInfo
string. White space in the encoded
ConditionInfo
string is ignored.
encodedCondition
- The encoded ConditionInfo
.
IllegalArgumentException
- If the specified
encodedCondition
is not properly formatted.getEncoded()
Method Detail |
---|
public final String getEncoded()
ConditionInfo
in a form
suitable for restoring this ConditionInfo
.
The encoded format is:
[type "arg0" "arg1" ...]where argN are strings that must be encoded for proper parsing. Specifically, the
"
, \
, carriage return, and line feed
characters must be escaped using \"
, \\
, \r
, and
\n
, respectively.
The encoded string contains no leading or trailing whitespace characters. A single space character is used between type and "arg0" and between the arguments.
ConditionInfo
.public String toString()
ConditionInfo
. The
string is created by calling the getEncoded
method on this
ConditionInfo
.
toString
in class Object
ConditionInfo
.public final String getType()
ConditionInfo
.
ConditionInfo
.public final String[] getArgs()
ConditionInfo
.
ConditionInfo
. An empty array is
returned if the ConditionInfo
has no arguments.public boolean equals(Object obj)
ConditionInfo
objects.
This method checks that specified object has the same type and args as
this ConditionInfo
object.
equals
in class Object
obj
- The object to test for equality with this
ConditionInfo
object.
true
if obj
is a ConditionInfo
, and has
the same type and args as this ConditionInfo
object;
false
otherwise.public int hashCode()
hashCode
in class Object
|
OSGi™ Core Release 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |