|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectaQute.lib.osgi.Processor
public class Processor
| Field Summary | |
|---|---|
static String |
DEFAULT_PLUGINS
|
static String |
LIST_SPLITTER
|
| Constructor Summary | |
|---|---|
Processor()
|
|
Processor(Processor parent)
|
|
Processor(Properties parent)
|
|
| Method Summary | ||
|---|---|---|
String |
_basedir(String[] args)
|
|
void |
addClose(Closeable jar)
|
|
void |
addIncluded(File file)
|
|
void |
addProperties(File file)
|
|
static String |
appendPath(String... parts)
Append two strings to for a path in a ZIP or JAR file. |
|
protected void |
begin()
|
|
void |
clear()
|
|
void |
close()
|
|
void |
error(String string,
Object... args)
|
|
void |
error(String string,
Throwable t,
Object... args)
|
|
boolean |
exists()
|
|
File |
getBase()
|
|
List<String> |
getErrors()
|
|
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()
|
|
protected List<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 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()
|
|
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)
|
|
long |
lastModified()
|
|
Properties |
loadProperties(File file)
Helper to load a properties file from disk. |
|
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
|
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. |
|
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,
String allowedDirectives,
StringBuffer sb)
|
|
static String |
printClauses(Map<String,Map<String,String>> exports,
String allowedDirectives)
Print a standard Map based OSGi header. |
|
static String |
printClauses(Map<String,Map<String,String>> exports,
String allowedDirectives,
boolean checkMultipleVersions)
|
|
void |
progress(String s,
Object... args)
|
|
void |
propertiesChanged()
|
|
static String |
read(InputStream in)
|
|
boolean |
refresh()
|
|
static String |
removeDuplicateMarker(String key)
|
|
static Properties |
replaceAll(Properties p,
String pattern,
String replacement)
Replace a string in all the values of the map. |
|
static Map<Instruction,Map<String,String>> |
replaceWitInstruction(Map<String,Map<String,String>> header,
String type)
|
|
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)
|
|
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)
|
|
void |
updateModified(long time,
String reason)
|
|
void |
warning(String string,
Object... args)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String DEFAULT_PLUGINS
public static String LIST_SPLITTER
| Constructor Detail |
|---|
public Processor()
public Processor(Properties parent)
public Processor(Processor parent)
| Method Detail |
|---|
public void setParent(Processor processor)
public Processor getParent()
public Processor getTop()
public void getInfo(Processor processor,
String prefix)
public void getInfo(Processor processor)
public void warning(String string,
Object... args)
warning in interface Reporter
public void error(String string,
Object... args)
error in interface Reporter
public void error(String string,
Throwable t,
Object... args)
public List<String> getWarnings()
getWarnings in interface Reporterpublic List<String> getErrors()
getErrors in interface Reporterpublic Map<String,Map<String,String>> parseHeader(String value)
public static Map<String,Map<String,String>> parseHeader(String value,
Processor logger)
value -
public void addClose(Closeable jar)
public void progress(String s,
Object... args)
progress in interface Reporterpublic boolean isPedantic()
isPedantic in interface Reporterpublic void setPedantic(boolean pedantic)
public static File getFile(File base,
String file)
public File getFile(String file)
public <T> List<T> getPlugins(Class<T> clazz)
clazz - Each returned plugin implements this class/interface
protected List<Object> getPlugins()
public boolean isFailOk()
public File getBase()
public void setBase(File base)
public void clear()
public void trace(String msg,
Object... parms)
trace in interface Reporterpublic <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 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 addIncluded(File file)
public void unsetProperty(String string)
public boolean refresh()
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 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 packages
public static String printClauses(Map<String,Map<String,String>> exports,
String allowedDirectives)
exports - map { name => Map { attribute|directive => value } }
public static String printClauses(Map<String,Map<String,String>> exports,
String allowedDirectives,
boolean checkMultipleVersions)
public static void printClause(Map<String,String> map,
String allowedDirectives,
StringBuffer sb)
public Macro getReplacer()
protected Object[] getMacroDomains()
public Properties getFlattenedProperties()
public void 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(Object[] list,
String delimeter)
public static String join(Collection<?> 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 String normalize(File f)
public static String removeDuplicateMarker(String key)
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 static Map<Instruction,Map<String,String>> replaceWitInstruction(Map<String,Map<String,String>> header,
String type)
public boolean isMissingPlugin(String name)
name -
public static String appendPath(String... parts)
"/" + "abc/def/" becomes "abc/def"
prefix - suffix -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||