aQute.lib.osgi
Class Macro
java.lang.Object
aQute.lib.osgi.Macro
- All Implemented Interfaces:
- Replacer
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_fmodifiedHelp
public static String _fmodifiedHelp
Macro
public Macro(Properties properties,
Processor domain,
Object... targets)
Macro
public Macro(Processor processor)
process
public String process(String line)
- Specified by:
process in interface Replacer
getTerminator
public static char getTerminator(char c)
replace
protected String replace(String key,
aQute.lib.osgi.Macro.Link link)
_uniq
public String _uniq(String[] args)
_filter
public String _filter(String[] args)
_filterout
public String _filterout(String[] args)
_sort
public String _sort(String[] args)
_join
public String _join(String[] args)
_if
public String _if(String[] args)
_now
public String _now(String[] args)
_fmodified
public String _fmodified(String[] args)
throws Exception
- Throws:
Exception
_long2date
public String _long2date(String[] args)
_literal
public String _literal(String[] args)
_def
public String _def(String[] args)
_replace
public String _replace(String[] args)
- replace ;
; regex ; replace
- Parameters:
args -
- Returns:
_warning
public String _warning(String[] args)
_error
public String _error(String[] args)
_toclassname
public String _toclassname(String[] args)
_toclasspath
public String _toclasspath(String[] args)
_dir
public String _dir(String[] args)
_basename
public String _basename(String[] args)
_isfile
public String _isfile(String[] args)
_isdir
public String _isdir(String[] args)
_tstamp
public String _tstamp(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;;(;)*}
_lsa
public String _lsa(String[] args)
_currenttime
public String _currenttime(String[] args)
_version
public String _version(String[] args)
_system
public String _system(String[] args)
throws Exception
- System command. Execute a command and insert the result.
- Parameters:
args - help - patterns - low - high -
- Throws:
Exception
_cat
public String _cat(String[] args)
throws IOException
- Get the contents of a file.
- Parameters:
in -
- Returns:
-
- Throws:
IOException
getString
public static String getString(InputStream in)
throws IOException
- Throws:
IOException
verifyCommand
public static void verifyCommand(String[] args,
String help,
Pattern[] patterns,
int low,
int high)
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
Copyright © 2010 aQute SARL. All Rights Reserved.