This class encloses BundleIdentifiers mapped to their respective BundleDependencyLists. Each bundle identifier is associated with a dependency list that contains the kinds of dependencies, allowed version ranges, and meta-datas.
The dependencies in the class are contained in an ordered map, meaning that serializing and deserializing won't change the dependency iteration order.
Use create(
public static final BundleDependencyInformation | Singleton instance contanining no dependencies. |
public | For Externalizable. |
public static BundleDependencyInformation | create( Creates a new dependency information object that contains the dependencies specified in the argument. |
public boolean | Indicates whether some other object is "equal to" this one. |
public BundleDependencyInformation | filter( Creates a new dependency information by filtering the dependencies in this instance. |
public Map< | Gets the dependencies in this information. |
public BundleDependencyList | getDependencyList( Gets the dependency list for the argument bundle identifier. |
public boolean | Checks if this information contains any optional dependencies. |
public int | hashCode() Returns a hash code value for the object. |
public boolean | isEmpty() Checks if this information has any dependencies. |
public void | The object implements the readExternal method to restore its
contents by calling the methods of DataInput for primitive
types and readObject for objects, strings and arrays. |
public static BundleDependencyInformation | readFrom( Parses the bundle dependencies from the argument input stream in the format defined by this function. |
public String | toString() Returns a string representation of the object. |
public BundleDependencyInformation | Gets a dependency information object that contains the same dependencies as this , but without the
optional dependencies. |
public void | The object implements the writeExternal method to save its contents
by calling the methods of DataOutput for its primitive values or
calling the writeObject method of ObjectOutput for objects, strings,
and arrays. |
public void | writeTo( Writes this dependency information to the argument output stream in the format specified by
readFrom( |
null
.
The equals
method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
The equals
method for class Object
implements the most discriminating possible equivalence
relation on objects; that is, for any non-null reference values x
and y
, this method returns
true
if and only if x
and y
refer to the same object (x == y
has the value
true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden,
so as to maintain the general contract for the hashCode
method, which states that equal objects must have
equal hash codes.
true
if this object is the same as the obj argument; false
otherwise.this
instance.
The arugment transformation function will be called for all dependency present in this
instance. The
function may modify or omit the dependency passed to it.
If the function returns null
, the passed dependency will not be part of the result. In other cases,
the returned dependency list will be added to the result.
null
, and this
is not
empty.The keys in the returned map will have no version qualifiers.
null
if none.true
if there is at least one optional BundleDependency.
The general contract of hashCode
is:
- Whenever it is invoked on the same object more than once during an execution of a Java application, the
hashCode
method must consistently return the same integer, provided no information used inequals
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equals(Object)
method, then calling thehashCode
method on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal according to the
Object.equals(
Object) method, then calling thehashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by class Object
does return distinct
integers for distinct objects. (This is typically implemented by converting the internal address of the object
into an integer, but this implementation technique is not required by the Java™ programming language.)
true
if this information is empty.The dependencies are declared in 3 levels of white-space indented lines.
The first level contains the name of the bundle identifier that the dependency is declared on:
my.bundle ... second.dependency.bundle-q1-q2 ....The bundle identifiers may contain qualifiers, but no meta-qualifiers. Each bundle identifier may only occurr once. All dependency information for a bundle is written in the block following the bundle identifier.
In each indented block, the indentation characters must be the same. You can use one or more tabs or spaces, but make sure to use the same indentation throughout an indented block.
A dependency on a bundle consists of one or multiple dependency kinds, a version range, and optional meta-data:
my.bundle classpath: 1.0 kind2, kind3,, kind4: [0)The above shows two dependency declarations. The kind
classpath
is applied with the
version range of 1.0
. The dependency with kinds kind2
,
kind3
, kind4
is applied with the version range of [0)
.
A dependency declaration syntax consists of a dependency kind and version range separated by a colon character
(:
). Multiple kinds can be present separated by commas. Extraneous commas are ignored.
In the above, both dependency declarations are indented with 4 spaces. As mentioned above, this must stay consistend in a given block.
Dependency meta-datas can be declared for a given declaration:
my.bundle classpath: 1.0 optional: true meta2: custom-value with-spaces: hello world empty: quoted: "123" quoted: ""word"" multi-line: "1 2" eol-quote-escape: "1"\ 2" slash: \ slash-in-str: "\"There's two way the value of a meta-data declaration can be specified. As simple unquoted characters, or in quotes. Without any quotation, the value will be considered to start from the colon (
:
) and last
until the end of the line. Any white-space will be trimmed from it.
With quotes, the contents of the meta-data value will be all the characters until the first quote that is found
at the end of a line. Intermediate quotes don't need to be escaped. If the value needs to have quotes at the end
of a line and still continue, the backslash (\
) character needs to be appended to continue parsing
the value.
See the following for multi-line escaping examples:
meta1: "1st 2nd" meta2: "some"intermediate "quoted" meta3: "quotes at"\ line\\ end"In the above, the meta-data entries will be the following, with new lines as \n:
meta1
:1st
\n2nd
meta2
:some"intermediate
\n"quoted
meta3
:quotes
\nat"
\nline\
\nend
\n
.
As a convenience feature, the parser allows version ranges to contain the this
identifier. If found,
then it will be substituted by the version number of the declaring bundle identifier parameter (if any) for
dependencies that have the same name as the declaring bundle.
E.g. if the declaring bundle is my.bundle-v1.0
then the following:
my.bundle-q1 classpath: [this]Will be parsed as if it was the following:
my.bundle-q1 classpath: [1.0]Note that the
this
identifier will not be substituted if it is declared on a dependency that doesn't
have the same name as the declaring bundle. The following will result in a parsing error:
other.bundle classpath: [this]The error occurs as
other.bundle
has a different name than my.bundle
."this"
tokens in version ranges. May be
null
.null
.toString
method returns a string that
"textually represents" this object. The result should be a concise but informative representation that is easy
for a person to read. It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of
which the object is an instance, the at-sign character `@
', and the unsigned hexadecimal representation
of the hash code of the object. In other words, this method returns a string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
this
, but without the
optional dependencies.null
.