aQute.lib.osgi

Class Macro

public class Macro extends Object implements Replacer

Provide a macro processor. This processor can replace variables in strings based on a properties and a domain. The domain can implement functions that start with a "_" and take args[], the names of these functions are available as functions in the macro processor (without the _). Macros can nest to any depth but may not contain loops.
Field Summary
static String_fmodifiedHelp
Constructor Summary
Macro(Properties properties, Processor domain, Object... targets)
Macro(Processor processor)
Method Summary
PropertiesgetFlattenedProperties()
Take all the properties and translate them to actual values.
static StringgetString(InputStream in)
static chargetTerminator(char c)
Stringprocess(String line)
protected Stringreplace(String key, Macro.Link link)
static voidverifyCommand(String[] args, String help, Pattern[] patterns, int low, int high)
String_basename(String[] args)
String_cat(String[] args)
Get the contents of a file.
String_currenttime(String[] args)
String_def(String[] args)
String_dir(String[] args)
String_error(String[] args)
String_filter(String[] args)
String_filterout(String[] args)
String_fmodified(String[] args)
String_if(String[] args)
String_isdir(String[] args)
String_isfile(String[] args)
String_join(String[] args)
String_literal(String[] args)
String_long2date(String[] args)
String_lsa(String[] args)
String_lsr(String[] args)
Wildcard a directory.
String_now(String[] args)
String_replace(String[] args)
replace ; ; regex ; replace
String_sort(String[] args)
String_system(String[] args)
System command.
String_toclassname(String[] args)
String_toclasspath(String[] args)
String_tstamp(String[] args)
String_uniq(String[] args)
String_version(String[] args)
String_warning(String[] args)

Field Detail

_fmodifiedHelp

public static String _fmodifiedHelp

Constructor Detail

Macro

public Macro(Properties properties, Processor domain, Object... targets)

Macro

public Macro(Processor processor)

Method Detail

getFlattenedProperties

public Properties getFlattenedProperties()
Take all the properties and translate them to actual values. This method takes the set properties and traverse them over all entries, including the default properties for that properties. The values no longer contain macros.

Returns: A new Properties with the flattened values

getString

public static String getString(InputStream in)

getTerminator

public static char getTerminator(char c)

process

public String process(String line)

replace

protected String replace(String key, Macro.Link link)

verifyCommand

public static void verifyCommand(String[] args, String help, Pattern[] patterns, int low, int high)

_basename

public String _basename(String[] args)

_cat

public String _cat(String[] args)
Get the contents of a file.

Parameters: in

Returns:

Throws: IOException

_currenttime

public String _currenttime(String[] args)

_def

public String _def(String[] args)

_dir

public String _dir(String[] args)

_error

public String _error(String[] args)

_filter

public String _filter(String[] args)

_filterout

public String _filterout(String[] args)

_fmodified

public String _fmodified(String[] args)

_if

public String _if(String[] args)

_isdir

public String _isdir(String[] args)

_isfile

public String _isfile(String[] args)

_join

public String _join(String[] args)

_literal

public String _literal(String[] args)

_long2date

public String _long2date(String[] args)

_lsa

public String _lsa(String[] args)

_lsr

public String _lsr(String[] args)
Wildcard a directory. The lists can contain Instruction that are matched against the given directory ${lsr;;(;)*} ${lsa;;(;)*}

_now

public String _now(String[] args)

_replace

public String _replace(String[] args)
replace ; ; regex ; replace

Parameters: args

Returns:

_sort

public String _sort(String[] args)

_system

public String _system(String[] args)
System command. Execute a command and insert the result.

Parameters: args help patterns low high

_toclassname

public String _toclassname(String[] args)

_toclasspath

public String _toclasspath(String[] args)

_tstamp

public String _tstamp(String[] args)

_uniq

public String _uniq(String[] args)

_version

public String _version(String[] args)

_warning

public String _warning(String[] args)