|
||||||||||
| 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
public class Processor
| Nested Class Summary | |
|---|---|
static class |
Processor.CL
|
static class |
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 | |
|---|---|
static String |
LIST_SPLITTER
|
| Constructor Summary | |
|---|---|
Processor()
|
|
Processor(Processor child)
|
|
Processor(Properties parent)
|
|
| Method Summary | ||
|---|---|---|
String |
_basedir(String[] args)
|
|
String |
_native_capability(String[] args)
Generates a Capability string, in the format specified by the OSGi Provide-Capability header, representing the current native platform according to OSGi RFC 188. |
|
String |
_propertiesdir(String[] args)
|
|
String |
_propertiesname(String[] args)
|
|
String |
_random(String[] args)
Generate a random string, which is guaranteed to be a valid Java identifier (first character is an ASCII letter, subsequent characters are ASCII letters or numbers). |
|
void |
addBasicPlugin(Object plugin)
These plugins are added to the total list of plugins. |
|
void |
addClose(Closeable jar)
|
|
protected void |
addExtensions(Set<Object> plugins)
Is called when all plugins are loaded |
|
void |
addIncluded(File file)
|
|
void |
addProperties(File file)
|
|
void |
addProperties(Map<?,?> properties)
|
|
static String |
append(String... strings)
|
|
static String |
appendPath(String... parts)
Append two strings to for a path in a ZIP or JAR file. |
|
protected void |
begin()
|
|
protected Processor |
beginHandleErrors(String message)
Set the current command thread. |
|
boolean |
check(String... pattern)
|
|
void |
clear()
|
|
void |
close()
|
|
|
concat(Class<T> type,
T[] prefix,
T suffix)
Add an element to an array, creating a new one if necessary |
|
protected
|
customize(T plugin,
Attrs map)
Set the initial parameters of a plugin |
|
static Attrs |
doAttrbutes(Object[] attrs,
Clazz clazz,
Macro macro)
Parse the a=b strings and return a map of them. |
|
void |
doIncludeFile(File file,
boolean overwrite,
Properties target)
|
|
void |
doIncludeFile(File file,
boolean overwrite,
Properties target,
String extensionName)
|
|
protected void |
endHandleErrors(Processor previous)
End a command. |
|
Reporter.SetLocation |
error(String string,
Object... args)
Create an error. |
|
Reporter.SetLocation |
error(String string,
Throwable t,
Object... args)
|
|
Reporter.SetLocation |
exception(Throwable t,
String format,
Object... args)
Dedicated message for an exception. |
|
boolean |
exists()
|
|
static Processor.FileLine |
findHeader(File f,
Pattern header)
|
|
static Processor.FileLine |
findHeader(File f,
String header)
|
|
void |
forceRefresh()
|
|
static String |
formatArrays(String string,
Object... parms)
This method is the same as String.format but it makes sure that any arrays are transformed to strings. |
|
String |
get(String key)
Overrides for the Domain class |
|
String |
get(String key,
String deflt)
|
|
File |
getBase()
|
|
Class<?> |
getClass(String type,
File jar)
|
|
static long |
getDuration(String tm,
long dflt)
|
|
List<String> |
getErrors()
Return the errors. |
|
static Executor |
getExecutor()
|
|
static File |
getFile(File base,
String file)
|
|
File |
getFile(String file)
|
|
Properties |
getFlattenedProperties()
Return the properties but expand all macros. |
|
Properties |
getFlattenedProperties(boolean ignoreInstructions)
Return the properties but expand all macros. |
|
Processor.FileLine |
getHeader(Pattern header)
|
|
Processor.FileLine |
getHeader(String header)
Get a header relative to this processor, tking its parents and includes into account. |
|
List<File> |
getIncluded()
|
|
void |
getInfo(Reporter processor)
|
|
void |
getInfo(Reporter processor,
String prefix)
|
|
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. |
|
static int |
getLine(String s,
int index)
|
|
protected Processor.CL |
getLoader()
|
|
Report.Location |
getLocation(String msg)
Return the errors for the given error or warning. |
|
protected Object[] |
getMacroDomains()
This should be overridden by subclasses to add extra macro command domains on the search list. |
|
static Properties |
getManifestAsProperties(InputStream in)
Read a manifest but return a properties object. |
|
Processor |
getParent()
|
|
|
getPlugin(Class<T> clazz)
Returns the first plugin it can find of the given type. |
|
Set<Object> |
getPlugins()
Return a list of plugins. |
|
|
getPlugins(Class<T> clazz)
Return a list of plugins that implement the given class. |
|
Properties |
getProperties()
Property handling ... |
|
File |
getPropertiesFile()
|
|
String |
getProperty(String key)
|
|
String |
getProperty(String key,
String deflt)
Get a property with preprocessing it with a proper default |
|
String |
getProperty(String key,
String deflt,
String separator)
|
|
Set<String> |
getPropertyKeys(boolean inherit)
Return all inherited property keys |
|
Macro |
getReplacer()
|
|
Processor |
getTop()
|
|
String |
getUnprocessedProperty(String key,
String deflt)
Get a property without preprocessing it with a proper default |
|
List<String> |
getWarnings()
Return the warnings. |
|
boolean |
is(String propertyName)
Simplified way to check booleans |
|
static boolean |
isDuplicate(String name)
|
|
boolean |
isExceptions()
|
|
boolean |
isFailOk()
Indicates that this run should ignore errors and succeed anyway |
|
boolean |
isMissingPlugin(String name)
Answer if the name is a missing plugin's command name. |
|
boolean |
isOk()
Check if this report has any relevant errors that should make the run associated with this report invalid. |
|
boolean |
isPedantic()
The provider of the reporter wants pedantic reporting, meaning every possible warning should be reported. |
|
boolean |
isPerfect()
|
|
boolean |
isTrace()
|
|
static boolean |
isTrue(String value)
|
|
Iterator<String> |
iterator()
|
|
static String |
join(Collection<?>... list)
|
|
static String |
join(Collection<?> list,
String delimeter)
Join a list. |
|
static String |
join(Object[] list,
String delimeter)
|
|
static String |
join(String delimeter,
Collection<?>... list)
|
|
static
|
join(T[] list)
|
|
Set<String> |
keySet()
|
|
long |
lastModified()
|
|
protected void |
loadPlugins(Set<Object> instances,
String pluginString,
String pluginPathString)
Magic to load the plugins. |
|
Properties |
loadProperties(File file)
Helper to load a properties file from disk. |
|
static Object |
makePrintable(Object object)
Check if the object is an array and turn it into a string if it is, otherwise unchanged. |
|
static String |
merge(String... strings)
|
|
void |
mergeProperties(File file,
boolean override)
|
|
void |
mergeProperties(Properties properties,
boolean override)
|
|
String |
mergeProperties(String key)
Return merged properties. |
|
String |
mergeProperties(String key,
String separator)
|
|
static
|
newHashMap()
|
|
|
newList()
|
|
|
newList(Collection<T> t)
|
|
static
|
newMap()
|
|
|
newMap(Map<K,V> t)
|
|
|
newSet()
|
|
|
newSet(Collection<T> t)
|
|
String |
normalize(File f)
|
|
String |
normalize(String f)
Make the file short if it is inside our base directory, otherwise long. |
|
Parameters |
parseHeader(String value)
|
|
static Parameters |
parseHeader(String value,
Processor logger)
Standard OSGi header parser. |
|
static void |
printClause(Map<?,?> map,
StringBuilder sb)
|
|
static String |
printClauses(Map<?,? extends Map<?,?>> exports)
Print a standard Map based OSGi header. |
|
static String |
printClauses(Map<?,? extends Map<?,?>> exports,
boolean checkMultipleVersions)
|
|
int |
printExceptionSummary(Throwable e,
PrintStream out)
|
|
void |
printStackTrace(Throwable e,
int count,
PrintStream out)
|
|
void |
progress(float progress,
String format,
Object... args)
Create a warning. |
|
void |
progress(String format,
Object... args)
|
|
void |
propertiesChanged()
|
|
static boolean |
quote(Appendable sb,
String value)
|
|
static String |
read(InputStream in)
|
|
boolean |
refresh()
|
|
void |
removeBasicPlugin(Object plugin)
|
|
void |
removeClose(Closeable jar)
|
|
static String |
removeDuplicateMarker(String key)
|
|
static Properties |
replaceAll(Properties p,
String pattern,
String replacement)
Replace a string in all the values of the map. |
|
String |
replaceExtension(String s,
String extension,
String newExtension)
Utiltity to replace an extension |
|
protected void |
report(Appendable out)
|
|
void |
report(Map<String,Object> table)
Report the details of this processor. |
|
void |
set(String key,
String value)
|
|
void |
setBase(File base)
|
|
void |
setExceptions(boolean exceptions)
|
|
void |
setFileMustExist(boolean mustexist)
|
|
void |
setForceLocal(Collection<String> local)
|
|
void |
setParent(Processor processor)
|
|
void |
setPedantic(boolean pedantic)
|
|
void |
setProperties(File propertiesFile)
Set the properties by file. |
|
void |
setProperties(File propertiesFile,
File base)
|
|
void |
setProperties(Properties properties)
|
|
void |
setProperty(String key,
String value)
Add or override a new property. |
|
void |
setTrace(boolean x)
|
|
protected void |
setTypeSpecificPlugins(Set<Object> list)
|
|
void |
signal()
|
|
boolean |
since(Version introduced)
|
|
static Collection<String> |
split(String s)
|
|
static void |
split(String s,
Collection<String> set)
|
|
static Collection<String> |
split(String s,
String splitter)
|
|
String |
toString()
Printout of the status of this processor for toString() |
|
void |
trace(String msg,
Object... parms)
Create a warning. |
|
void |
unsetProperty(String string)
|
|
boolean |
updateModified(long time,
String reason)
|
|
void |
use(Processor reporter)
|
|
Reporter.SetLocation |
warning(String string,
Object... args)
Create a warning. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String LIST_SPLITTER
| Constructor Detail |
|---|
public Processor()
public Processor(Properties parent)
public Processor(Processor child)
| Method Detail |
|---|
public void setParent(Processor processor)
public Processor getParent()
public Processor getTop()
public void getInfo(Reporter processor,
String prefix)
public void getInfo(Reporter processor)
public Reporter.SetLocation warning(String string,
Object... args)
Reporter
warning in interface Reporterstring - The format of the errorargs - The arguments of the error
public Reporter.SetLocation error(String string,
Object... args)
Reporter
error in interface Reporterstring - The format of the errorargs - The arguments of the error
public void progress(float progress,
String format,
Object... args)
Reporter
progress in interface Reporterprogress - A value between 0 and 1 indicating the progress. 0 is starting
and >=1 is done.format - The format of the errorargs - The arguments of the error
public void progress(String format,
Object... args)
public Reporter.SetLocation exception(Throwable t,
String format,
Object... args)
Reporter
exception in interface Reportert - The exceptionargs - The arguments
public Reporter.SetLocation error(String string,
Throwable t,
Object... args)
public int printExceptionSummary(Throwable e,
PrintStream out)
public void printStackTrace(Throwable e,
int count,
PrintStream out)
public void signal()
public List<String> getWarnings()
Report
getWarnings in interface Reportpublic List<String> getErrors()
Report
getErrors in interface Report
public static Parameters parseHeader(String value,
Processor logger)
value -
public Parameters parseHeader(String value)
public void addClose(Closeable jar)
public void removeClose(Closeable jar)
public boolean isPedantic()
Reporter
isPedantic in interface Reporterpublic void setPedantic(boolean pedantic)
public void use(Processor reporter)
public static File getFile(File base,
String file)
public File getFile(String file)
public <T> List<T> getPlugins(Class<T> clazz)
getPlugins in interface Registryclazz - Each returned plugin implements this class/interface
public <T> T getPlugin(Class<T> clazz)
getPlugin in interface RegistryT - clazz -
public Set<Object> getPlugins()
protected void addExtensions(Set<Object> plugins)
plugins -
protected void loadPlugins(Set<Object> instances,
String pluginString,
String pluginPathString)
After that, we load the plugin paths, these can use the built in connectors.
Last but not least, we load the remaining plugins.
instances - pluginString - protected void setTypeSpecificPlugins(Set<Object> list)
protected <T> T customize(T plugin,
Attrs map)
plugin - entry - public boolean isFailOk()
isFailOk in class Domainpublic File getBase()
public void setBase(File base)
public void clear()
public void trace(String msg,
Object... parms)
Reporter
trace in interface Reportermsg - The format of the errorparms - The arguments of the errorpublic <T> List<T> newList()
public <T> Set<T> newSet()
public static <K,V> Map<K,V> newMap()
public static <K,V> Map<K,V> newHashMap()
public <T> List<T> newList(Collection<T> t)
public <T> Set<T> newSet(Collection<T> t)
public <K,V> Map<K,V> newMap(Map<K,V> t)
public void close()
close in interface Closeablepublic String _basedir(String[] args)
public String _propertiesname(String[] args)
public String _propertiesdir(String[] args)
public Properties getProperties()
public String getProperty(String key)
public void mergeProperties(File file,
boolean override)
public void mergeProperties(Properties properties,
boolean override)
public void setProperties(Properties properties)
public void addProperties(File file)
throws Exception
Exceptionpublic void addProperties(Map<?,?> properties)
public void addIncluded(File file)
public void doIncludeFile(File file,
boolean overwrite,
Properties target)
throws Exception
file - parent - done - overwrite -
FileNotFoundException
IOException
Exception
public void doIncludeFile(File file,
boolean overwrite,
Properties target,
String extensionName)
throws Exception
file - parent - done - overwrite - extensionName -
FileNotFoundException
IOException
Exceptionpublic void unsetProperty(String string)
public boolean refresh()
public void forceRefresh()
public void propertiesChanged()
public void setProperties(File propertiesFile)
throws IOException
propertiesFile -
FileNotFoundException
IOException
public void setProperties(File propertiesFile,
File base)
protected void begin()
public static boolean isTrue(String value)
public String getUnprocessedProperty(String key,
String deflt)
headerName - deflt -
public String getProperty(String key,
String deflt)
headerName - deflt -
public String getProperty(String key,
String deflt,
String separator)
public Properties loadProperties(File file)
throws IOException
file -
IOException
public static Properties replaceAll(Properties p,
String pattern,
String replacement)
public static String printClauses(Map<?,? extends Map<?,?>> exports)
throws IOException
exports - map { name => Map { attribute|directive => value } }
IOException
public static String printClauses(Map<?,? extends Map<?,?>> exports,
boolean checkMultipleVersions)
throws IOException
IOException
public static void printClause(Map<?,?> map,
StringBuilder sb)
throws IOException
IOException
public static boolean quote(Appendable sb,
String value)
throws IOException
sb - value -
IOExceptionpublic Macro getReplacer()
protected Object[] getMacroDomains()
public Properties getFlattenedProperties()
public Properties getFlattenedProperties(boolean ignoreInstructions)
public Set<String> getPropertyKeys(boolean inherit)
public boolean updateModified(long time,
String reason)
public long lastModified()
public void setProperty(String key,
String value)
key - value -
public static Properties getManifestAsProperties(InputStream in)
throws IOException
in -
IOExceptionpublic File getPropertiesFile()
public void setFileMustExist(boolean mustexist)
public static String read(InputStream in)
throws Exception
Exception
public static String join(Collection<?> list,
String delimeter)
args -
public static String join(String delimeter,
Collection<?>... list)
public static String join(Object[] list,
String delimeter)
public static String join(Collection<?>... list)
public static <T> String join(T[] list)
public static void split(String s,
Collection<String> set)
public static Collection<String> split(String s)
public static Collection<String> split(String s,
String splitter)
public static String merge(String... strings)
public boolean isExceptions()
public void setExceptions(boolean exceptions)
public String normalize(String f)
f -
public String normalize(File f)
public static String removeDuplicateMarker(String key)
public static boolean isDuplicate(String name)
public void setTrace(boolean x)
protected Processor.CL getLoader()
public boolean exists()
public boolean isOk()
Report
isOk in interface Report
public boolean check(String... pattern)
throws IOException
IOException
protected void report(Appendable out)
throws IOException
IOExceptionpublic boolean isPerfect()
public void setForceLocal(Collection<String> local)
public boolean isMissingPlugin(String name)
name -
public static String appendPath(String... parts)
"/" + "abc/def/" becomes "abc/def" @param prefix @param suffix @return
public static Attrs doAttrbutes(Object[] attrs,
Clazz clazz,
Macro macro)
attrs - clazz -
public static String formatArrays(String string,
Object... parms)
string - parms -
public static Object makePrintable(Object object)
object - the object to make printable
public static String append(String... strings)
public Class<?> getClass(String type,
File jar)
throws Exception
Exceptionpublic boolean isTrace()
public static long getDuration(String tm,
long dflt)
public String _random(String[] args)
public String _native_capability(String[] args)
throws IllegalArgumentException
Generates a Capability string, in the format specified by the OSGi Provide-Capability header, representing the current native platform according to OSGi RFC 188. For example on Windows7 running on an x86_64 processor it should generate the following:
osgi.native;osgi.native.osname:List<String>="Windows7,Windows 7,Win32";osgi.native.osversion:Version=6.1.0;osgi.native.processor:List<String>="x86-64,amd64,em64t,x86_64"
args - The array of properties. For example: the macro invocation of
"${native_capability;osversion=3.2.4;osname=Linux}" results in
an args array of
[native_capability, osversion=3.2.4, osname=Linux]
IllegalArgumentExceptionprotected Processor beginHandleErrors(String message)
#end(Processor) method. The method returns the previous command
owner or null. The command owner will receive all warnings and error
reports.
protected void endHandleErrors(Processor previous)
previous - public static Executor getExecutor()
public void addBasicPlugin(Object plugin)
plugin - public void removeBasicPlugin(Object plugin)
public List<File> getIncluded()
public String get(String key)
get in class Domain
public String get(String key,
String deflt)
get in class Domain
public void set(String key,
String value)
set in class Domainpublic Iterator<String> iterator()
iterator in interface Iterable<String>iterator in class Domainpublic Set<String> keySet()
public String toString()
toString in class Object
public String replaceExtension(String s,
String extension,
String newExtension)
s - extension - newExtension -
public Report.Location getLocation(String msg)
Report
getLocation in interface Reportmsg - The message
public Processor.FileLine getHeader(String header)
throws Exception
location - header -
IOException
Exception
public Processor.FileLine getHeader(Pattern header)
throws Exception
Exception
public static Processor.FileLine findHeader(File f,
String header)
throws IOException
IOException
public static Processor.FileLine findHeader(File f,
Pattern header)
throws IOException
IOException
public static int getLine(String s,
int index)
public boolean since(Version introduced)
public void report(Map<String,Object> table)
throws Exception
table -
Exceptionpublic boolean is(String propertyName)
public String mergeProperties(String key)
public String mergeProperties(String key,
String separator)
public <T> T[] concat(Class<T> type,
T[] prefix,
T suffix)
public Jar getJarFromName(String name,
String from)
name - URL or filename relative to the basefrom - Message identifying the caller for errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||