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

public class Processor extends Domain implements Reporter, Registry, Constants, Closeable
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • log

      public static Reporter log
    • BUFFER_SIZE

      static final int BUFFER_SIZE
      See Also:
    • current

      static final ThreadLocal<Processor> current
    • executors

      private static final Memoize<ExecutorGroup> executors
    • random

      private static final Memoize<Random> random
    • LIST_SPLITTER

      public static final String LIST_SPLITTER
      See Also:
    • errors

      final List<String> errors
    • warnings

      final List<String> warnings
    • basicPlugins

      private final Set<Object> basicPlugins
    • toBeClosed

      private final Set<AutoCloseable> toBeClosed
    • pluginLoader

      private volatile CloseableMemoize<Processor.CL> pluginLoader
    • pluginsContainer

      private volatile Memoize<PluginsContainer> pluginsContainer
    • pedantic

      boolean pedantic
    • trace

      boolean trace
    • exceptions

      boolean exceptions
    • fileMustExist

      boolean fileMustExist
    • base

      private File base
    • baseURI

      private URI baseURI
    • properties

      Properties properties
    • profile

      String profile
    • replacer

      private Macro replacer
    • lastModified

      private long lastModified
    • propertiesFile

      private File propertiesFile
    • fixup

      private boolean fixup
    • parent

      private Processor parent
    • included

      private final CopyOnWriteArrayList<File> included
    • filter

    • strict

      Boolean strict
    • fixupMessages

      boolean fixupMessages
    • _uriHelp

      static final String _uriHelp
      See Also:
    • DURATION_P

      private static final Pattern DURATION_P
    • locations

      List<Report.Location> locations
      Create a location object and add it to the locations
    • upto

      Version upto
      This 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

      static final String _frangeHelp
      See Also:
  • Constructor Details

    • Processor

      public Processor()
    • Processor

      public Processor(Properties props)
    • Processor

      public Processor(Processor parent)
    • Processor

      public Processor(Properties props, boolean wrap)
    • Processor

      public Processor(Processor parent, Properties props, boolean wrap)
  • Method Details

    • setParent

      public void setParent(Processor parent)
    • getParent

      public Processor getParent()
    • getTop

      public Processor getTop()
    • getInfo

      public void getInfo(Reporter processor, String prefix)
    • getInfo

      public void getInfo(Reporter processor)
    • addAll

      private void addAll(List<String> to, List<String> from, String prefix, Reporter reporter)
    • current

      private Processor current()
      A processor can mark itself current for a thread.
    • warning

      public Reporter.SetLocation warning(String string, Object... args)
      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.
      Specified by:
      warning in interface Reporter
      Parameters:
      string - The format of the error
      args - The arguments of the error
      Returns:
      a SetLocation to set the location
    • error

      public Reporter.SetLocation error(String string, Object... args)
      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.
      Specified by:
      error in interface Reporter
      Parameters:
      string - The format of the error
      args - The arguments of the error
      Returns:
      a SetLocation to set the location
    • progress

      @Deprecated public void progress(float progress, String format, Object... args)
      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.
      Specified by:
      progress in interface Reporter
      Parameters:
      progress - A value between 0 and 1 indicating the progress. 0 is starting and >=1 is done.
      format - The format of the error
      args - The arguments of the error
    • progress

      public void progress(String format, Object... args)
    • error

      public Reporter.SetLocation error(String format, Throwable t, Object... args)
    • exception

      public Reporter.SetLocation exception(Throwable t, String format, Object... args)
      Description copied from interface: Reporter
      Dedicated message for an exception.
      Specified by:
      exception in interface Reporter
      Parameters:
      t - The exception
      format - The format of the message
      args - The arguments
    • printExceptionSummary

      public int printExceptionSummary(Throwable e, PrintStream out)
    • printStackTrace

      public void printStackTrace(Throwable e, int count, PrintStream out)
    • signal

      public void signal()
    • getWarnings

      public List<String> getWarnings()
      Description copied from interface: Report
      Return the warnings. This list must not be changed and may be immutable.
      Specified by:
      getWarnings in interface Report
      Returns:
      the warnings
    • getErrors

      public List<String> getErrors()
      Description copied from interface: Report
      Return the errors. This list must not be changed and may be immutable.
      Specified by:
      getErrors in interface Report
      Returns:
      the errors
    • parseHeader

      public static Parameters parseHeader(String value, Processor logger)
      Standard OSGi header parser.
      Parameters:
      value -
    • parseHeader

      public Parameters parseHeader(String value)
    • addClose

      public void addClose(AutoCloseable closeable)
    • removeClose

      public void removeClose(AutoCloseable closeable)
    • 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 interface Reporter
      Returns:
      if this is a pedantic reporter.
    • setPedantic

      public void setPedantic(boolean pedantic)
    • use

      public void use(Processor reporter)
    • getFile

      public static File getFile(File base, String file)
    • getFile

      public File getFile(String file)
    • getPlugins

      public <T> List<T> getPlugins(Class<T> clazz)
      Return a list of plugins that implement the given class.
      Specified by:
      getPlugins in interface Registry
      Parameters:
      clazz - Each returned plugin implements this class/interface
      Returns:
      A list of plugins
    • getPlugin

      public <T> T getPlugin(Class<T> clazz)
      Returns the first plugin it can find of the given type.
      Specified by:
      getPlugin in interface Registry
      Type Parameters:
      T -
      Parameters:
      clazz -
    • getPlugins

      public PluginsContainer 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

      private Memoize<PluginsContainer> newPluginsContainer()
      Return a memoizer for the PluginsContainer.
    • addExtensions

      protected void addExtensions(PluginsContainer pluginsContainer)
      Is called after the PluginsContainer is initialized.
      Parameters:
      pluginsContainer -
    • setTypeSpecificPlugins

      protected void setTypeSpecificPlugins(PluginsContainer pluginsContainer)
    • customize

      protected <T> T customize(T plugin, Attrs map, PluginsContainer pluginsContainer)
      Set the initial parameters of a plugin
      Parameters:
      plugin -
      map -
    • isFailOk

      public boolean isFailOk()
      Indicates that this run should ignore errors and succeed anyway
      Overrides:
      isFailOk in class Domain
      Returns:
      true if this processor should return errors
    • getBase

      public File getBase()
    • getBaseURI

      public URI getBaseURI()
    • setBase

      public void setBase(File base)
    • clear

      public void clear()
    • getLogger

      public org.slf4j.Logger getLogger()
    • trace

      public void trace(String msg, Object... parms)
      Used to provide verbose commands
      Specified by:
      trace in interface Reporter
      Parameters:
      msg - The format of the error
      parms - The arguments of the error
    • newList

      public <T> List<T> newList()
    • newSet

      public <T> Set<T> newSet()
    • newMap

      public static <K, V> Map<K,V> newMap()
    • newHashMap

      public static <K, V> Map<K,V> newHashMap()
    • newList

      public <T> List<T> newList(Collection<T> t)
    • newSet

      public <T> Set<T> newSet(Collection<T> t)
    • newMap

      public <K, V> Map<K,V> newMap(Map<K,V> t)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • clearPlugins

      private void clearPlugins()
    • _basedir

      public String _basedir(String[] args)
    • _propertiesname

      public String _propertiesname(String[] args)
    • _propertiesdir

      public String _propertiesdir(String[] args)
    • _uri

      public String _uri(String[] args) throws Exception
      Throws:
      Exception
    • _fileuri

      public String _fileuri(String[] args) throws Exception
      Throws:
      Exception
    • getProperties

      public Properties getProperties()
      Property handling ...
    • getProperties0

      private Properties getProperties0()
    • getProperty

      public String getProperty(String key)
    • getUnexpandedProperty

      public String getUnexpandedProperty(String key)
    • mergeProperties

      public void mergeProperties(File file, boolean overwrite)
    • mergeProperties

      public void mergeProperties(Properties properties, boolean overwrite)
    • setProperties

      public void setProperties(Properties properties)
    • setProperties

      public void setProperties(File base, Properties properties)
    • addProperties

      public void addProperties(File file) throws Exception
      Throws:
      Exception
    • addProperties

      public void addProperties(Map<?,?> properties)
    • addIncluded

      public void addIncluded(File file)
    • addIncludedIfAbsent

      private boolean addIncludedIfAbsent(File file)
    • removeIncluded

      private boolean removeIncluded(File file)
    • doIncludes

      private void doIncludes(File ubase, Properties p)
      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

      public void doIncludeFile(File file, boolean overwrite, Properties target) throws Exception
      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

      public void unsetProperty(String string)
    • 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

      public void setProperties(File propertiesFile)
      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

      public void setProperties(File propertiesFile, File base)
    • begin

      protected void begin()
    • isTrue

      public static boolean isTrue(String value)
    • getUnprocessedProperty

      public String getUnprocessedProperty(String key, String deflt)
      Get a property without preprocessing it with a proper default
      Parameters:
      key -
      deflt -
    • getProperty

      public String getProperty(String key, String deflt)
      Get a property with preprocessing it with a proper default
      Parameters:
      key -
      deflt -
    • getProperty

      public String getProperty(String key, String deflt, String separator)
    • getProperty

      private String getProperty(String key, String deflt, String separator, boolean inherit)
    • getWildcardProperty

      private String getWildcardProperty(String deflt, String separator, boolean inherit, Instruction ins)
    • getLiteralProperty

      private String getLiteralProperty(String key, String deflt, Processor source, boolean inherit)
    • loadProperties

      public Properties loadProperties(File file) throws IOException
      Helper to load a properties file from disk.
      Parameters:
      file -
      Throws:
      IOException
    • loadProperties0

      UTF8Properties loadProperties0(File file) throws IOException
      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

      public static Properties replaceAll(Properties p, String pattern, String replacement)
      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

      public static String printClauses(Map<?,? extends Map<?,?>> exports) throws IOException
      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<?,?>> exports, boolean checkMultipleVersions) throws IOException
      Throws:
      IOException
    • printClause

      public static void printClause(Map<?,?> map, StringBuilder sb) throws IOException
      Throws:
      IOException
    • quote

      public static boolean quote(Appendable sb, String value) throws IOException
      Parameters:
      sb -
      value -
      Throws:
      IOException
    • getReplacer

      public Macro getReplacer()
    • getMacroDomains

      protected Object[] getMacroDomains()
      This should be overridden by subclasses to add extra macro command domains on the search list.
    • getFlattenedProperties

      public Properties getFlattenedProperties()
      Return the properties but expand all macros. This always returns a new Properties object that can be used in any way.
    • getFlattenedProperties

      public Properties getFlattenedProperties(boolean ignoreInstructions)
      Return the properties but expand all macros. This always returns a new Properties object that can be used in any way.
    • getPropertyKeys

      public Set<String> getPropertyKeys(boolean inherit)
      Return all inherited property keys. The keys are sorted for consistent ordering.
    • updateModified

      public boolean updateModified(long time, String reason)
    • lastModified

      public long lastModified()
    • setProperty

      public void setProperty(String key, String value)
      Add or overwrite a new property.
      Parameters:
      key -
      value -
    • getManifestAsProperties

      public static Properties getManifestAsProperties(InputStream in) throws IOException
      Read a manifest but return a properties object.
      Parameters:
      in -
      Throws:
      IOException
    • getPropertiesFile

      public File getPropertiesFile()
    • setFileMustExist

      public void setFileMustExist(boolean mustexist)
    • read

      public static String read(InputStream in) throws Exception
      Throws:
      Exception
    • join

      public static String join(Collection<?> list)
      Join a list.
    • join

      public static String join(Collection<?> list, String delimeter)
    • join

      public static String join(Collection<?>... lists)
    • join

      public static String join(String delimeter, Collection<?>... lists)
    • join

      public static String join(Object[] list, String delimeter)
    • join

      public static <T> String join(T[] list)
    • split

      public static void split(String s, Collection<String> collection)
    • split

      public static Collection<String> split(String s)
    • split

      public static Collection<String> split(String s, String splitter)
    • merge

      public static String merge(String... strings)
    • isExceptions

      public boolean isExceptions()
    • setExceptions

      public void setExceptions(boolean exceptions)
    • normalize

      public String normalize(String file)
      Make the file short if it is inside our base directory, otherwise long.
      Parameters:
      file -
    • normalize

      public String normalize(File file)
    • removeDuplicateMarker

      public static String removeDuplicateMarker(String key)
    • isDuplicate

      public static boolean isDuplicate(String key)
    • setTrace

      public void setTrace(boolean x)
    • getLoader

      protected Processor.CL getLoader()
    • newPluginLoader

      private CloseableMemoize<Processor.CL> 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.
      Specified by:
      isOk in interface Report
      Returns:
      true if this run should be disregarded due to errors
    • fixupMessages

      private void fixupMessages()
      Move errors and warnings to their proper place by scanning the fixup messages property.
    • doFixup

      private void doFixup(Instructions instrs, List<String> messages, List<String> other, String type)
    • check

      public boolean check(String... pattern) throws IOException
      Throws:
      IOException
    • report

      protected void report(Appendable out) throws IOException
      Throws:
      IOException
    • isPerfect

      public boolean isPerfect()
    • setForceLocal

      public void setForceLocal(Collection<String> local)
    • isMissingPlugin

      public boolean isMissingPlugin(String name)
      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

      public static String appendPath(String... parts)
      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

      public static Attrs doAttrbutes(Object[] attrs, Clazz clazz, Macro macro)
      Parse the a=b strings and return a map of them.
      Parameters:
      attrs -
      clazz -
    • formatArrays

      public 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.
      Parameters:
      string -
      parms -
    • makePrintable

      public static Object makePrintable(Object object)
      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

      private static Object[] makePrintableArray(Object array)
    • append

      public static String append(String... strings)
    • getClass

      public Class<?> getClass(String type, File jar) throws Exception
      Throws:
      Exception
    • isTrace

      public boolean isTrace()
    • getDuration

      public static long getDuration(String tm, long dflt)
    • _random

      public 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). Takes an optional parameter for the length of string to generate; default is 8 characters.
    • _native_capability

      public String _native_capability(String... args) throws Exception

      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

      protected Processor beginHandleErrors(String message)
      Set the current command thread. This must be balanced with the endHandleErrors(Processor) method. The method returns the previous command owner or null. The command owner will receive all warnings and error reports.
    • endHandleErrors

      protected void endHandleErrors(Processor previous)
      End a command. Will restore the previous command owner.
      Parameters:
      previous -
    • getExecutor

      public static Executor getExecutor()
    • getScheduledExecutor

      public static ScheduledExecutorService getScheduledExecutor()
    • getPromiseFactory

      public static org.osgi.util.promise.PromiseFactory getPromiseFactory()
    • addBasicPlugin

      public void addBasicPlugin(Object plugin)
      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

      public void removeBasicPlugin(Object plugin)
    • getIncluded

      public List<File> getIncluded()
    • get

      public String get(String key)
      Overrides for the Domain class
      Specified by:
      get in class Domain
    • get

      public String get(String key, String deflt)
      Overrides:
      get in class Domain
    • set

      public void set(String key, String value)
      Specified by:
      set in class Domain
    • stream

      Stream<String> stream()
    • stream

      private Stream<String> stream(boolean inherit)
    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>
    • spliterator

      public Spliterator<String> spliterator()
      Specified by:
      spliterator in interface Iterable<String>
    • iterable

      private Iterable<String> iterable(boolean inherit, Predicate<String> keyFilter)
    • keySet

      public Set<String> keySet()
    • toString

      public String toString()
      Printout of the status of this processor for toString()
      Overrides:
      toString in class Object
    • replaceExtension

      public String replaceExtension(String s, String extension, String newExtension)
      Utiltity to replace an extension
      Parameters:
      s -
      extension -
      newExtension -
    • setLocation

      public Reporter.SetLocation setLocation(String header, String clause, Reporter.SetLocation setLocation)
    • location

      private Reporter.SetLocation location(String s)
    • getLocation

      public Report.Location getLocation(String msg)
      Description copied from interface: Report
      Return the errors for the given error or warning. Can return null.
      Specified by:
      getLocation in interface Report
      Parameters:
      msg - The message
      Returns:
      null or the location of the message
    • getHeader

      public Processor.FileLine getHeader(String header) throws Exception
      Get a header relative to this processor, taking its parents and includes into account.
      Parameters:
      header -
      Throws:
      IOException
      Exception
    • toFullHeaderPattern

      public static Pattern toFullHeaderPattern(String header)
    • getHeader

      public Processor.FileLine getHeader(Pattern header) throws Exception
      Throws:
      Exception
    • getHeader

      public Processor.FileLine getHeader(String header, String clause) throws Exception
      Throws:
      Exception
    • getHeader

      public Processor.FileLine getHeader(Pattern header, Pattern clause) throws Exception
      Throws:
      Exception
    • getHeader0

      private Processor.FileLine getHeader0(Pattern header, Pattern clause) throws Exception
      Throws:
      Exception
    • findHeader

      public static Processor.FileLine findHeader(File f, String header) throws IOException
      Throws:
      IOException
    • findHeader

      public static Processor.FileLine findHeader(File f, Pattern header) throws IOException
      Throws:
      IOException
    • findHeader

      public static Processor.FileLine findHeader(File f, Pattern header, Pattern clause) throws IOException
      Throws:
      IOException
    • getLine

      public static int getLine(String s, int index)
    • since

      public boolean since(Version introduced)
    • report

      public void report(Map<String,Object> table) throws Exception
      Report the details of this processor. Should in general be overridden
      Parameters:
      table -
      Throws:
      Exception
    • is

      public boolean is(String propertyName)
      Simplified way to check booleans
    • mergeProperties

      public String mergeProperties(String key)
      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

      public String mergeLocalProperties(String key)
    • mergeProperties

      public String mergeProperties(String key, String separator)
    • makeWildcard

      private String makeWildcard(String key)
    • getMergedParameters

      public Parameters getMergedParameters(String key)
      Get a Parameters from merged properties
    • concat

      public <T> T[] concat(Class<T> type, T[] prefix, T suffix)
      Add an element to an array, creating a new one if necessary
    • getJarFromName

      public Jar 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.
      Parameters:
      name - URL or filename relative to the base
      from - Message identifying the caller for errors
      Returns:
      null or a Jar with the contents for the name
    • fileName

      private String fileName(String path)
    • _thisfile

      public String _thisfile(String[] args)
      Return the name of the properties file
    • getSettings

      public void getSettings(Processor p)
      Copy the settings of another processor
    • _frange

      public String _frange(String[] args)
      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

      public String _findfile(String[] args)
    • tree

      void tree(List<String> list, File current, String path, Instruction instr)
    • getInstructions

      public <T> T getInstructions(Class<T> type)
      Return an instance of an interface where each method is mapped to an instruction available from this Processor. See SyntaxAnnotation 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

      public Parameters getParameters(String key, boolean allowDuplicates)
      Overrides:
      getParameters in class Domain
    • system

      public String system(boolean allowFail, String command, String input) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • system

      public String system(String command, String input) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • getJavaExecutable

      public String getJavaExecutable(String java)
    • decorated

      public Parameters decorated(String key, boolean literalsIncluded)
      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

      public Parameters decorated(String key)
    • getProfile

      public String getProfile()
    • getChecksum

      public String getChecksum()
      A checksum based on the values of the properties
      Returns:
      A checksum based on the values of the properties
    • getSelfAndAncestors

      public List<File> 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

      private List<File> getSelfAndAncestors(List<File> l)
    • setPropertiesFile

      public void setPropertiesFile(File source)
      Set the properties file but do **not** load the properties.
      Parameters:
      source - the properties file