Package aQute.bnd.osgi
Class Processor
java.lang.Object
aQute.bnd.osgi.Domain
aQute.bnd.osgi.Processor
- All Implemented Interfaces:
Constants
,Registry
,Report
,Reporter
,Closeable
,AutoCloseable
,Iterable<String>
- Direct Known Subclasses:
Analyzer
,bnd
,BuildContext
,CommunicationCommands
,EclipseCommand
,HeaderReader
,IndexCommand
,JarPrinter
,Makefile
,MavenCommand
,MavenDeployCmd
,PomParser
,Profiles
,Project
,ProjectLauncher
,ServiceComponent.ComponentMaker
,Signer
,ToolManager
,Verifier
,Workspace
,XmlRepoDiffCommand
,XMLResourceParser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
(package private) static class
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.Location
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
(package private) static final String
private File
private URI
(package private) static final int
(package private) static final ThreadLocal<Processor>
private static final Pattern
(package private) boolean
private static final Memoize<ExecutorGroup>
(package private) boolean
(package private) Collection<String>
private boolean
(package private) boolean
private final CopyOnWriteArrayList<File>
private long
static final String
(package private) List<Report.Location>
Create a location object and add it to the locationsstatic Reporter
private static final org.slf4j.Logger
private Processor
(package private) boolean
private CloseableMemoize<Processor.CL>
private Memoize<PluginsContainer>
(package private) String
(package private) Properties
private File
private Macro
(package private) Boolean
private final Set<AutoCloseable>
(package private) boolean
(package private) Version
This method is about compatibility.Fields inherited from class aQute.bnd.osgi.Domain
translation
Fields inherited from interface aQute.bnd.osgi.Constants
ACCESS_ATTRIBUTE, AUGMENT, AUGMENT_CAPABILITY_DIRECTIVE, AUGMENT_RANGE_ATTRIBUTE, AUGMENT_REQUIREMENT_DIRECTIVE, AUTOMATIC_MODULE_NAME, BASELINE, BASELINEREPO, BLUEPRINT_TIMEOUT_ATTRIBUTE, BLUEPRINT_WAIT_FOR_DEPENDENCIES_ATTRIBUTE, BND_ADDXMLTOTEST, BND_LASTMODIFIED, BND_USE_ATTRIBUTES, BNDDRIVER, BNDDRIVER_ANT, BNDDRIVER_BND, BNDDRIVER_ECLIPSE, BNDDRIVER_GRADLE, BNDDRIVER_GRADLE_NATIVE, BNDDRIVER_INTELLIJ, BNDDRIVER_MAVEN, BNDDRIVER_OSMORC, BNDDRIVER_SBT, BSN_SOURCE_SUFFIX, BUILDERIGNORE, BUILDFILES, BUILDPATH, BUILDREPO, BUMPPOLICY, BUNDLE_ACTIVATIONPOLICY, BUNDLE_ACTIVATOR, BUNDLE_BLUEPRINT, BUNDLE_CATEGORY, BUNDLE_CLASSPATH, BUNDLE_CONTACTADDRESS, BUNDLE_CONTRIBUTORS, BUNDLE_COPYRIGHT, BUNDLE_DESCRIPTION, BUNDLE_DEVELOPERS, BUNDLE_DOCURL, BUNDLE_ICON, BUNDLE_LICENSE, BUNDLE_LOCALIZATION, BUNDLE_MANIFESTVERSION, BUNDLE_NAME, BUNDLE_NATIVECODE, BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SCM, BUNDLE_SPECIFIC_HEADERS, BUNDLE_SYMBOLIC_NAME_ATTRIBUTE, BUNDLE_SYMBOLICNAME, BUNDLE_UPDATELOCATION, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_VERSION_ATTRIBUTE, BUNDLEANNOTATIONS, CARDINALITY_DIRECTIVE, CDIANNOTATIONS, CHECK, CLASS_ATTRIBUTE, CLASSPATH, COMMAND_DIRECTIVE, COMPONENT_ACTIVATE, COMPONENT_CONFIGURATION_POLICY, COMPONENT_DEACTIVATE, COMPONENT_DESCRIPTORS, COMPONENT_DESIGNATE, COMPONENT_DESIGNATEFACTORY, COMPONENT_DIRECTIVES, COMPONENT_DIRECTIVES_1_1, COMPONENT_DIRECTIVES_1_2, COMPONENT_DYNAMIC, COMPONENT_ENABLED, COMPONENT_FACTORY, COMPONENT_GREEDY, COMPONENT_IMMEDIATE, COMPONENT_IMPLEMENTATION, COMPONENT_MODIFIED, COMPONENT_MULTIPLE, COMPONENT_NAME, COMPONENT_NAMESPACE, COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_PROVIDE, COMPONENT_SERVICEFACTORY, COMPONENT_VERSION, COMPRESSION, CONDITIONAL_PACKAGE, CONDITIONALPACKAGE, CONDUIT, CONNECTION_SETTINGS, CONSUMER_POLICY, CONTRACT, CREATED_BY, CURRENT_BUNDLESYMBOLICNAME, CURRENT_BUNDLEVERSION, CURRENT_PACKAGE, CURRENT_USES, CURRENT_VERSION, DEFAULT_BAR_EXTENSION, DEFAULT_BND_EXTENSION, DEFAULT_BNDRUN_EXTENSION, DEFAULT_CHARSET, DEFAULT_DO_NOT_COPY, DEFAULT_JAR_EXTENSION, DEFAULT_LAUNCHER_BSN, DEFAULT_PREPROCESSS_MATCHERS, DEFAULT_PROP_BIN_DIR, DEFAULT_PROP_SRC_DIR, DEFAULT_PROP_TARGET_DIR, DEFAULT_PROP_TESTBIN_DIR, DEFAULT_PROP_TESTSRC_DIR, DEFAULT_TESTER_BSN, DEFINE_CONTRACT, DEPENDSON, DEPLOY, DEPLOYREPO, DESCRIPTION_ATTRIBUTE, DIFFIGNORE, DIFFPACKAGES, DIGESTS, directives, DISTRO, DONOTCOPY, DSANNOTATIONS, DSANNOTATIONS_OPTIONS, DUPLICATE_MARKER, DYNAMICIMPORT_PACKAGE, EE_ATTRIBUTE, EEPROFILE, EEPROFILE_AUTO_ATTRIBUTE, EFFECTIVE_DIRECTIVE, EMBEDDED_REPO, EMPTY_HEADER, EXCLUDE_DIRECTIVE, EXECUTABLE, EXPORT, EXPORT_APIGUARDIAN, EXPORT_BSN, EXPORT_CONTENTS, EXPORT_NAME, EXPORT_PACKAGE, EXPORT_SERVICE, EXPORT_TYPE, EXPORT_VERSION, EXPORTS_ATTRIBUTE, EXPORTTYPE, EXTENSION, EXTENSION_DIRECTIVE, FAIL_OK, FILTER_DIRECTIVE, FIXUPMESSAGES, FIXUPMESSAGES_IS_DIRECTIVE, FIXUPMESSAGES_IS_ERROR, FIXUPMESSAGES_IS_IGNORE, FIXUPMESSAGES_IS_WARNING, FIXUPMESSAGES_REPLACE_DIRECTIVE, FIXUPMESSAGES_RESTRICT_DIRECTIVE, FRAGMENT_ATTACHMENT_DIRECTIVE, FRAGMENT_HOST, FROM_DIRECTIVE, GENERATE, GESTALT, GESTALT_BATCH, GESTALT_CI, GESTALT_INTERACTIVE, GESTALT_OFFLINE, GESTALT_SHELL, GROUPID, headers, IDENTITY_INITIAL_RESOURCE, IDENTITY_SYSTEM_RESOURCE, IGNORE_ATTRIBUTE, IGNORE_PACKAGE, IGNORE_STANDALONE, IMPORT_DIRECTIVE, IMPORT_PACKAGE, IMPORT_PRIVATE, IMPORT_REFERENCE, IMPORT_SERVICE, importDirectives, INCLUDE, INCLUDE_DIRECTIVE, INCLUDE_RESOURCE, INCLUDEPACKAGE, INCLUDERESOURCE, INIT, INTERNAL_BUNDLESYMBOLICNAME_DIRECTIVE, INTERNAL_BUNDLEVERSION_DIRECTIVE, INTERNAL_EXPORT_TO_MODULES_DIRECTIVE, INTERNAL_EXPORTED_DIRECTIVE, INTERNAL_MODULE_DIRECTIVE, INTERNAL_MODULE_VERSION_DIRECTIVE, INTERNAL_OPEN_TO_MODULES_DIRECTIVE, INTERNAL_PREFIX, INTERNAL_SOURCE_DIRECTIVE, INVALIDFILENAMES, JAVA, JAVA_DEBUG, JAVAAGENT, JAVAC, JAVAC_ENCODING, JAVAC_PROFILE, JAVAC_SOURCE, JAVAC_TARGET, JIDENTIFIER, JPMS_MODULE_INFO, JPMS_MODULE_INFO_OPTIONS, KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PASSWORD_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, LANGUAGE_ATTRIBUTE, LAUNCH_ACTIVATION_EAGER, LAUNCH_ACTIVATORS, LAUNCH_RUNBUNDLES_ATTRS, LAUNCH_STARTLEVEL_DEFAULT, LAUNCH_TRACE, LAUNCHER_PLUGIN, LIB_DIRECTIVE, LIBRARY, LINK_ATTRIBUTE, LITERAL_ATTRIBUTE, MAIN_CLASS, MAKE, MANDATORY_DIRECTIVE, MANIFEST, MANIFEST_NAME, MAVEN_DEPENDENCIES, MAVEN_RELEASE, MAVEN_SCOPE, META_PERSISTENCE, METAPACKAGES, METATYPE, METATYPE_ANNOTATIONS, METATYPE_ANNOTATIONS_OPTIONS, MIME_TYPE_BUNDLE, MIME_TYPE_JAR, MODULE_INFO_CLASS, MODULES_ATTRIBUTE, NAME_ATTRIBUTE, NAMESECTION, NAMESPACE_STEM, NO_IMPORT_DIRECTIVE, NOANNOTATIONS, NOBUILDINCACHE, NOBUNDLES, NOCLASSFORNAME, NODEFAULTVERSION, NOEE, NOEXTRAHEADERS, NOIMPORTJAVA, NOJUNIT, NOJUNITOSGI, NOMANIFEST, NONE, NOT_A_BUNDLE_S, NOUSES, OPTIONAL, options, OSGI_SYNTAX_HEADERS, OSNAME_ATTRIBUTE, OSVERSION_ATTRIBUTE, OUTPUT, OUTPUTMASK, PACKAGEINFOTYPE, PATH_DIRECTIVE, PEDANTIC, PLUGIN, PLUGINPATH, PLUGINPATH_SHA1_ATTR, PLUGINPATH_URL_ATTR, POM, PREPROCESSMATCHERS, PRESENCE_DIRECTIVE, PRIVATE_DIRECTIVE, PRIVATE_PACKAGE, PRIVATEPACKAGE, PROCESSOR_ATTRIBUTE, PROFILE, PROVIDE_CAPABILITY, PROVIDE_DIRECTIVE, PROVIDER_POLICY, PROVIDER_TYPE_DIRECTIVE, RELEASEREPO, REMOTEWORKSPACE, REMOVE_ATTRIBUTE_DIRECTIVE, REMOVEHEADERS, REPORTNEWER, REPOSITORIES, REPRODUCIBLE, REQUIRE_BND, REQUIRE_BUNDLE, REQUIRE_CAPABILITY, RESOLUTION, RESOLUTION_DIRECTIVE, RESOLUTION_DYNAMIC, RESOLVE, RESOLVE_EFFECTIVE, RESOLVE_EXCLUDESYSTEM, RESOLVE_PREFERENCES, RESOLVEDEBUG, RESOURCEONLY, RUNBLACKLIST, RUNBUILDS, RUNBUNDLES, RUNBUNDLES_STARTLEVEL_ATTRIBUTE, RUNEE, RUNENV, RUNFRAMEWORK, RUNFRAMEWORK_NONE, RUNFRAMEWORK_SERVICES, RUNFRAMEWORKRESTART, RUNFW, RUNJDB, RUNKEEP, RUNNOREFERENCES, RUNOPTIONS, RUNOPTIONS_EAGER, RUNPATH, RUNPROGRAMARGS, RUNPROPERTIES, RUNPROVIDEDCAPABILITIES, RUNREMOTE, RUNREPOS, RUNREQUIRES, RUNSTARTLEVEL, RUNSTARTLEVEL_BEGIN, RUNSTARTLEVEL_ORDER, RUNSTARTLEVEL_STEP, RUNSTORAGE, RUNSYSTEMCAPABILITIES, RUNSYSTEMPACKAGES, RUNTIMEOUT, RUNTRACE, RUNVM, SAVEMANIFEST, SELECTION_FILTER_ATTRIBUTE, SERVICE_COMPONENT, SERVICELOADER_NAMESPACE, SERVICELOADER_REGISTER_DIRECTIVE, SIGN, SIGN_PASSWORD_DIRECTIVE, SIGNATURE_TEST, SINGLETON_DIRECTIVE, SIZE_ATTRIBUTE, SNAPSHOT, SOURCEPATH, SOURCES, SPECIFICATION_VERSION, SPLIT_PACKAGE_DIRECTIVE, STALECHECK, STANDALONE, STATIC_ATTRIBUTE, STRICT, SUB, SUBSTITUTE_ATTRIBUTE, SYSTEMPROPERTIES, TESTCASES, TESTCONTINUOUS, TESTER, TESTER_PLUGIN, TESTPACKAGES, TESTPATH, TESTSOURCES, TESTTERMINATE, TESTUNRESOLVED, TOOL, TRANSITIVE_ATTRIBUTE, TSTAMP, UNDERTEST, UPTO, USES_DIRECTIVE, USES_USES, VALID_PROPERTY_TYPES, VERSION_ATTR_HASH, VERSION_ATTR_LATEST, VERSION_ATTR_PROJECT, VERSION_ATTR_SNAPSHOT, VERSION_ATTRIBUTE, VERSION_FILTER, VERSIONDEFAULTS, VISIBILITY_DIRECTIVE, WAB, WABLIB, WORKINGSET, WORKINGSET_MEMBER
-
Constructor Summary
ConstructorsConstructorDescriptionProcessor
(Processor parent, Properties props, boolean wrap) Processor
(Properties props) Processor
(Properties props, boolean wrap) -
Method Summary
Modifier and TypeMethodDescriptionReturn a range expression for a filter from a version._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._propertiesdir
(String[] args) _propertiesname
(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).Return the name of the properties fileprivate void
void
addBasicPlugin
(Object plugin) These plugins are added to the total list of plugins.void
addClose
(AutoCloseable closeable) protected void
addExtensions
(PluginsContainer pluginsContainer) Is called after the PluginsContainer is initialized.void
addIncluded
(File file) private boolean
addIncludedIfAbsent
(File file) void
addProperties
(File file) void
addProperties
(Map<?, ?> properties) static String
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
void
clear()
private void
void
close()
<T> T[]
Add an element to an array, creating a new one if necessaryprivate Processor
current()
A processor can mark itself current for a thread.protected <T> T
customize
(T plugin, Attrs map, PluginsContainer pluginsContainer) Set the initial parameters of a pluginReturn a parameters that contains the merged properties of the given key and that is decorated by the merged properties of the key + '+', optionally including literals, and decorated by the merged properties of the key + '++', always including literals.static Attrs
doAttrbutes
(Object[] attrs, Clazz clazz, Macro macro) Parse the a=b strings and return a map of them.private void
void
doIncludeFile
(File file, boolean overwrite, Properties target) void
doIncludeFile
(File file, boolean overwrite, Properties target, String extensionName) private void
doIncludes
(File ubase, Properties p) Inspect the properties and if you find -includes parse the line included manifest files or properties files.protected void
endHandleErrors
(Processor previous) End a command.Create an error.Dedicated message for an exception.boolean
exists()
private String
static Processor.FileLine
findHeader
(File f, String header) static Processor.FileLine
findHeader
(File f, Pattern header) static Processor.FileLine
findHeader
(File f, Pattern header, Pattern clause) private void
Move errors and warnings to their proper place by scanning the fixup messages property.void
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.Overrides for the Domain classgetBase()
A checksum based on the values of the propertiesClass<?>
static long
getDuration
(String tm, long dflt) Return the errors.static Executor
static File
Return the properties but expand all macros.getFlattenedProperties
(boolean ignoreInstructions) Return the properties but expand all macros.Get a header relative to this processor, taking its parents and includes into account.private Processor.FileLine
getHeader0
(Pattern header, Pattern clause) void
void
<T> T
getInstructions
(Class<T> type) Return an instance of an interface where each method is mapped to an instruction available from this Processor.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.getJavaExecutable
(String java) static int
private String
getLiteralProperty
(String key, String deflt, Processor source, boolean inherit) protected Processor.CL
getLocation
(String msg) Return the errors for the given error or warning.org.slf4j.Logger
protected Object[]
This should be overridden by subclasses to add extra macro command domains on the search list.static Properties
Read a manifest but return a properties object.Get a Parameters from merged propertiesgetParameters
(String key, boolean allowDuplicates) <T> T
Returns the first plugin it can find of the given type.Return the PluginsContainer.<T> List<T>
getPlugins
(Class<T> clazz) Return a list of plugins that implement the given class.static org.osgi.util.promise.PromiseFactory
Property handling ...private Properties
getProperty
(String key) getProperty
(String key, String deflt) Get a property with preprocessing it with a proper defaultgetProperty
(String key, String deflt, String separator) private String
getProperty
(String key, String deflt, String separator, boolean inherit) getPropertyKeys
(boolean inherit) Return all inherited property keys.static ScheduledExecutorService
Return a list of all files that provide the properties for this Processor.void
Copy the settings of another processorgetTop()
getUnprocessedProperty
(String key, String deflt) Get a property without preprocessing it with a proper defaultReturn the warnings.private String
getWildcardProperty
(String deflt, String separator, boolean inherit, Instruction ins) boolean
Simplified way to check booleansstatic boolean
isDuplicate
(String key) boolean
boolean
isFailOk()
Indicates that this run should ignore errors and succeed anywayboolean
Return if this is an interactive environment like Eclipse or runs in batch mode.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
The provider of the reporter wants pedantic reporting, meaning every possible warning should be reported.boolean
(package private) boolean
isStrict()
If strict is true, then extra verification is done.boolean
isTrace()
static boolean
iterator()
static String
static String
join
(String delimeter, Collection<?>... lists) static String
join
(Collection<?> list) Join a list.static String
join
(Collection<?>... lists) static String
join
(Collection<?> list, String delimeter) static <T> String
join
(T[] list) keySet()
long
loadProperties
(File file) Helper to load a properties file from disk.(package private) UTF8Properties
loadProperties0
(File file) Load Properties from disk.private Reporter.SetLocation
static Object
makePrintable
(Object object) Check if the object is an array and turn it into a string if it is, otherwise unchanged.private static Object[]
makePrintableArray
(Object array) private String
makeWildcard
(String key) static String
void
mergeProperties
(File file, boolean overwrite) mergeProperties
(String key) Return merged properties.mergeProperties
(String key, String separator) void
mergeProperties
(Properties properties, boolean overwrite) static <K,
V> Map<K, V> <T> List<T>
newList()
<T> List<T>
newList
(Collection<T> t) static <K,
V> Map<K, V> newMap()
<K,
V> Map<K, V> private CloseableMemoize<Processor.CL>
private Memoize<PluginsContainer>
Return a memoizer for the PluginsContainer.<T> Set<T>
newSet()
<T> Set<T>
newSet
(Collection<T> t) Make the file short if it is inside our base directory, otherwise long.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
void
printStackTrace
(Throwable e, int count, PrintStream out) void
Deprecated.Use SLF4J Logger.info() instead.void
void
static boolean
quote
(Appendable sb, String value) static String
read
(InputStream in) boolean
refresh()
void
removeBasicPlugin
(Object plugin) void
removeClose
(AutoCloseable closeable) static String
private boolean
removeIncluded
(File file) static Properties
replaceAll
(Properties p, String pattern, String replacement) Replace a string in all the values of the map.replaceExtension
(String s, String extension, String newExtension) Utiltity to replace an extensionprotected void
report
(Appendable out) void
Report the details of this processor.void
void
void
setExceptions
(boolean exceptions) void
setFileMustExist
(boolean mustexist) void
setForceLocal
(Collection<String> local) setLocation
(String header, String clause, Reporter.SetLocation setLocation) void
void
setPedantic
(boolean pedantic) void
setProperties
(File propertiesFile) Set the properties by file.void
setProperties
(File propertiesFile, File base) void
setProperties
(File base, Properties properties) void
setProperties
(Properties properties) void
setPropertiesFile
(File source) Set the properties file but do **not** load the properties.void
setProperty
(String key, String value) Add or overwrite a new property.void
setTrace
(boolean x) protected void
setTypeSpecificPlugins
(PluginsContainer pluginsContainer) void
signal()
boolean
static Collection<String>
static Collection<String>
static void
split
(String s, Collection<String> collection) stream()
stream
(boolean inherit) static Pattern
toFullHeaderPattern
(String header) toString()
Printout of the status of this processor for toString()void
Used to provide verbose commands(package private) void
void
unsetProperty
(String string) boolean
updateModified
(long time, String reason) void
Create a warning.Methods inherited from class aQute.bnd.osgi.Domain
copyFrom, domain, domain, domain, domain, domain, domain, domain, getBundleActivator, getBundleCategory, getBundleClasspath, getBundleClassPath, getBundleContactAddress, getBundleCopyright, getBundleDescription, getBundleDocURL, getBundleName, getBundleNative, getBundleRequiredExecutionEnvironment, getBundleSymbolicName, getBundleVendor, getBundleVersion, getDynamicImportPackage, getExportContents, getExportPackage, getFragmentHost, getIcon, getImportPackage, getIncludeResource, getParameters, getParameters, getParameters, getParameters, getPrivatePackage, getProvideCapability, getRequireBundle, getRequireCapability, getRunblacklist, getRunee, isSources, normalizeKey, setAugment, setBundleActivator, setBundleClasspath, setBundleRequiredExecutionEnvironment, setBundleSymbolicName, setBundleVersion, setBundleVersion, setConditionalPackage, setExportContents, setExportPackage, setFailOk, setImportPackage, setIncludePackage, setIncludeResource, setPrivatePackage, setRunblacklist, setRunee, setRunfw, setRunRequires, setSources, setTranslation, translate, translate
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
log
-
BUFFER_SIZE
static final int BUFFER_SIZE- See Also:
-
current
-
executors
-
random
-
LIST_SPLITTER
- See Also:
-
errors
-
warnings
-
basicPlugins
-
toBeClosed
-
pluginLoader
-
pluginsContainer
-
pedantic
boolean pedantic -
trace
boolean trace -
exceptions
boolean exceptions -
fileMustExist
boolean fileMustExist -
base
-
baseURI
-
properties
Properties properties -
profile
String profile -
replacer
-
lastModified
private long lastModified -
propertiesFile
-
fixup
private boolean fixup -
parent
-
included
-
filter
Collection<String> filter -
strict
Boolean strict -
fixupMessages
boolean fixupMessages -
_uriHelp
- See Also:
-
DURATION_P
-
locations
List<Report.Location> locationsCreate a location object and add it to the locations -
upto
Version uptoThis method is about compatibility. New behavior can be conditionally introduced by calling this method and passing what version this behavior was introduced. This allows users of bnd to set the -upto instructions to the version that they want to be compatible with. If this instruction is not set, we assume the latest version. -
_frangeHelp
- See Also:
-
-
Constructor Details
-
Processor
public Processor() -
Processor
-
Processor
-
Processor
-
Processor
-
-
Method Details
-
setParent
-
getParent
-
getTop
-
getInfo
-
getInfo
-
addAll
-
current
A processor can mark itself current for a thread. -
warning
Description copied from interface:Reporter
Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method. -
error
Description copied from interface:Reporter
Create an error. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method. -
progress
Deprecated.Use SLF4J Logger.info() instead.Description copied from interface:Reporter
Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method. -
progress
-
error
-
exception
Description copied from interface:Reporter
Dedicated message for an exception. -
printExceptionSummary
-
printStackTrace
-
signal
public void signal() -
getWarnings
Description copied from interface:Report
Return the warnings. This list must not be changed and may be immutable.- Specified by:
getWarnings
in interfaceReport
- Returns:
- the warnings
-
getErrors
Description copied from interface:Report
Return the errors. This list must not be changed and may be immutable. -
parseHeader
Standard OSGi header parser.- Parameters:
value
-
-
parseHeader
-
addClose
-
removeClose
-
isPedantic
public boolean isPedantic()Description copied from interface:Reporter
The provider of the reporter wants pedantic reporting, meaning every possible warning should be reported.- Specified by:
isPedantic
in interfaceReporter
- Returns:
- if this is a pedantic reporter.
-
setPedantic
public void setPedantic(boolean pedantic) -
use
-
getFile
-
getFile
-
getPlugins
Return a list of plugins that implement the given class.- Specified by:
getPlugins
in interfaceRegistry
- Parameters:
clazz
- Each returned plugin implements this class/interface- Returns:
- A list of plugins
-
getPlugin
Returns the first plugin it can find of the given type. -
getPlugins
Return the PluginsContainer. Plugins are defined with the -plugin command. They are class names, optionally associated with attributes. Plugins can implement the Plugin interface to see these attributes. Any object can be a plugin. -
newPluginsContainer
Return a memoizer for the PluginsContainer. -
addExtensions
Is called after the PluginsContainer is initialized.- Parameters:
pluginsContainer
-
-
setTypeSpecificPlugins
-
customize
Set the initial parameters of a plugin- Parameters:
plugin
-map
-
-
isFailOk
public boolean isFailOk()Indicates that this run should ignore errors and succeed anyway -
getBase
-
getBaseURI
-
setBase
-
clear
public void clear() -
getLogger
public org.slf4j.Logger getLogger() -
trace
Used to provide verbose commands -
newList
-
newSet
-
newMap
-
newHashMap
-
newList
-
newSet
-
newMap
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
clearPlugins
private void clearPlugins() -
_basedir
-
_propertiesname
-
_propertiesdir
-
_uri
- Throws:
Exception
-
_fileuri
- Throws:
Exception
-
getProperties
Property handling ... -
getProperties0
-
getProperty
-
getUnexpandedProperty
-
mergeProperties
-
mergeProperties
-
setProperties
-
setProperties
-
addProperties
- Throws:
Exception
-
addProperties
-
addIncluded
-
addIncludedIfAbsent
-
removeIncluded
-
doIncludes
Inspect the properties and if you find -includes parse the line included manifest files or properties files. The files are relative from the given base, this is normally the base for the analyzer.- Parameters:
ubase
-p
-- Throws:
IOException
-
doIncludeFile
- Parameters:
file
-overwrite
-- Throws:
FileNotFoundException
IOException
Exception
-
doIncludeFile
public void doIncludeFile(File file, boolean overwrite, Properties target, String extensionName) throws Exception - Parameters:
file
-overwrite
-extensionName
-- Throws:
FileNotFoundException
IOException
Exception
-
unsetProperty
-
refresh
public boolean refresh() -
isStrict
boolean isStrict()If strict is true, then extra verification is done. -
forceRefresh
public void forceRefresh() -
propertiesChanged
public void propertiesChanged() -
setProperties
Set the properties by file. Setting the properties this way will also set the base for this analyzer. After reading the properties, this will call setProperties(Properties) which will handle the includes.- Parameters:
propertiesFile
-
-
setProperties
-
begin
protected void begin() -
isTrue
-
getUnprocessedProperty
Get a property without preprocessing it with a proper default- Parameters:
key
-deflt
-
-
getProperty
Get a property with preprocessing it with a proper default- Parameters:
key
-deflt
-
-
getProperty
-
getProperty
-
getWildcardProperty
private String getWildcardProperty(String deflt, String separator, boolean inherit, Instruction ins) -
getLiteralProperty
-
loadProperties
Helper to load a properties file from disk.- Parameters:
file
-- Throws:
IOException
-
loadProperties0
Load Properties from disk. The default encoding is ISO-8859-1 but nowadays all files are encoded with UTF-8. So we try to load it first as UTF-8 and if this fails we fail back to ISO-8859-1- Throws:
IOException
-
replaceAll
Replace a string in all the values of the map. This can be used to preassign variables that change. I.e. the base directory ${.} for a loaded properties -
printClauses
Print a standard Map based OSGi header.- Parameters:
exports
- map { name => Map { attribute|directive => value } }- Returns:
- the clauses
- Throws:
IOException
-
printClauses
public static String printClauses(Map<?, ? extends Map<?, throws IOException?>> exports, boolean checkMultipleVersions) - Throws:
IOException
-
printClause
- Throws:
IOException
-
quote
- Parameters:
sb
-value
-- Throws:
IOException
-
getReplacer
-
getMacroDomains
This should be overridden by subclasses to add extra macro command domains on the search list. -
getFlattenedProperties
Return the properties but expand all macros. This always returns a new Properties object that can be used in any way. -
getFlattenedProperties
Return the properties but expand all macros. This always returns a new Properties object that can be used in any way. -
getPropertyKeys
Return all inherited property keys. The keys are sorted for consistent ordering. -
updateModified
-
lastModified
public long lastModified() -
setProperty
Add or overwrite a new property.- Parameters:
key
-value
-
-
getManifestAsProperties
Read a manifest but return a properties object.- Parameters:
in
-- Throws:
IOException
-
getPropertiesFile
-
setFileMustExist
public void setFileMustExist(boolean mustexist) -
read
- Throws:
Exception
-
join
Join a list. -
join
-
join
-
join
-
join
-
join
-
split
-
split
-
split
-
merge
-
isExceptions
public boolean isExceptions() -
setExceptions
public void setExceptions(boolean exceptions) -
normalize
Make the file short if it is inside our base directory, otherwise long.- Parameters:
file
-
-
normalize
-
removeDuplicateMarker
-
isDuplicate
-
setTrace
public void setTrace(boolean x) -
getLoader
-
newPluginLoader
-
exists
public boolean exists() -
isOk
public boolean isOk()Description copied from interface:Report
Check if this report has any relevant errors that should make the run associated with this report invalid. I.e. if this returns false then the run should be disregarded. -
fixupMessages
private void fixupMessages()Move errors and warnings to their proper place by scanning the fixup messages property. -
doFixup
-
check
- Throws:
IOException
-
report
- Throws:
IOException
-
isPerfect
public boolean isPerfect() -
setForceLocal
-
isMissingPlugin
Answer if the name is a missing plugin's command name. If a bnd file contains the command name of a plugin, and that plugin is not available, then an error is reported during manifest calculation. This allows the plugin to fail to load when it is not needed. We first get the plugins to ensure it is properly initialized.- Parameters:
name
-
-
appendPath
Append two strings to for a path in a ZIP or JAR file. It is guaranteed to return a string that does not start, nor ends with a '/', while it is properly separated with slashes. Double slashes are properly removed."/" + "abc/def/" becomes "abc/def" @param prefix @param suffix @return
-
doAttrbutes
Parse the a=b strings and return a map of them.- Parameters:
attrs
-clazz
-
-
formatArrays
This method is the same as String.format but it makes sure that any arrays are transformed to strings.- Parameters:
string
-parms
-
-
makePrintable
Check if the object is an array and turn it into a string if it is, otherwise unchanged.- Parameters:
object
- the object to make printable- Returns:
- a string if it was an array or the original object
-
makePrintableArray
-
append
-
getClass
- Throws:
Exception
-
isTrace
public boolean isTrace() -
getDuration
-
_random
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). Takes an optional parameter for the length of string to generate; default is 8 characters. -
_native_capability
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& lt;String>="x86-64,amd64,em64t,x86_64"
- Parameters:
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]- Throws:
Exception
-
beginHandleErrors
Set the current command thread. This must be balanced with theendHandleErrors(Processor)
method. The method returns the previous command owner or null. The command owner will receive all warnings and error reports. -
endHandleErrors
End a command. Will restore the previous command owner.- Parameters:
previous
-
-
getExecutor
-
getScheduledExecutor
-
getPromiseFactory
public static org.osgi.util.promise.PromiseFactory getPromiseFactory() -
addBasicPlugin
These plugins are added to the total list of plugins. The separation is necessary because the list of plugins is refreshed now and then so we need to be able to add them at any moment in time.- Parameters:
plugin
-
-
removeBasicPlugin
-
getIncluded
-
get
Overrides for the Domain class -
get
-
set
-
stream
-
stream
-
iterator
-
spliterator
- Specified by:
spliterator
in interfaceIterable<String>
-
iterable
-
keySet
-
toString
Printout of the status of this processor for toString() -
replaceExtension
Utiltity to replace an extension- Parameters:
s
-extension
-newExtension
-
-
setLocation
public Reporter.SetLocation setLocation(String header, String clause, Reporter.SetLocation setLocation) -
location
-
getLocation
Description copied from interface:Report
Return the errors for the given error or warning. Can return null.- Specified by:
getLocation
in interfaceReport
- Parameters:
msg
- The message- Returns:
- null or the location of the message
-
getHeader
Get a header relative to this processor, taking its parents and includes into account.- Parameters:
header
-- Throws:
IOException
Exception
-
toFullHeaderPattern
-
getHeader
- Throws:
Exception
-
getHeader
- Throws:
Exception
-
getHeader
- Throws:
Exception
-
getHeader0
- Throws:
Exception
-
findHeader
- Throws:
IOException
-
findHeader
- Throws:
IOException
-
findHeader
public static Processor.FileLine findHeader(File f, Pattern header, Pattern clause) throws IOException - Throws:
IOException
-
getLine
-
since
-
report
Report the details of this processor. Should in general be overridden- Parameters:
table
-- Throws:
Exception
-
is
Simplified way to check booleans -
mergeProperties
Return merged properties. The parameters provide a list of property names which are concatenated in the output, separated by a comma. Not only are those property names looked for, also all property names that have that constant as a prefix, a '.', and then whatever (.*). The result is either null if nothing was found or a list of properties -
mergeLocalProperties
-
mergeProperties
-
makeWildcard
-
getMergedParameters
Get a Parameters from merged properties -
concat
Add an element to an array, creating a new one if necessary -
getJarFromName
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.- Parameters:
name
- URL or filename relative to the basefrom
- Message identifying the caller for errors- Returns:
- null or a Jar with the contents for the name
-
fileName
-
_thisfile
Return the name of the properties file -
getSettings
Copy the settings of another processor -
_frange
Return a range expression for a filter from a version. By default this is based on consumer compatibility. You can specify a third argument (true) to get provider compatibility.${frange;1.2.3} -> (&(version>=1.2.3)(!(version>=2.0.0)) ${frange;1.2.3, true} -> (&(version>=1.2.3)(!(version>=1.3.0)) ${frange;[1.2.3,2.3.4)} -> (&(version>=1.2.3)(!(version>=2.3.4))
-
_findfile
-
tree
-
getInstructions
Return an instance of an interface where each method is mapped to an instruction available from this Processor. SeeSyntaxAnnotation
for how to annotate this interface. -
isInteractive
public boolean isInteractive()Return if this is an interactive environment like Eclipse or runs in batch mode. If interactive, things can get refreshed. -
getParameters
- Overrides:
getParameters
in classDomain
-
system
public String system(boolean allowFail, String command, String input) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
system
- Throws:
IOException
InterruptedException
-
getJavaExecutable
-
decorated
Return a parameters that contains the merged properties of the given key and that is decorated by the merged properties of the key + '+', optionally including literals, and decorated by the merged properties of the key + '++', always including literals.- Parameters:
key
- The key of the property
-
decorated
-
getProfile
-
getChecksum
A checksum based on the values of the properties- Returns:
- A checksum based on the values of the properties
-
getSelfAndAncestors
Return a list of all files that provide the properties for this Processor. This includes its own properties file, all included files, and the same for its ancestor Processor.The order of the list is parent?.getSelfAndAncestors(), includes, properties file
- Returns:
- a list of files that this processor depends on
-
getSelfAndAncestors
-
setPropertiesFile
Set the properties file but do **not** load the properties.- Parameters:
source
- the properties file
-