Modifier and Type | Field and Description |
---|---|
static String |
LIST_SPLITTER |
BLUEPRINT_TIMEOUT_ATTRIBUTE, BLUEPRINT_WAIT_FOR_DEPENDENCIES_ATTRIBUTE, BND_ADDXMLTOTEST, BND_LASTMODIFIED, BUILDFILES, BUILDPACKAGES, BUILDPATH, BUMPPOLICY, BUNDLE_ACTIVATIONPOLICY, BUNDLE_ACTIVATOR, BUNDLE_BLUEPRINT, BUNDLE_CATEGORY, BUNDLE_CLASSPATH, BUNDLE_CONTACTADDRESS, BUNDLE_COPYRIGHT, BUNDLE_DESCRIPTION, BUNDLE_DOCURL, BUNDLE_ICON, BUNDLE_LICENSE, BUNDLE_LOCALIZATION, BUNDLE_MANIFESTVERSION, BUNDLE_NAME, BUNDLE_NATIVECODE, BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SPECIFIC_HEADERS, BUNDLE_SYMBOLIC_NAME_ATTRIBUTE, BUNDLE_SYMBOLICNAME, BUNDLE_UPDATELOCATION, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_VERSION_ATTRIBUTE, CLASSPATH, COMMAND_DIRECTIVE, COMPILER_SOURCE, COMPILER_TARGET, COMPONENT_ACTIVATE, COMPONENT_CONFIGURATION_POLICY, COMPONENT_DEACTIVATE, COMPONENT_DESCRIPTORS, COMPONENT_DESIGNATE, COMPONENT_DESIGNATEFACTORY, COMPONENT_DYNAMIC, COMPONENT_ENABLED, COMPONENT_FACTORY, COMPONENT_IMMEDIATE, COMPONENT_IMPLEMENTATION, COMPONENT_MODIFIED, COMPONENT_MULTIPLE, COMPONENT_NAME, COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_PROVIDE, COMPONENT_SERVICEFACTORY, COMPONENT_VERSION, componentDirectives, CONDITIONAL_PACKAGE, CONDUIT, CONSUMER_POLICY, CREATED_BY, CURRENT_PACKAGE, CURRENT_USES, CURRENT_VERSION, DEBUG, DEFAULT_BAR_EXTENSION, DEFAULT_BND_EXTENSION, DEFAULT_BNDRUN_EXTENSION, DEFAULT_CHARSET, DEFAULT_DO_NOT_COPY, DEFAULT_JAR_EXTENSION, DEFAULT_LAUNCHER_BSN, DEFAULT_TESTER_BSN, DEPENDSON, DEPLOY, DEPLOYREPO, DESCRIPTION_ATTRIBUTE, directives, DONOTCOPY, DUPLICATE_MARKER, DYNAMICIMPORT_PACKAGE, EMBEDDED_REPO, EMPTY, EMPTY_HEADER, EXCLUDE_DIRECTIVE, EXPORT_CONTENTS, EXPORT_PACKAGE, EXPORT_SERVICE, EXTENSION_DIRECTIVE, FAIL_OK, FRAGMENT_ATTACHMENT_DIRECTIVE, FRAGMENT_HOST, FROM_DIRECTIVE, headers, IGNORE_PACKAGE, IMPORT_DIRECTIVE, IMPORT_PACKAGE, IMPORT_PRIVATE, IMPORT_REFERENCE, IMPORT_SERVICE, importDirectives, INCLUDE, INCLUDE_DIRECTIVE, INCLUDE_RESOURCE, INCLUDERESOURCE, JIDENTIFIER, KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PASSWORD_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, LANGUAGE_ATTRIBUTE, LAUNCHER_PLUGIN, LIB_DIRECTIVE, LINK_ATTRIBUTE, MAKE, MANDATORY_DIRECTIVE, MANIFEST, METAPACKAGES, METATYPE, NAME_ATTRIBUTE, NAMESECTION, NAMESPACE_STEM, NO_IMPORT_DIRECTIVE, NOANNOTATIONS, NOBUNDLES, NODEFAULTVERSION, NOEXTRAHEADERS, NOMANIFEST, NONE, NOPE, NOUSES, options, OSNAME_ATTRIBUTE, OSVERSION_ATTRIBUTE, PATH_DIRECTIVE, PEDANTIC, PLUGIN, POM, PRESENCE_DIRECTIVE, PRIVATE_DIRECTIVE, PRIVATE_PACKAGE, PROCESSOR_ATTRIBUTE, PROVIDE_DIRECTIVE, PROVIDER_POLICY, RELEASEREPO, REMOVE_ATTRIBUTE_DIRECTIVE, REMOVEHEADERS, REPORTNEWER, REQUIRE_BND, REQUIRE_BUNDLE, RESOLUTION_DIRECTIVE, RESOURCEONLY, RUNBUILDS, RUNBUNDLES, RUNFRAMEWORK, RUNFRAMEWORK_NONE, RUNFRAMEWORK_SERVICES, RUNPATH, RUNPATH_LAUNCHER_DIRECTIVE, RUNPATH_MAIN_DIRECTIVE, RUNPROPERTIES, RUNSTORAGE, RUNSYSTEMPACKAGES, RUNTIMEOUT, RUNTRACE, RUNVM, SAVEMANIFEST, SELECTION_FILTER_ATTRIBUTE, SERVICE_COMPONENT, SET_COMPONENT_DIRECTIVES, SET_COMPONENT_DIRECTIVES_1_1, SIGN, SIGN_PASSWORD_DIRECTIVE, SIGNATURE_TEST, SINGLETON_DIRECTIVE, SIZE_ATTRIBUTE, SNAPSHOT, SOURCEPATH, SOURCES, SPECIFICATION_VERSION, SPLIT_PACKAGE_DIRECTIVE, SUB, TESTCASES, TESTCONTINUOUS, TESTER_PLUGIN, TESTPACKAGES, TESTPATH, TESTREPORT, TOOL, UNDERTEST, USES_DIRECTIVE, USES_USES, VALID_PROPERTY_TYPES, VERBOSE, VERSION_ATTRIBUTE, VERSION_FILTER, VERSIONPOLICY, VERSIONPOLICY_IMPL, VERSIONPOLICY_USES, VISIBILITY_DIRECTIVE, WAB, WABLIB
Constructor and Description |
---|
Processor() |
Processor(Processor parent) |
Processor(Properties parent) |
Modifier and Type | Method and Description |
---|---|
String |
_basedir(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) |
void |
addIncluded(File file) |
void |
addProperties(File file) |
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.
|
void |
clear() |
void |
close() |
protected <T> T |
customize(T plugin,
Map<String,String> map) |
static Map<String,String> |
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) |
protected void |
endHandleErrors(Processor previous)
End a command.
|
void |
error(String string,
Object... args) |
void |
error(String string,
Throwable t,
Object... args) |
boolean |
exists() |
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.
|
File |
getBase() |
Class<?> |
getClass(String type,
File jar) |
static long |
getDuration(String tm,
long dflt) |
List<String> |
getErrors() |
static Executor |
getExecutor() |
static File |
getFile(File base,
String file) |
File |
getFile(String file) |
Properties |
getFlattenedProperties()
Return the properties but expand all macros.
|
void |
getInfo(Processor processor) |
void |
getInfo(Processor processor,
String prefix) |
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() |
<T> T |
getPlugin(Class<T> clazz)
Returns the first plugin it can find of the given type.
|
protected Set<Object> |
getPlugins()
Return a list of plugins.
|
<T> List<T> |
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 a proper default
|
Macro |
getReplacer() |
Processor |
getTop() |
List<String> |
getWarnings() |
static boolean |
isDuplicate(String name) |
boolean |
isExceptions() |
boolean |
isFailOk() |
boolean |
isMissingPlugin(String name)
Answer if the name is a missing plugin's command name.
|
boolean |
isOk() |
boolean |
isPedantic() |
boolean |
isPerfect() |
boolean |
isTrace() |
static boolean |
isTrue(String value) |
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 <T> String |
join(T[] list) |
long |
lastModified() |
protected void |
loadPlugins(Set<Object> list,
String spe) |
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) |
static Map<String,Map<String,String>> |
merge(String type,
Map<String,Map<String,String>> instructions,
Map<String,Map<String,String>> actual,
Set<String> superfluous,
Map<String,Map<String,String>> ignored)
Merge the attributes of two maps, where the first map can contain
wildcarded names.
|
void |
mergeProperties(File file,
boolean override) |
void |
mergeProperties(Properties properties,
boolean override) |
static <K,V> Map<K,V> |
newHashMap() |
<T> List<T> |
newList() |
<T> List<T> |
newList(Collection<T> t) |
static <K,V> Map<K,V> |
newMap() |
<K,V> Map<K,V> |
newMap(Map<K,V> t) |
<T> Set<T> |
newSet() |
<T> Set<T> |
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.
|
Map<String,Map<String,String>> |
parseHeader(String value) |
static Map<String,Map<String,String>> |
parseHeader(String value,
Processor logger)
Standard OSGi header parser.
|
static void |
printClause(Map<String,String> map,
StringBuffer sb) |
static String |
printClauses(Map<String,Map<String,String>> exports)
Print a standard Map based OSGi header.
|
static String |
printClauses(Map<String,Map<String,String>> exports,
boolean checkMultipleVersions) |
void |
progress(String s,
Object... args) |
void |
propertiesChanged() |
static String |
read(InputStream in) |
boolean |
refresh() |
void |
removeBasicPlugin(Object plugin) |
static String |
removeDuplicateMarker(String key) |
static Properties |
replaceAll(Properties p,
String pattern,
String replacement)
Replace a string in all the values of the map.
|
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() |
static Collection<String> |
split(String s) |
static void |
split(String s,
Collection<String> set) |
static Collection<String> |
split(String s,
String splitter) |
void |
trace(String msg,
Object... parms) |
void |
unsetProperty(String string) |
boolean |
updateModified(long time,
String reason) |
void |
warning(String string,
Object... args) |
public static String LIST_SPLITTER
public Processor()
public Processor(Properties parent)
public Processor(Processor parent)
public void setParent(Processor processor)
public Processor getParent()
public Processor getTop()
public void getInfo(Processor processor)
public void signal()
public List<String> getWarnings()
getWarnings
in interface Reporter
public static Map<String,Map<String,String>> parseHeader(String value, Processor logger)
value
- public void addClose(Closeable jar)
public boolean isPedantic()
isPedantic
in interface Reporter
public void setPedantic(boolean pedantic)
public <T> List<T> getPlugins(Class<T> clazz)
getPlugins
in interface Registry
clazz
- Each returned plugin implements this class/interfacepublic <T> T getPlugin(Class<T> clazz)
protected Set<Object> getPlugins()
public boolean isFailOk()
public File getBase()
public void setBase(File base)
public void clear()
public <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 void close()
close
in interface Closeable
close
in interface AutoCloseable
public Properties getProperties()
public void mergeProperties(File file, boolean override)
public void mergeProperties(Properties properties, boolean override)
public void setProperties(Properties 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 unsetProperty(String string)
public boolean refresh()
public void forceRefresh()
public void propertiesChanged()
public void setProperties(File propertiesFile) throws IOException
propertiesFile
- FileNotFoundException
IOException
protected void begin()
public static boolean isTrue(String value)
public String getProperty(String key, String deflt)
headerName
- deflt
- public Properties loadProperties(File file) throws IOException
file
- IOException
public static Properties replaceAll(Properties p, String pattern, String replacement)
public static Map<String,Map<String,String>> merge(String type, Map<String,Map<String,String>> instructions, Map<String,Map<String,String>> actual, Set<String> superfluous, Map<String,Map<String,String>> ignored)
instructions
- the instructions with patterns. Aactual
- the actual found packagespublic static String printClauses(Map<String,Map<String,String>> exports)
exports
- map { name => Map { attribute|directive => value } }public static String printClauses(Map<String,Map<String,String>> exports, boolean checkMultipleVersions)
public static void printClause(Map<String,String> map, StringBuffer sb)
public Macro getReplacer()
protected Object[] getMacroDomains()
public Properties getFlattenedProperties()
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
- IOException
public 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(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 boolean isExceptions()
public void setExceptions(boolean exceptions)
public String normalize(String f)
f
- public static boolean isDuplicate(String name)
public void setTrace(boolean x)
public boolean exists()
public boolean isOk()
public 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 Map<String,String> 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 printablepublic boolean isTrace()
public static long getDuration(String tm, long dflt)
public String _random(String[] args)
protected 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)
Copyright © 2013 aQute SARL. All rights reserved.