Class ArgsParserPropertiesImpl
- java.lang.Object
-
- org.refcodes.console.ArgsParserImpl
-
- org.refcodes.configuration.ext.console.ArgsParserPropertiesImpl
-
- All Implemented Interfaces:
org.refcodes.component.Resetable
,ArgsParserProperties
,org.refcodes.configuration.Properties
,org.refcodes.console.ArgsParser
,org.refcodes.console.ArgsParserMixin<java.lang.String>
,org.refcodes.console.RootConditionAccessor
,org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<java.lang.String>
,org.refcodes.mixin.DescriptionAccessor.DescriptionMutator
,org.refcodes.mixin.Dumpable
,org.refcodes.mixin.NameAccessor.NameBuilder<java.lang.String>
,org.refcodes.mixin.NameAccessor.NameMutator
,org.refcodes.mixin.TitleAccessor.TitleBuilder<java.lang.String>
,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,T>
,org.refcodes.structure.Keys<java.lang.String,T>
,org.refcodes.structure.PathMap<java.lang.String>
,org.refcodes.structure.PropertiesAccessorMixin
public class ArgsParserPropertiesImpl extends org.refcodes.console.ArgsParserImpl implements ArgsParserProperties
-
-
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.Keys
org.refcodes.structure.Keys.MutableKeys<K extends java.lang.Object,V extends java.lang.Object>, org.refcodes.structure.Keys.MutableValues<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.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
-
-
Constructor Summary
Constructors Constructor Description ArgsParserPropertiesImpl()
Constructs theArgsParserProperties
instance with no syntax notation (no rootCondition
).ArgsParserPropertiesImpl(java.lang.String[] aArgs)
Constructs theArgsParserProperties
instance with the given arguments and the defaultSyntaxNotation.REFCODES
.ArgsParserPropertiesImpl(java.lang.String[] aArgs, org.refcodes.console.Condition aRootCondition)
Constructs theArgsParserProperties
instance with the given rootCondition
and the defaultSyntaxNotation.REFCODES
.ArgsParserPropertiesImpl(org.refcodes.console.Condition aRootCondition)
Constructs theArgsParserProperties
instance with the given rootCondition
and the defaultSyntaxNotation.REFCODES
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.Object aKey)
java.util.List<? extends org.refcodes.console.Operand<?>>
evalArgs(java.lang.String[] aArgs)
Evaluates the command line arguments and sets the identified properties in thisProperties
instance.java.util.List<? extends org.refcodes.console.Operand<?>>
evalArgs(java.lang.String aToPath, java.lang.String[] aArgs)
Same asArgsParserProperties.evalArgs(String[])
with the difference that the identified properties are inserted below the provided path.java.util.List<? extends org.refcodes.console.Operand<?>>
evalArgs(java.lang.String aToPath, java.util.List<java.lang.String> aArgs)
Same asArgsParserProperties.evalArgs(String[])
with the difference that the identified properties are inserted below the provided path.java.util.List<? extends org.refcodes.console.Operand<?>>
evalArgs(java.util.List<java.lang.String> aArgs)
Evaluates the command line arguments and sets the identified properties in thisProperties
instance.java.lang.String
get(java.lang.Object aKey)
char
getDelimiter()
boolean
isEmpty()
java.util.Set<java.lang.String>
keySet()
org.refcodes.configuration.Properties
retrieveFrom(java.lang.String aFromPath)
org.refcodes.configuration.Properties
retrieveTo(java.lang.String aToPath)
int
size()
java.lang.Object
toDataStructure(java.lang.String aPath)
java.util.Collection<java.lang.String>
values()
-
Methods inherited from interface org.refcodes.console.ArgsParser
errorLn, getRootCondition, printBanner, printCopyrightNote, printDescription, printHelp, printLicenseNote, printLn, printLn, printOptions, printSeparatorLn, printUsage, setBannerFont, setBannerFontPalette, setConsoleWidth, setCopyrightNote, setErrorOut, setLicenseNote, setLineBreak, setMaxConsoleWidth, setSeparatorChar, setStandardOut, setSyntaxNotation, setUsageLabel, withBannerFont, withBannerFontPalette, withConsoleWidth, withCopyrightNote, withDescription, withErrorOut, withLicenseNote, withLineBreak, withMaxConsoleWidth, withName, withParseArgs, withSeparatorChar, withStandardOut, withSyntaxNotation, withTitle, withUsageLabel
-
Methods inherited from class org.refcodes.console.ArgsParserImpl
errorLn, fromArgs, getRootCondition, printBanner, printCopyrightNote, printDescription, printHelp, printLicenseNote, printLn, printLn, printOptions, printSeparatorLn, printUsage, reset, setBannerFont, setBannerFontPalette, setConsoleWidth, setCopyrightNote, setDescription, setErrorOut, setLicenseNote, setLineBreak, setMaxConsoleWidth, setName, setSeparatorChar, setStandardOut, setSyntaxNotation, setTitle, setUsageLabel
-
Methods inherited from interface org.refcodes.configuration.ext.console.ArgsParserProperties
withEvalArgs, withEvalArgs, withEvalArgs, withEvalArgs
-
Methods inherited from interface org.refcodes.structure.CanonicalMap
getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, toInstance, toInstance, toType, toType
-
Methods inherited from interface org.refcodes.mixin.DescriptionAccessor.DescriptionMutator
setDescription
-
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
children, children, children, children, children, containsKey, containsKey, dirs, dirs, dirs, dirs, dirs, fromExternalPath, get, get, getArray, getArray, getArray, getArray, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getDirAt, getDirAt, getDirAt, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getRootPath, getValueAt, getValueAt, getValueAt, getValueAt, getValueAt, hasChildren, hasChildren, hasChildren, hasChildren, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasParentPath, hasPath, hasPath, hasPath, hasValueAt, hasValueAt, hasValueAt, hasValueAt, isArray, isArray, isArray, isArray, isArray, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isChild, isChild, isChild, isDir, isDir, isDir, isDir, isDirIndex, isDirIndex, isDirIndex, isDirIndex, isLeaf, isLeaf, isLeaf, isLeaf, isRootPath, keySet, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, leaves, leaves, leaves, leaves, leaves, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, paths, paths, paths, paths, paths, queryPaths, toDataStructure, toExternalPath, toLeaf, toMap, toNormalizedPath, toParentPath, toPath, toPath, toPath, toPathElements
-
Methods inherited from interface org.refcodes.configuration.Properties
containsValue, getDirAt, getDirAt, getType, query, query, queryFrom, queryTo, retrieve, retrieveFrom, retrieveFrom, retrieveFrom, retrieveTo, retrieveTo, retrieveTo, toMap, toProperties, toPropertyPath
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin
asArray, asArray, asArray, asArray, asArray, asArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, containsKey, get, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getShort, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
-
-
-
-
Constructor Detail
-
ArgsParserPropertiesImpl
public ArgsParserPropertiesImpl()
Constructs theArgsParserProperties
instance with no syntax notation (no rootCondition
). As no syntax notation is required by the constructor (no rootCondition
), no syntax validation is done byevalArgs(String[])
and the like methods. When no syntax validation is fine for you, you can directly go for the constructorArgsParserPropertiesImpl(String[])
.
-
ArgsParserPropertiesImpl
public ArgsParserPropertiesImpl(org.refcodes.console.Condition aRootCondition)
Constructs theArgsParserProperties
instance with the given rootCondition
and the defaultSyntaxNotation.REFCODES
.- Parameters:
aRootCondition
- The root condition being the node from which parsing the command line arguments starts.
-
ArgsParserPropertiesImpl
public ArgsParserPropertiesImpl(java.lang.String[] aArgs)
Constructs theArgsParserProperties
instance with the given arguments and the defaultSyntaxNotation.REFCODES
. As no syntax notation is required by the constructor (no rootCondition
), 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.
-
ArgsParserPropertiesImpl
public ArgsParserPropertiesImpl(java.lang.String[] aArgs, org.refcodes.console.Condition aRootCondition) throws org.refcodes.console.UnknownArgsException, org.refcodes.console.AmbiguousArgsException, org.refcodes.console.SuperfluousArgsException, org.refcodes.console.ParseArgsException
Constructs theArgsParserProperties
instance with the given rootCondition
and the defaultSyntaxNotation.REFCODES
.- Parameters:
aArgs
- The command line arguments to be evaluated.aRootCondition
- The root condition being the node from which parsing the command line arguments starts.- Throws:
org.refcodes.console.UnknownArgsException
- Thrown in case not one command line argument matched regarding the provided args vs. the expected args.org.refcodes.console.AmbiguousArgsException
- Thrown in case at least one command line argument is ambiguous regarding expected args vs. provided args.org.refcodes.console.SuperfluousArgsException
- Thrown in case there were arguments found not being used (superfluous arguments).org.refcodes.console.ParseArgsException
- Thrown in case the provided command line arguments do not respect the required syntax or cannot be converted to the required type
-
-
Method Detail
-
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
Evaluates the command line arguments and sets the identified properties in thisProperties
instance. Previously identified properties are reset upon invocation of this method. When provided, then anOperand
's alias is used as property name, else as fall back, the operand's (when being of sub-typeOption
) long-option or short-option is used. Make sure, to provide an alias to make theProperties
work and feel as intended!- Specified by:
evalArgs
in interfaceorg.refcodes.console.ArgsParser
- Specified by:
evalArgs
in interfaceArgsParserProperties
- Overrides:
evalArgs
in classorg.refcodes.console.ArgsParserImpl
- 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.util.List<java.lang.String> aArgs) throws org.refcodes.console.UnknownArgsException, org.refcodes.console.AmbiguousArgsException, org.refcodes.console.SuperfluousArgsException, org.refcodes.console.ParseArgsException
Evaluates the command line arguments and sets the identified properties in thisProperties
instance. Previously identified properties are reset upon invocation of this method. When provided, then anOperand
's alias is used as property name, else as fall back, the operand's (when being of sub-typeOption
) long-option or short-option is used. Make sure, to provide an alias to make theProperties
work and feel as intended!- Specified by:
evalArgs
in interfaceorg.refcodes.console.ArgsParser
- Specified by:
evalArgs
in interfaceArgsParserProperties
- 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
Same asArgsParserProperties.evalArgs(String[])
with the difference that the identified properties are inserted below the provided path.- Specified by:
evalArgs
in interfaceArgsParserProperties
- Parameters:
aToPath
- The path below which to insert the identified properties.aArgs
- The command line arguments to be evaluated.- Returns:
- The list of evaluated command line arguments being instances of
the
Operand
interfaces or its sub-types. - Throws:
org.refcodes.console.UnknownArgsException
- Thrown in case not one command line argument matched regarding the provided args vs. the expected args.org.refcodes.console.AmbiguousArgsException
- Thrown in case at least one command line argument is ambiguous regarding expected args vs. provided args.org.refcodes.console.SuperfluousArgsException
- Thrown in case there were arguments found not being used (superfluous arguments).org.refcodes.console.ParseArgsException
- Thrown in case the provided command line arguments do not respect the required syntax or cannot be converted to the required type
-
getDelimiter
public char getDelimiter()
- Specified by:
getDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor
- Specified by:
getDelimiter
in interfaceorg.refcodes.configuration.Properties
- Overrides:
getDelimiter
in classorg.refcodes.console.ArgsParserImpl
-
size
public int size()
- Specified by:
size
in interfaceorg.refcodes.structure.Containable
-
containsKey
public boolean containsKey(java.lang.Object aKey)
- Specified by:
containsKey
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceorg.refcodes.structure.Containable
-
get
public java.lang.String get(java.lang.Object aKey)
- Specified by:
get
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
values
public java.util.Collection<java.lang.String> values()
- Specified by:
values
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
retrieveFrom
public org.refcodes.configuration.Properties retrieveFrom(java.lang.String aFromPath)
- Specified by:
retrieveFrom
in interfaceorg.refcodes.structure.CanonicalMap
- Specified by:
retrieveFrom
in interfaceorg.refcodes.structure.PathMap<java.lang.String>
- Specified by:
retrieveFrom
in interfaceorg.refcodes.configuration.Properties
-
retrieveTo
public org.refcodes.configuration.Properties retrieveTo(java.lang.String aToPath)
- Specified by:
retrieveTo
in interfaceorg.refcodes.structure.CanonicalMap
- Specified by:
retrieveTo
in interfaceorg.refcodes.structure.PathMap<java.lang.String>
- Specified by:
retrieveTo
in interfaceorg.refcodes.configuration.Properties
-
toDataStructure
public java.lang.Object toDataStructure(java.lang.String aPath)
- Specified by:
toDataStructure
in interfaceorg.refcodes.structure.PathMap<java.lang.String>
-
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
Same asArgsParserProperties.evalArgs(String[])
with the difference that the identified properties are inserted below the provided path.- Specified by:
evalArgs
in interfaceArgsParserProperties
- Parameters:
aToPath
- The path below which to insert the identified properties.aArgs
- The command line arguments to be evaluated.- Returns:
- The list of evaluated command line arguments being instances of
the
Operand
interfaces or its sub-types. - Throws:
org.refcodes.console.UnknownArgsException
- Thrown in case not one command line argument matched regarding the provided args vs. the expected args.org.refcodes.console.AmbiguousArgsException
- Thrown in case at least one command line argument is ambiguous regarding expected args vs. provided args.org.refcodes.console.SuperfluousArgsException
- Thrown in case there were arguments found not being used (superfluous arguments).org.refcodes.console.ParseArgsException
- Thrown in case the provided command line arguments do not respect the required syntax or cannot be converted to the required type
-
-