|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectaQute.bnd.osgi.Domain
aQute.bnd.osgi.Processor
aQute.bnd.osgi.Analyzer
public class Analyzer
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class aQute.bnd.osgi.Processor |
|---|
Processor.CL, Processor.FileLine |
| Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter |
|---|
Reporter.SetLocation |
| Nested classes/interfaces inherited from interface aQute.service.reporter.Report |
|---|
Report.Location |
| Field Summary | |
|---|---|
protected AnalyzerMessages |
msgs
|
| Fields inherited from class aQute.bnd.osgi.Processor |
|---|
LIST_SPLITTER |
| Constructor Summary | |
|---|---|
Analyzer()
|
|
Analyzer(Processor parent)
|
|
| Method Summary | |
|---|---|
String |
_bsn(String[] args)
|
String |
_classes(String... args)
|
String |
_ee(String[] args)
|
String |
_exporters(String[] args)
Get the exporter of a package ... |
String |
_exports(String[] args)
|
String |
_findname(String[] args)
|
String |
_findpath(String[] args)
Findpath looks through the contents of the JAR and finds paths that end with the given regular expression ${findpath (; reg-expr (; replacement)? )? } |
String |
_frange(String[] args)
Return a range expression for a filter from a version. |
String |
_imports(String[] args)
|
String |
_md5(String[] args)
|
String |
_sha1(String[] args)
|
void |
addClasspath(Collection<?> jars)
|
void |
addClasspath(File cp)
|
void |
addClasspath(Jar jar)
|
void |
analyze()
Calculates the data structures for generating a manifest. |
protected void |
begin()
|
Manifest |
calcManifest()
One of the main workhorses of this class. |
String |
calculateExportsFromContents(Jar bundle)
Calculate an export header solely based on the contents of a JAR file |
Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> |
cleanupUses(Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> apiUses,
boolean removeJava)
Remove the own references and optional java references from the uses lib |
static String |
cleanupVersion(String version)
|
void |
clear()
|
void |
close()
|
protected void |
doUses(Descriptors.PackageRef packageRef,
Packages exports,
Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> uses,
Packages imports)
|
Clazz |
findClass(Descriptors.TypeRef typeRef)
Find a clazz on the class path. |
Resource |
findResource(String path)
Locate a resource on the class path. |
Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> |
getAPIUses()
|
String |
getBndInfo(String key,
String defaultValue)
|
long |
getBndLastModified()
|
String |
getBndVersion()
Get the version for this bnd |
String |
getBsn()
Clear the key part of a header. |
Collection<Clazz> |
getClasses(String... args)
|
List<Jar> |
getClasspath()
|
Packages |
getClasspathExports()
|
Map<Descriptors.TypeRef,Clazz> |
getClassspace()
|
Set<Clazz> |
getClassspace(Descriptors.PackageRef source)
Return the classes for a given source package. |
Packages |
getContained()
|
Descriptors.Descriptor |
getDescriptor(String descriptor)
|
SortedSet<Clazz.JAVA> |
getEEs()
Return the EEs |
Packages |
getExports()
|
protected Jar |
getExtra()
|
Clazz.JAVA |
getHighestEE()
|
Packages |
getImports()
|
Jar |
getJar()
|
Jar |
getJarFromName(String name,
String from)
Try to get a Jar from a file name/path or a url, or in last resort from the classpath name part of their files. |
Clazz.JAVA |
getLowestEE()
|
static Properties |
getManifest(File dirOrJar)
Specifically for Maven |
File |
getOutputFile(String output)
Calculate the output file for the given target. |
Descriptors.PackageRef |
getPackageRef(String binaryName)
|
Set<Descriptors.PackageRef> |
getPrivates()
|
Packages |
getReferred()
|
Jar |
getTarget()
|
Descriptors.TypeRef |
getTypeRef(String binaryClassName)
|
Descriptors.TypeRef |
getTypeRefFromFQN(String fqn)
|
Descriptors.TypeRef |
getTypeRefFromPath(String path)
|
Set<Descriptors.PackageRef> |
getUnreachable()
Return the set of unreachable code depending on exports and the bundle activator. |
Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> |
getUses()
|
String |
getVersion()
Answer the bundle version. |
String |
getVersionPolicy(boolean implemented)
|
Map<Clazz.Def,List<Descriptors.TypeRef>> |
getXRef(Descriptors.PackageRef source,
Collection<Descriptors.PackageRef> dest,
int sourceModifiers)
Create a cross reference from package source, to packages in dest |
boolean |
isImported(Descriptors.PackageRef packageRef)
|
boolean |
isNoBundle()
|
void |
mergeManifest(Manifest manifest)
Merge the existing manifest with the instructions but do not override existing properties. |
void |
putAll(Map<String,String> additional,
boolean force)
|
boolean |
referred(Descriptors.PackageRef packageName)
|
void |
referTo(Descriptors.TypeRef ref)
|
void |
referToByBinaryName(String binaryClassName)
|
void |
report(Map<String,Object> table)
Report the details of this analyzer |
boolean |
save(File output,
boolean force)
Utility function to carefully save the file. |
void |
setBase(File file)
|
void |
setClasspath(File[] classpath)
Set the classpath for this analyzer by file. |
void |
setClasspath(Jar[] classpath)
|
void |
setClasspath(String[] classpath)
|
void |
setDefaults(String bsn,
Version version)
Set default import and export instructions if none are set |
void |
setDiagnostics(boolean b)
|
Jar |
setJar(File jar)
Set the JAR file we are going to work in. |
Jar |
setJar(Jar jar)
Set the JAR directly we are going to work on. |
String |
validResourcePath(String name,
String reportIfWrong)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final AnalyzerMessages msgs
| Constructor Detail |
|---|
public Analyzer(Processor parent)
public Analyzer()
| Method Detail |
|---|
public static Properties getManifest(File dirOrJar)
throws Exception
properties - the properties
Exception
public void analyze()
throws Exception
IOException
Exception
protected Jar getExtra()
throws Exception
Exception
public Manifest calcManifest()
throws Exception
IOException
Exceptionpublic String getBsn()
value -
public String _bsn(String[] args)
public String calculateExportsFromContents(Jar bundle)
bundle - The jar file to analyze
public Packages getContained()
public Packages getExports()
public Packages getImports()
public Set<Descriptors.PackageRef> getPrivates()
public Jar getJar()
public Packages getReferred()
public Set<Descriptors.PackageRef> getUnreachable()
public Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> getUses()
public Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> getAPIUses()
public Packages getClasspathExports()
public String getBndVersion()
public long getBndLastModified()
public String getBndInfo(String key,
String defaultValue)
public void mergeManifest(Manifest manifest)
throws IOException
manifest - The manifest to merge with
IOExceptionpublic void setBase(File file)
setBase in class Processor
public void setClasspath(File[] classpath)
throws IOException
classpath -
IOExceptionpublic void setClasspath(Jar[] classpath)
public void setClasspath(String[] classpath)
public Jar setJar(File jar)
throws IOException
jar -
IOExceptionpublic Jar setJar(Jar jar)
jar -
protected void begin()
begin in class Processor
public Jar getJarFromName(String name,
String from)
getJarFromName in class Processorname - URL or filename relative to the basefrom - Message identifying the caller for errors
public boolean referred(Descriptors.PackageRef packageName)
protected void doUses(Descriptors.PackageRef packageRef,
Packages exports,
Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> uses,
Packages imports)
packageName - exports - uses - imports - public void close()
close in interface Closeableclose in class Processorpublic String _findpath(String[] args)
args -
public String _findname(String[] args)
public void putAll(Map<String,String> additional,
boolean force)
public List<Jar> getClasspath()
public void addClasspath(Jar jar)
public void addClasspath(Collection<?> jars)
throws IOException
IOException
public void addClasspath(File cp)
throws IOException
IOExceptionpublic void clear()
clear in class Processorpublic Jar getTarget()
public static String cleanupVersion(String version)
public String getVersionPolicy(boolean implemented)
public String _classes(String... args)
throws Exception
Exception
public Collection<Clazz> getClasses(String... args)
throws Exception
Exception
public String _exporters(String[] args)
throws Exception
Exceptionpublic Map<Descriptors.TypeRef,Clazz> getClassspace()
public Resource findResource(String path)
path - Path of the reosurce
null
public Clazz findClass(Descriptors.TypeRef typeRef)
throws Exception
path -
Exceptionpublic String getVersion()
public boolean isNoBundle()
public void referTo(Descriptors.TypeRef ref)
public void referToByBinaryName(String binaryClassName)
public String _md5(String[] args)
throws Exception
Exception
public String _sha1(String[] args)
throws Exception
Exceptionpublic Descriptors.Descriptor getDescriptor(String descriptor)
public Descriptors.TypeRef getTypeRef(String binaryClassName)
public Descriptors.PackageRef getPackageRef(String binaryName)
public Descriptors.TypeRef getTypeRefFromFQN(String fqn)
public Descriptors.TypeRef getTypeRefFromPath(String path)
public boolean isImported(Descriptors.PackageRef packageRef)
public void setDiagnostics(boolean b)
public Clazz.JAVA getLowestEE()
public Clazz.JAVA getHighestEE()
public String _ee(String[] args)
public File getOutputFile(String output)
parameter given if not null and not directory if directory, this will be the output directory based on bsn-version.jar name of the source file if exists Untitled-[n]
output - may be null, otherwise a file path relative to base
public boolean save(File output,
boolean force)
throws Exception
output - the output file, if null getOutputFile(String) is
used.force - if it needs to be overwritten
Exception
public void setDefaults(String bsn,
Version version)
public Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> cleanupUses(Map<Descriptors.PackageRef,List<Descriptors.PackageRef>> apiUses,
boolean removeJava)
apiUses - removeJava -
public Set<Clazz> getClassspace(Descriptors.PackageRef source)
source - the source package
public Map<Clazz.Def,List<Descriptors.TypeRef>> getXRef(Descriptors.PackageRef source,
Collection<Descriptors.PackageRef> dest,
int sourceModifiers)
throws Exception
source - dest - sourceModifiers -
Exceptionpublic String _exports(String[] args)
public String _imports(String[] args)
public void report(Map<String,Object> table)
throws Exception
report in class ProcessorExceptionpublic SortedSet<Clazz.JAVA> getEEs()
public String _frange(String[] args)
${frange;1.2.3} -> (&(version>=1.2.3)(!(version>=1.3.0))
${frange;1.2.3, true} -> (&(version>=1.2.3)(!(version>=2.0.0))
public String validResourcePath(String name,
String reportIfWrong)
name -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||