Class

com.github.scli.ParameterModel

ModelContext

Related Doc: package ParameterModel

Permalink

class ModelContext extends ParameterMetaDataSource

A class for storing and updating meta information about command line parameters.

An instance of this class is available in the context passed to CliExtractor objects. The extractors update the instance with specific information, so that metadata about the options supported by the application is collected. This data can then be used for various purposes, e.g. to correctly parse the command line or to generate rich help texts.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ModelContext
  2. ParameterMetaDataSource
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ModelContext(options: Map[ParameterKey, ParameterAttributes], inputs: SortedSet[InputParameterRef], aliasMapping: AliasMapping, optCurrentKey: Option[ParameterKey], groups: List[String])

    Permalink

    options

    a map storing the data available for the single options

    inputs

    a set with data about input parameters

    aliasMapping

    the object with information about aliases

    optCurrentKey

    a key to the option that is currently defined

    groups

    a list with the currently active group names

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addAlias(alias: ParameterKey): ModelContext

    Permalink

    Returns an updated ModelContext with a an AliasMapping that is modified to contain the new alias provided for the current key.

    Returns an updated ModelContext with a an AliasMapping that is modified to contain the new alias provided for the current key.

    alias

    the new alias for this key

    returns

    the updated ModelContext

  5. def addAttribute[A <: AnyRef](attrKey: ParameterAttributeKey[A], value: A): ModelContext

    Permalink

    Adds an attribute for the current option.

    Adds an attribute for the current option. This function is called by CliExtractor objects to add more detailed information about a command line option. It refers to the last option that has been added.

    A

    the data type of the attribute

    attrKey

    the key of the attribute

    value

    the value of the attribute

    returns

    the updated ModelContext

  6. def addInputParameter(index: Int, optKey: Option[String], text: Option[String]): ModelContext

    Permalink

    Adds data about an input parameter to this object.

    Adds data about an input parameter to this object. This function works similar to addOption(), but creates additional information to keep track on the order of these parameters.

    index

    the index of the input parameter

    optKey

    the optional key; if it is undefined, a key is generated

    text

    an optional help text

    returns

    the updated ModelContext

  7. def addOption(key: ParameterKey, text: Option[String]): ModelContext

    Permalink

    Adds data about another command line option to this object.

    Adds data about another command line option to this object. This function creates a new ParameterAttributes instance and initializes it from the parameters passed in. It returns a new ModelContext object whose data map contains this new instance. If there is already an entry for this parameter key, it is merged with the data passed to this function.

    key

    the parameter key

    text

    an optional help text

    returns

    the updated ModelContext

  8. val aliasMapping: AliasMapping

    Permalink

    the object with information about aliases

  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  11. def endGroup(): ModelContext

    Permalink

    Notifies this context that a group has been processed.

    Notifies this context that a group has been processed. The name of the current group is removed.

    returns

    the updated ModelContext

  12. def endGroupConditionally(optGroupName: Option[String]): ModelContext

    Permalink

    Notifies this context that a group has potentially been processed.

    Notifies this context that a group has potentially been processed. If the given Option with the group name is defined, the name of the current group is removed; otherwise, this context is returned unchanged.

    optGroupName

    the Option with the group name

    returns

    the updated ModelContext or the same one

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  16. def hasAttribute(key: ParameterKey, attrKey: ParameterAttributeKey[_]): Boolean

    Permalink

    Checks whether the command line option with the given key has a specific attribute set.

    Checks whether the command line option with the given key has a specific attribute set. Only the presence of the attribute is checked, not the concrete value.

    key

    the key of the parameter

    attrKey

    the key of the attribute

    returns

    a flag whether this attribute is present for this option; if the option cannot be resolved, result is false

  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  18. val inputs: SortedSet[InputParameterRef]

    Permalink

    a set with data about input parameters

  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  23. val options: Map[ParameterKey, ParameterAttributes]

    Permalink

    a map storing the data available for the single options

  24. def parameterMetaData: Iterable[ParameterMetaData]

    Permalink

    Returns an Iterable with the ParameterMetaData stored in this object.

    Returns an Iterable with the ParameterMetaData stored in this object.

    This implementation returns data about all the parameters defined by the application.

    returns

    an Iterable with the ParameterMetaData available

    Definition Classes
    ModelContextParameterMetaDataSource
  25. def startGroup(groupName: String): ModelContext

    Permalink

    Notifies this context about the start of a new group.

    Notifies this context about the start of a new group. New options that are added later are assigned to this group.

    groupName

    the name of the group

    returns

    the updated ModelContext

  26. def startGroupConditionally(optGroupName: Option[String]): ModelContext

    Permalink

    Notifies this context about a potential start of a new group.

    Notifies this context about a potential start of a new group. If the group name is defined, a new group is started; otherwise, the same context is returned.

    optGroupName

    the optional group name

    returns

    the updated ModelContext or the same one

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from ParameterMetaDataSource

Inherited from AnyRef

Inherited from Any

Ungrouped