Class RuntimePropertiesImpl

  • All Implemented Interfaces:
    org.refcodes.component.Resetable, org.refcodes.configuration.ext.console.ArgsParserProperties, RuntimeProperties, org.refcodes.configuration.Properties, org.refcodes.configuration.ResourceProperties, org.refcodes.configuration.ResourcePropertiesMixin<RuntimeProperties>, org.refcodes.console.ArgsParser, org.refcodes.console.ArgsParserMixin<org.refcodes.console.ArgsParser>, org.refcodes.console.RootConditionAccessor, org.refcodes.console.RootConditionAccessor.RootConditionBuilder<RuntimeProperties>, org.refcodes.console.RootConditionAccessor.RootConditionMutator, org.refcodes.mixin.DelimiterAccessor, org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<org.refcodes.console.ArgsParser>, org.refcodes.mixin.DescriptionAccessor.DescriptionMutator, org.refcodes.mixin.Dumpable, org.refcodes.mixin.NameAccessor.NameBuilder<org.refcodes.console.ArgsParser>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.SecretAccessor.SecretBuilder<RuntimeProperties>, org.refcodes.mixin.SecretAccessor.SecretMutator, org.refcodes.mixin.TitleAccessor.TitleBuilder<org.refcodes.console.ArgsParser>, org.refcodes.mixin.TitleAccessor.TitleMutator, org.refcodes.mixin.TypeAccessor<java.lang.String>, org.refcodes.structure.CanonicalMap, org.refcodes.structure.Containable, org.refcodes.structure.Dictionary<java.lang.String,java.lang.String>, org.refcodes.structure.Keys<java.lang.String,java.lang.String>, org.refcodes.structure.PathMap<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin

    public class RuntimePropertiesImpl
    extends org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
    implements RuntimeProperties
    The RuntimePropertiesImpl composite represent command line properties, system properties as well as environment variables (in that order) and resource properties. The RuntimePropertiesImpl are actually constructed from ArgsParserProperties, SystemProperties, EnvironmentProperties and ResourceProperties instances (in that precedence). Add the ResourceProperties via the following methods RuntimeProperties.withFile(File), RuntimeProperties.withFilePath(String), RuntimeProperties.withUrl(URL) or RuntimeProperties.withInputStream(InputStream). Obfuscation may be applied to the properties as of the ObfuscationProperties and ObfuscationProperties.ObfuscationPropertiesBuilder types.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.structure.CanonicalMap

        org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor

        org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
      • Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary

        org.refcodes.structure.Dictionary.MutableDictionary<K extends java.lang.Object,V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap

        org.refcodes.structure.PathMap.MutablePathMap<T extends java.lang.Object>, org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.configuration.Properties

        org.refcodes.configuration.Properties.MutableProperties, org.refcodes.configuration.Properties.PropertiesBuilder
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<T extends java.lang.Object>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
      • Nested classes/interfaces inherited from interface org.refcodes.configuration.ResourceProperties

        org.refcodes.configuration.ResourceProperties.MutableResoureProperties, org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder
      • Nested classes/interfaces inherited from interface org.refcodes.console.RootConditionAccessor

        org.refcodes.console.RootConditionAccessor.RootConditionBuilder<B extends org.refcodes.console.RootConditionAccessor.RootConditionBuilder<B>>, org.refcodes.console.RootConditionAccessor.RootConditionMutator, org.refcodes.console.RootConditionAccessor.RootConditionProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor

        org.refcodes.mixin.TypeAccessor.TypeMutator<T extends java.lang.Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends java.lang.Object>
    • Field Summary

      • Fields inherited from interface org.refcodes.configuration.Properties

        DEFAULT_COMMENT
      • Fields inherited from interface org.refcodes.configuration.ResourceProperties

        VALUE_ATTRIBUTES
    • Constructor Summary

      Constructors 
      Constructor Description
      RuntimePropertiesImpl()
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments.
      RuntimePropertiesImpl​(java.lang.String aSecret)
      Constructs a RuntimeProperties instance with a custom secret for obfuscation.
      RuntimePropertiesImpl​(java.lang.String[] aArgs)
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done.
      RuntimePropertiesImpl​(java.lang.String[] aArgs, java.lang.String aSecret)
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done.
      RuntimePropertiesImpl​(java.lang.String[] aArgs, org.refcodes.runtime.SystemContext aObfuscationMode)
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory)
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, java.lang.String aSecret)
      Constructs a RuntimeProperties instance with a custom secret for obfuscation.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, java.lang.String[] aArgs)
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, java.lang.String[] aArgs, java.lang.String aSecret)
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, java.lang.String[] aArgs, org.refcodes.runtime.SystemContext aObfuscationMode)
      Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, org.refcodes.console.Condition aRootCondition)
      Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, org.refcodes.console.Condition aRootCondition, java.lang.String aSecret)
      Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, org.refcodes.console.Condition aRootCondition, org.refcodes.runtime.SystemContext aObfuscationMode)
      Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
      RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory, org.refcodes.runtime.SystemContext aObfuscationMode)
      Constructs the RuntimeProperties with the given obfuscation mode
      RuntimePropertiesImpl​(org.refcodes.console.Condition aRootCondition)
      Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
      RuntimePropertiesImpl​(org.refcodes.console.Condition aRootCondition, java.lang.String aSecret)
      Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
      RuntimePropertiesImpl​(org.refcodes.console.Condition aRootCondition, org.refcodes.runtime.SystemContext aObfuscationMode)
      Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
      RuntimePropertiesImpl​(org.refcodes.runtime.SystemContext aObfuscationMode)
      Constructs the RuntimeProperties with the given obfuscation mode
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addProperties​(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
      Reads the ResourceProperties.ResourcePropertiesBuilder from the given data sink.
      protected void addProperties​(java.io.InputStream aInputStream, char[] aDelimiters)
      Reads the ResourceProperties from the given data sink.
      protected void addProperties​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
      Reads the ResourceProperties.ResourcePropertiesBuilder from the given data sink.
      protected void addProperties​(java.net.URL aUrl, char... aDelimiters)
      Reads the ResourceProperties from the given data sink.
      protected void addProperties​(org.refcodes.configuration.Properties aProperties)  
      org.refcodes.configuration.Properties childrenOf​(java.lang.String aParentPath)
      boolean containsKey​(java.lang.Object aKey)
      void errorLn​(java.lang.String aLine)
      java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.lang.String[] aArgs)
      java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.lang.String aToPath, java.lang.String[] aArgs)
      java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.lang.String aToPath, java.util.List<java.lang.String> aArgs)
      java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.util.List<java.lang.String> aArgs)
      java.lang.String get​(java.lang.Object aKey)
      char getDelimiter()
      protected org.refcodes.configuration.Properties getProperties()  
      org.refcodes.console.Condition getRootCondition()
      boolean isEmpty()
      java.util.Set<java.lang.String> keySet()
      void printBanner()
      void printCopyrightNote()
      void printDescription()
      void printHelp()
      void printLicenseNote()
      void printLn()
      void printLn​(java.lang.String aLine)
      void printOptions()
      void printSeparatorLn()
      void printUsage()
      org.refcodes.configuration.Properties reload()
      org.refcodes.configuration.Properties reload​(org.refcodes.configuration.ReloadMode aReloadMode)
      void reset()
      org.refcodes.configuration.Properties retrieveFrom​(java.lang.String aFromPath)
      org.refcodes.configuration.Properties retrieveTo​(java.lang.String aToPath)
      void setBannerFont​(org.refcodes.textual.Font aBannerFont)
      void setBannerFontPalette​(char[] aColorPalette)
      void setConsoleWidth​(int aConsoleWidth)
      void setCopyrightNote​(java.lang.String aCopyrightNote)
      void setDescription​(java.lang.String aDescription)
      void setErrorOut​(java.io.PrintStream aErrorOut)
      void setLicenseNote​(java.lang.String aLicenseNote)
      void setLineBreak​(java.lang.String aLineBreak)
      void setMaxConsoleWidth​(int aMaxConsoleWidth)
      void setName​(java.lang.String aName)
      void setObfuscationMode​(org.refcodes.runtime.SystemContext aObfuscationMode)
      Specifies the obfuscation mode to be used.
      void setRootCondition​(org.refcodes.console.Condition aRootCondition)
      void setSecret​(java.lang.String aSecret)
      void setSeparatorChar​(char aSeparatorChar)
      void setStandardOut​(java.io.PrintStream aStandardOut)
      void setSyntaxNotation​(org.refcodes.console.SyntaxNotation aSyntaxNotation)
      void setTitle​(java.lang.String aTitle)
      void setUsageLabel​(java.lang.String aUsageLabel)
      int size()
      java.lang.Object toDataStructure​(java.lang.String aFromPath)
      java.util.Collection<java.lang.String> values()
      RuntimeProperties withFile​(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
      RuntimeProperties withFilePath​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
      RuntimeProperties withInputStream​(java.io.InputStream aInputStream, char... aDelimiters)
      RuntimeProperties withParseArgs​(java.lang.String[] aArgs)
      RuntimeProperties withProperties​(org.refcodes.configuration.Properties aProperties)
      A hook for you to provide Properties programmatically.
      RuntimeProperties withUrl​(java.net.URL aUrl, char... aDelimiters)
      • Methods inherited from class org.refcodes.configuration.AbstractPropertiesDecorator

        setProperties
      • Methods inherited from interface org.refcodes.structure.CanonicalMap

        toInstance, toInstance, toType, toType
      • Methods inherited from interface org.refcodes.mixin.Dumpable

        toDump, toDump
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.structure.PathMap

        directories, directories, entries, entries, fromExternalKey, get, get, getArray, getArray, getIndexes, getIndexes, getRootPath, hasIndexed, hasIndexed, hasParentPath, isArray, isArray, isDirectory, isEntry, isIndexed, isIndexed, isPath, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toExternalKey, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath, toPath
      • Methods inherited from interface org.refcodes.configuration.Properties

        containsValue, getIndexed, getIndexed, getType, retrieve, toMap, toProperties, toPropertyPath
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        containsKey, get, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
      • Methods inherited from interface org.refcodes.configuration.ResourcePropertiesMixin

        withFile, withFilePath, withFilePath, withFilePath
    • Constructor Detail

      • RuntimePropertiesImpl

        public RuntimePropertiesImpl()
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments. As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments when invoking RuntimeProperties.withEvalArgs(String[]).
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(java.lang.String[] aArgs)
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments.
        Parameters:
        aArgs - The command line arguments to be evaluated.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.console.Condition aRootCondition)
        Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
        Parameters:
        aRootCondition - The root condition being the node from which parsing the command line arguments starts. Parse the command line arguments via evalArgs(String[]).
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.runtime.SystemContext aObfuscationMode)
        Constructs the RuntimeProperties with the given obfuscation mode
        Parameters:
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(java.lang.String[] aArgs,
                                     org.refcodes.runtime.SystemContext aObfuscationMode)
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments. Also constructs the RuntimeProperties with the given obfuscation mode
        Parameters:
        aArgs - The command line arguments to be evaluated.
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.console.Condition aRootCondition,
                                     org.refcodes.runtime.SystemContext aObfuscationMode)
        Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments. Also constructs the RuntimeProperties with the given obfuscation mode.
        Parameters:
        aRootCondition - The root condition being the node from which parsing the command line arguments starts. Parse the command line arguments via evalArgs(String[]).
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(java.lang.String aSecret)
        Constructs a RuntimeProperties instance with a custom secret for obfuscation.
        Parameters:
        aSecret - The secret to be used when encountering upon obfuscated properties.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(java.lang.String[] aArgs,
                                     java.lang.String aSecret)
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments. Also constructs a RuntimeProperties instance with a custom secret for obfuscation.
        Parameters:
        aArgs - The command line arguments to be evaluated.
        aSecret - The secret to be used when encountering upon obfuscated properties.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.console.Condition aRootCondition,
                                     java.lang.String aSecret)
        Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments. Also constructs a RuntimeProperties instance with a custom secret for obfuscation.
        Parameters:
        aRootCondition - The root condition being the node from which parsing the command line arguments starts. Parse the command line arguments via evalArgs(String[]).
        aSecret - The secret to be used when encountering upon obfuscated properties.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory)
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments. As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments when invoking RuntimeProperties.withEvalArgs(String[]).
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     java.lang.String[] aArgs)
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments.
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aArgs - The command line arguments to be evaluated.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     org.refcodes.console.Condition aRootCondition)
        Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments.
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aRootCondition - The root condition being the node from which parsing the command line arguments starts. Parse the command line arguments via evalArgs(String[]).
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     org.refcodes.runtime.SystemContext aObfuscationMode)
        Constructs the RuntimeProperties with the given obfuscation mode
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     java.lang.String[] aArgs,
                                     org.refcodes.runtime.SystemContext aObfuscationMode)
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments. Also constructs the RuntimeProperties with the given obfuscation mode
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aArgs - The command line arguments to be evaluated.
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     org.refcodes.console.Condition aRootCondition,
                                     org.refcodes.runtime.SystemContext aObfuscationMode)
        Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments. Also constructs the RuntimeProperties with the given obfuscation mode.
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aRootCondition - The root condition being the node from which parsing the command line arguments starts. Parse the command line arguments via evalArgs(String[]).
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     java.lang.String aSecret)
        Constructs a RuntimeProperties instance with a custom secret for obfuscation.
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aSecret - The secret to be used when encountering upon obfuscated properties.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     java.lang.String[] aArgs,
                                     java.lang.String aSecret)
        Constructs a RuntimeProperties instance with no Condition for parsing command line arguments: As no syntax notation is required by the constructor (no root Condition), no syntax validation is done. Therefore the properties are heuristically determined from the provided command line arguments. Also constructs a RuntimeProperties instance with a custom secret for obfuscation.
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aArgs - The command line arguments to be evaluated.
        aSecret - The secret to be used when encountering upon obfuscated properties.
      • RuntimePropertiesImpl

        public RuntimePropertiesImpl​(org.refcodes.configuration.PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory aPropertiesBuilderFactory,
                                     org.refcodes.console.Condition aRootCondition,
                                     java.lang.String aSecret)
        Constructs a RuntimeProperties instance with the given Condition used to parse command line arguments. Also constructs a RuntimeProperties instance with a custom secret for obfuscation.
        Parameters:
        aPropertiesBuilderFactory - The factory to use when constructing ResourceProperties instances.
        aRootCondition - The root condition being the node from which parsing the command line arguments starts. Parse the command line arguments via evalArgs(String[]).
        aSecret - The secret to be used when encountering upon obfuscated properties.
    • Method Detail

      • setRootCondition

        public void setRootCondition​(org.refcodes.console.Condition aRootCondition)
        Specified by:
        setRootCondition in interface org.refcodes.console.RootConditionAccessor.RootConditionMutator
      • setSecret

        public void setSecret​(java.lang.String aSecret)
        Specified by:
        setSecret in interface org.refcodes.mixin.SecretAccessor.SecretMutator
      • setObfuscationMode

        public void setObfuscationMode​(org.refcodes.runtime.SystemContext aObfuscationMode)
        Specifies the obfuscation mode to be used.
        Specified by:
        setObfuscationMode in interface RuntimeProperties
        Parameters:
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • withProperties

        public RuntimeProperties withProperties​(org.refcodes.configuration.Properties aProperties)
        A hook for you to provide Properties programmatically. The later you add Properties, the lower their precedence.
        Specified by:
        withProperties in interface RuntimeProperties
        Parameters:
        aProperties - The Properties to be added.
        Returns:
        This instance as of the builder pattern to apply method chaining.
      • addProperties

        protected void addProperties​(org.refcodes.configuration.Properties aProperties)
      • withFile

        public RuntimeProperties withFile​(java.io.File aFile,
                                          org.refcodes.runtime.ConfigLocator aConfigLocator,
                                          char... aDelimiters)
                                   throws java.io.IOException,
                                          java.text.ParseException
        Specified by:
        withFile in interface org.refcodes.configuration.ResourcePropertiesMixin<RuntimeProperties>
        Throws:
        java.io.IOException
        java.text.ParseException
      • withInputStream

        public RuntimeProperties withInputStream​(java.io.InputStream aInputStream,
                                                 char... aDelimiters)
                                          throws java.io.IOException,
                                                 java.text.ParseException
        Specified by:
        withInputStream in interface org.refcodes.configuration.ResourcePropertiesMixin<RuntimeProperties>
        Throws:
        java.io.IOException
        java.text.ParseException
      • withFilePath

        public RuntimeProperties withFilePath​(java.lang.Class<?> aResourceClass,
                                              java.lang.String aFilePath,
                                              org.refcodes.runtime.ConfigLocator aConfigLocator,
                                              char... aDelimiters)
                                       throws java.io.IOException,
                                              java.text.ParseException
        Specified by:
        withFilePath in interface org.refcodes.configuration.ResourcePropertiesMixin<RuntimeProperties>
        Throws:
        java.io.IOException
        java.text.ParseException
      • withUrl

        public RuntimeProperties withUrl​(java.net.URL aUrl,
                                         char... aDelimiters)
                                  throws java.io.IOException,
                                         java.text.ParseException
        Specified by:
        withUrl in interface org.refcodes.configuration.ResourcePropertiesMixin<RuntimeProperties>
        Throws:
        java.io.IOException
        java.text.ParseException
      • withParseArgs

        public RuntimeProperties withParseArgs​(java.lang.String[] aArgs)
                                        throws org.refcodes.console.UnknownArgsException,
                                               org.refcodes.console.AmbiguousArgsException,
                                               org.refcodes.console.SuperfluousArgsException,
                                               org.refcodes.console.ParseArgsException
        Specified by:
        withParseArgs in interface org.refcodes.console.ArgsParser
        Specified by:
        withParseArgs in interface org.refcodes.console.ArgsParserMixin<org.refcodes.console.ArgsParser>
        Specified by:
        withParseArgs in interface RuntimeProperties
        Throws:
        org.refcodes.console.UnknownArgsException
        org.refcodes.console.AmbiguousArgsException
        org.refcodes.console.SuperfluousArgsException
        org.refcodes.console.ParseArgsException
      • errorLn

        public void errorLn​(java.lang.String aLine)
        Specified by:
        errorLn in interface org.refcodes.console.ArgsParser
      • evalArgs

        public java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.util.List<java.lang.String> aArgs)
                                                                           throws org.refcodes.console.UnknownArgsException,
                                                                                  org.refcodes.console.AmbiguousArgsException,
                                                                                  org.refcodes.console.SuperfluousArgsException,
                                                                                  org.refcodes.console.ParseArgsException
        Specified by:
        evalArgs in interface org.refcodes.console.ArgsParser
        Specified by:
        evalArgs in interface org.refcodes.configuration.ext.console.ArgsParserProperties
        Throws:
        org.refcodes.console.UnknownArgsException
        org.refcodes.console.AmbiguousArgsException
        org.refcodes.console.SuperfluousArgsException
        org.refcodes.console.ParseArgsException
      • evalArgs

        public java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.lang.String aToPath,
                                                                                  java.util.List<java.lang.String> aArgs)
                                                                           throws org.refcodes.console.UnknownArgsException,
                                                                                  org.refcodes.console.AmbiguousArgsException,
                                                                                  org.refcodes.console.SuperfluousArgsException,
                                                                                  org.refcodes.console.ParseArgsException
        Specified by:
        evalArgs in interface org.refcodes.configuration.ext.console.ArgsParserProperties
        Throws:
        org.refcodes.console.UnknownArgsException
        org.refcodes.console.AmbiguousArgsException
        org.refcodes.console.SuperfluousArgsException
        org.refcodes.console.ParseArgsException
      • evalArgs

        public java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.lang.String aToPath,
                                                                                  java.lang.String[] aArgs)
                                                                           throws org.refcodes.console.UnknownArgsException,
                                                                                  org.refcodes.console.AmbiguousArgsException,
                                                                                  org.refcodes.console.SuperfluousArgsException,
                                                                                  org.refcodes.console.ParseArgsException
        Specified by:
        evalArgs in interface org.refcodes.configuration.ext.console.ArgsParserProperties
        Throws:
        org.refcodes.console.UnknownArgsException
        org.refcodes.console.AmbiguousArgsException
        org.refcodes.console.SuperfluousArgsException
        org.refcodes.console.ParseArgsException
      • evalArgs

        public java.util.List<? extends org.refcodes.console.Operand<?>> evalArgs​(java.lang.String[] aArgs)
                                                                           throws org.refcodes.console.UnknownArgsException,
                                                                                  org.refcodes.console.AmbiguousArgsException,
                                                                                  org.refcodes.console.SuperfluousArgsException,
                                                                                  org.refcodes.console.ParseArgsException
        Specified by:
        evalArgs in interface org.refcodes.console.ArgsParser
        Specified by:
        evalArgs in interface org.refcodes.configuration.ext.console.ArgsParserProperties
        Throws:
        org.refcodes.console.UnknownArgsException
        org.refcodes.console.AmbiguousArgsException
        org.refcodes.console.SuperfluousArgsException
        org.refcodes.console.ParseArgsException
      • getRootCondition

        public org.refcodes.console.Condition getRootCondition()
        Specified by:
        getRootCondition in interface org.refcodes.console.ArgsParser
        Specified by:
        getRootCondition in interface org.refcodes.console.RootConditionAccessor
      • printBanner

        public void printBanner()
        Specified by:
        printBanner in interface org.refcodes.console.ArgsParser
      • printCopyrightNote

        public void printCopyrightNote()
        Specified by:
        printCopyrightNote in interface org.refcodes.console.ArgsParser
      • printDescription

        public void printDescription()
        Specified by:
        printDescription in interface org.refcodes.console.ArgsParser
      • printHelp

        public void printHelp()
        Specified by:
        printHelp in interface org.refcodes.console.ArgsParser
      • printLicenseNote

        public void printLicenseNote()
        Specified by:
        printLicenseNote in interface org.refcodes.console.ArgsParser
      • printLn

        public void printLn()
        Specified by:
        printLn in interface org.refcodes.console.ArgsParser
      • printLn

        public void printLn​(java.lang.String aLine)
        Specified by:
        printLn in interface org.refcodes.console.ArgsParser
      • printOptions

        public void printOptions()
        Specified by:
        printOptions in interface org.refcodes.console.ArgsParser
      • printSeparatorLn

        public void printSeparatorLn()
        Specified by:
        printSeparatorLn in interface org.refcodes.console.ArgsParser
      • printUsage

        public void printUsage()
        Specified by:
        printUsage in interface org.refcodes.console.ArgsParser
      • reset

        public void reset()
        Specified by:
        reset in interface org.refcodes.component.Resetable
      • setBannerFont

        public void setBannerFont​(org.refcodes.textual.Font aBannerFont)
        Specified by:
        setBannerFont in interface org.refcodes.console.ArgsParser
      • setBannerFontPalette

        public void setBannerFontPalette​(char[] aColorPalette)
        Specified by:
        setBannerFontPalette in interface org.refcodes.console.ArgsParser
      • setConsoleWidth

        public void setConsoleWidth​(int aConsoleWidth)
        Specified by:
        setConsoleWidth in interface org.refcodes.console.ArgsParser
      • setCopyrightNote

        public void setCopyrightNote​(java.lang.String aCopyrightNote)
        Specified by:
        setCopyrightNote in interface org.refcodes.console.ArgsParser
      • setDescription

        public void setDescription​(java.lang.String aDescription)
        Specified by:
        setDescription in interface org.refcodes.mixin.DescriptionAccessor.DescriptionMutator
      • setErrorOut

        public void setErrorOut​(java.io.PrintStream aErrorOut)
        Specified by:
        setErrorOut in interface org.refcodes.console.ArgsParser
      • setLicenseNote

        public void setLicenseNote​(java.lang.String aLicenseNote)
        Specified by:
        setLicenseNote in interface org.refcodes.console.ArgsParser
      • setLineBreak

        public void setLineBreak​(java.lang.String aLineBreak)
        Specified by:
        setLineBreak in interface org.refcodes.console.ArgsParser
      • setMaxConsoleWidth

        public void setMaxConsoleWidth​(int aMaxConsoleWidth)
        Specified by:
        setMaxConsoleWidth in interface org.refcodes.console.ArgsParser
      • setName

        public void setName​(java.lang.String aName)
        Specified by:
        setName in interface org.refcodes.mixin.NameAccessor.NameMutator
      • setSeparatorChar

        public void setSeparatorChar​(char aSeparatorChar)
        Specified by:
        setSeparatorChar in interface org.refcodes.console.ArgsParser
      • setStandardOut

        public void setStandardOut​(java.io.PrintStream aStandardOut)
        Specified by:
        setStandardOut in interface org.refcodes.console.ArgsParser
      • setSyntaxNotation

        public void setSyntaxNotation​(org.refcodes.console.SyntaxNotation aSyntaxNotation)
        Specified by:
        setSyntaxNotation in interface org.refcodes.console.ArgsParser
      • setTitle

        public void setTitle​(java.lang.String aTitle)
        Specified by:
        setTitle in interface org.refcodes.mixin.TitleAccessor.TitleMutator
      • setUsageLabel

        public void setUsageLabel​(java.lang.String aUsageLabel)
        Specified by:
        setUsageLabel in interface org.refcodes.console.ArgsParser
      • reload

        public org.refcodes.configuration.Properties reload()
                                                     throws java.io.IOException,
                                                            java.lang.IllegalStateException,
                                                            java.text.ParseException
        Specified by:
        reload in interface org.refcodes.configuration.ResourceProperties
        Throws:
        java.io.IOException
        java.lang.IllegalStateException
        java.text.ParseException
      • reload

        public org.refcodes.configuration.Properties reload​(org.refcodes.configuration.ReloadMode aReloadMode)
                                                     throws java.io.IOException,
                                                            java.lang.IllegalStateException,
                                                            java.text.ParseException
        Specified by:
        reload in interface org.refcodes.configuration.ResourceProperties
        Throws:
        java.io.IOException
        java.lang.IllegalStateException
        java.text.ParseException
      • getDelimiter

        public char getDelimiter()
        Specified by:
        getDelimiter in interface org.refcodes.mixin.DelimiterAccessor
        Specified by:
        getDelimiter in interface org.refcodes.configuration.Properties
        Overrides:
        getDelimiter in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • size

        public int size()
        Specified by:
        size in interface org.refcodes.structure.Containable
        Overrides:
        size in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • containsKey

        public boolean containsKey​(java.lang.Object aKey)
        Specified by:
        containsKey in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
        Overrides:
        containsKey in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface org.refcodes.structure.Containable
        Overrides:
        isEmpty in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • get

        public java.lang.String get​(java.lang.Object aKey)
        Specified by:
        get in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
        Overrides:
        get in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
        Overrides:
        keySet in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • values

        public java.util.Collection<java.lang.String> values()
        Specified by:
        values in interface org.refcodes.structure.Keys<java.lang.String,java.lang.String>
        Overrides:
        values in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • retrieveFrom

        public org.refcodes.configuration.Properties retrieveFrom​(java.lang.String aFromPath)
        Specified by:
        retrieveFrom in interface org.refcodes.structure.CanonicalMap
        Specified by:
        retrieveFrom in interface org.refcodes.structure.PathMap<java.lang.String>
        Specified by:
        retrieveFrom in interface org.refcodes.configuration.Properties
        Overrides:
        retrieveFrom in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • retrieveTo

        public org.refcodes.configuration.Properties retrieveTo​(java.lang.String aToPath)
        Specified by:
        retrieveTo in interface org.refcodes.structure.CanonicalMap
        Specified by:
        retrieveTo in interface org.refcodes.structure.PathMap<java.lang.String>
        Specified by:
        retrieveTo in interface org.refcodes.configuration.Properties
        Overrides:
        retrieveTo in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • childrenOf

        public org.refcodes.configuration.Properties childrenOf​(java.lang.String aParentPath)
        Specified by:
        childrenOf in interface org.refcodes.structure.CanonicalMap
        Specified by:
        childrenOf in interface org.refcodes.structure.PathMap<java.lang.String>
        Specified by:
        childrenOf in interface org.refcodes.configuration.Properties
        Overrides:
        childrenOf in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • toDataStructure

        public java.lang.Object toDataStructure​(java.lang.String aFromPath)
        Specified by:
        toDataStructure in interface org.refcodes.structure.PathMap<java.lang.String>
        Overrides:
        toDataStructure in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • getProperties

        protected org.refcodes.configuration.Properties getProperties()
        Overrides:
        getProperties in class org.refcodes.configuration.AbstractPropertiesDecorator<org.refcodes.configuration.Properties>
      • addProperties

        protected void addProperties​(java.io.File aFile,
                                     org.refcodes.runtime.ConfigLocator aConfigLocator,
                                     char... aDelimiters)
                              throws java.io.IOException,
                                     java.text.ParseException
        Reads the ResourceProperties.ResourcePropertiesBuilder from the given data sink.
        Parameters:
        aFile - The data sink from which to read the ResourceProperties.ResourcePropertiesBuilder.
        aConfigLocator - The ConfigLocator specifying where to seek for properties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Throws:
        java.io.IOException - Thrown in case there were problems reading the data sink.
        java.text.ParseException - Thrown in case there were problems parsing the data from the data sink.
      • addProperties

        protected void addProperties​(java.io.InputStream aInputStream,
                                     char[] aDelimiters)
                              throws java.io.IOException,
                                     java.text.ParseException
        Reads the ResourceProperties from the given data sink.
        Parameters:
        aInputStream - The data sink from which to read the ResourceProperties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Throws:
        java.io.IOException - Thrown in case there were problems reading the data sink.
        java.text.ParseException - Thrown in case there were problems parsing the data from the data sink.
      • addProperties

        protected void addProperties​(java.lang.Class<?> aResourceClass,
                                     java.lang.String aFilePath,
                                     org.refcodes.runtime.ConfigLocator aConfigLocator,
                                     char... aDelimiters)
                              throws java.io.IOException,
                                     java.text.ParseException
        Reads the ResourceProperties.ResourcePropertiesBuilder from the given data sink.
        Parameters:
        aResourceClass - The class which's class loader is to take care of loading the properties (from inside a JAR).
        aFilePath - The data sink from which to read the ResourceProperties.ResourcePropertiesBuilder.
        aConfigLocator - The ConfigLocator specifying where to seek for properties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Throws:
        java.io.IOException - Thrown in case there were problems reading the data sink.
        java.text.ParseException - Thrown in case there were problems parsing the data from the data sink.
      • addProperties

        protected void addProperties​(java.net.URL aUrl,
                                     char... aDelimiters)
                              throws java.io.IOException,
                                     java.text.ParseException
        Reads the ResourceProperties from the given data sink.
        Parameters:
        aUrl - The data sink from which to read the ResourceProperties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Throws:
        java.io.IOException - Thrown in case there were problems reading the data sink.
        java.text.ParseException - Thrown in case there were problems parsing the data from the data sink.