|
Knopflerfish OSGi 3.2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knopflerfish.ant.taskdefs.bundle.BundlePackagesInfo
Class that holds the results of the Java package analysis of all classes in a bundle.
Class and package names should use either '/' or '.' as separator
between package levels during build up phase. When all classes
packages have been added, make a call to toJavaNames() to
convert all class / packages names using the internal Java
representation with '/' as separator to their non-internal
representation with '.' as separator.
Mixing of separator kinds is not supported!
When all classes have been added, before using the package using
map a call to postProcessUsingMap(Set,Set) should be done.
| Constructor Summary | |
BundlePackagesInfo(org.apache.tools.ant.Task task)
|
|
| Method Summary | |
void |
addProvidedActivatorClass(java.lang.String className)
Adds a named class to the set of classes that implements the interface BundleActivator. |
java.lang.String |
addProvidedClass(java.lang.String className)
Adds a named class to the set of classes provided by this bundle. |
void |
addProvidedPackage(java.lang.String packageName)
Adds a named package to the set of packages provided by this bundle. |
void |
addReferencedClass(java.lang.String referencingPackage,
java.lang.String referencedClass)
Add a reference to a named class from some class in the referencing Java package. |
int |
countProvidedActivatorClasses()
Gets the cardinality of the set of provided bundle activator classes. |
int |
countProvidedPackages()
Gets the cardinality of the set of provided Java packages. |
boolean |
equals(java.lang.Object other)
|
java.lang.String |
getActivatorClass()
Get the bundle activator from the set of provided bundle activator classes. |
java.util.SortedSet |
getPackagesReferencedFromPackage(java.lang.String packageName)
Get a the set of Java packages that are referenced by the given Java package. |
java.util.SortedSet |
getProvidedPackages()
Get a copy of the set of provided Java packages. |
java.lang.String |
getProvidedPackagesAsExportPackageValue()
Get the provided packages formatted as the value of an Export-Package-manifest attribute with package versions. |
Version |
getProvidedPackageVersion(java.lang.String pkgName)
Get the version of a provided package as defined by the packageinfo-file in the package-directory. |
java.lang.String |
getProvidedPackageVersionSource(java.lang.String pkgName)
Get the path of the file that the version of a provided package was found in. |
java.util.SortedSet |
getReferencedClasses()
Get a copy of the set of referenced Java classes. |
java.util.SortedSet |
getReferencedPackages()
Get a copy of the set of Java packages that are referenced by this bundle. |
java.util.SortedSet |
getUnprovidedReferencedPackages()
Get a the set of Java packages that are referenced by this bundle but not provided by it. |
static java.lang.String |
packageName(java.lang.String className)
Get package name of class string representation. |
void |
postProcessUsingMap(java.util.Set removeFromReferencedSets,
java.util.Set retainInReferencedSets)
Post process the package to referenced packages map. |
java.lang.String |
providedActivatorClassesAsString()
Return the set of provided activator classes as string suitable for use in messages. |
boolean |
providesActivatorClass(java.lang.String className)
Checks if a named class is in the set of provided activator classes. |
boolean |
providesClass(java.lang.String className)
Checks if a named class is provided by this bundle. |
boolean |
providesPackage(java.lang.String packageName)
Checks if a named Java package is provided by this bundle. |
void |
setPackageVersion(org.apache.tools.ant.types.Resource res)
Try to assign a version to the Java that the given packageinfo-file resides in. |
void |
toJavaNames()
Replaces all '/' in class and package names with '.' in all the collections that this class is holding. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public BundlePackagesInfo(org.apache.tools.ant.Task task)
| Method Detail |
public static java.lang.String packageName(java.lang.String className)
className - A fully qualified class name.
public java.lang.String addProvidedClass(java.lang.String className)
className - the name of the class to add.
public boolean providesClass(java.lang.String className)
className - the name of the class to check for.
true if the given class is in the set of
classes provided by this bundle, false
otherwise.public void addProvidedActivatorClass(java.lang.String className)
BundleActivator.
className - the name of the activator class to add.public int countProvidedActivatorClasses()
public boolean providesActivatorClass(java.lang.String className)
className - the name of the activator class to check for.
true if the given class is in the set of
provided activator classes, false otherwise.public java.lang.String providedActivatorClassesAsString()
public java.lang.String getActivatorClass()
null.public void addProvidedPackage(java.lang.String packageName)
packageName - the name of the Java package to add.public boolean providesPackage(java.lang.String packageName)
packageName - the name of the package to check for.
true if the given package is in the set of
packages provided by this bundle, false
otherwise.public java.util.SortedSet getProvidedPackages()
toJavaNames().
public java.lang.String getProvidedPackagesAsExportPackageValue()
public int countProvidedPackages()
public Version getProvidedPackageVersion(java.lang.String pkgName)
packageinfo-file in the package-directory.
pkgName - The package to get the version of.
public java.lang.String getProvidedPackageVersionSource(java.lang.String pkgName)
pkgName - The version-ed package to get the version source of.
packageinfo-file that the
version was read from.public void setPackageVersion(org.apache.tools.ant.types.Resource res)
packageinfo-file resides in. This code assumes that
the resource has been created in such a way that
res.getName() returns a relative path to the
packageinfo-file that starts in its package
root. I.e., the path is the Java package that the
packageinfo-file provides data for.
res - Resource encapsulating a packageinfo-file.public java.util.SortedSet getReferencedClasses()
public java.util.SortedSet getUnprovidedReferencedPackages()
public java.util.SortedSet getReferencedPackages()
public void addReferencedClass(java.lang.String referencingPackage,
java.lang.String referencedClass)
referencingPackage - The Java package of the class having a
reference to className.referencedClass - Fully qualified name of the referenced
class.
public void postProcessUsingMap(java.util.Set removeFromReferencedSets,
java.util.Set retainInReferencedSets)
removeFromReferencedSets - Packages to removeretainInReferencedSets - Packages to retain.public java.util.SortedSet getPackagesReferencedFromPackage(java.lang.String packageName)
packageName - The name of the Java package to get
referenced Java packages for.
public void toJavaNames()
public boolean equals(java.lang.Object other)
public java.lang.String toString()
|
Knopflerfish OSGi 3.2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||