com.quantifind.sumac

FieldArgs

trait FieldArgs extends Args

Mix this trait into any class that you want to turn into an "argument holder". It will automatically convert each field of the class into a command line argument. It will silently ignore fields that it doesn't know how to parse.

Linear Supertypes
Args, Serializable, Serializable, ExternalConfig, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FieldArgs
  2. Args
  3. Serializable
  4. Serializable
  5. ExternalConfig
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def addValidation(f: ⇒ Unit): Unit

    Definition Classes
    Args
  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def getArgs(argPrefix: String): Traversable[ArgAssignable]

    Definition Classes
    Args
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def getDefaultArgs: Traversable[ArgAssignable]

    Returns the "default" values for the arguments of this class.

    Returns the "default" values for the arguments of this class. Unrelated to the current value of those arguments. Unless overridden, "default" means whatever values are assigned by the no-arg constructor of this class.

    returns

    Definition Classes
    Args
  13. def getStringValues: Map[String, String]

    get back the current (name, value) of all arguments as strings.

    get back the current (name, value) of all arguments as strings. This does not just return the original arguments that were passed to this function -- they may have been changed from defaulting, validation, etc.

    In general, users will not need this function, but it is useful for tools built on top, eg. saving to a property file

    Definition Classes
    Args
  14. def hasSetter(f: Field): Boolean

  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. def helpMessage: String

    Definition Classes
    Args
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def isNestedArgField(f: Field): Boolean

  19. def isSumacHelperField(f: Field): Boolean

  20. def isValidField(f: Field): Boolean

  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. def parse(kvPairs: Map[String, String], validation: Boolean = true): Unit

    Definition Classes
    Args
  25. def parse(args: Array[String]): Unit

    Definition Classes
    Args
  26. def parse(commandLineArgs: String): Unit

    Definition Classes
    Args
  27. lazy val parser: ArgumentParser[ArgAssignable]

    Definition Classes
    Args
  28. def readArgs(originalArgs: Map[String, String]): Map[String, String]

    Read config from an external source, and use that to modify the set of arguments.

    Read config from an external source, and use that to modify the set of arguments. The "original" arguments are given as an argument to this function, so that this method can base its behavior on those arguments. (Eg., it can take a filename from those args.) It should return the complete set of args that should be used. It is free to choose to completely replace the original args, append to them, modify them, etc.

    in general, implementations should be abstract override with a call to super, to allow multiple external configs via the Stackable Trait Pattern

    Definition Classes
    ArgsExternalConfig
  29. def registerAnnotationValidation(annotation: Class[_ <: Annotation])(validationFunction: (Any, Any, Annotation, String) ⇒ Unit): Unit

  30. def registerAnnotationValidationUpdate(annotation: Class[_ <: Annotation])(validationFunction: (Any, Any, Annotation, String, ArgAssignable) ⇒ Unit): Unit

    Use this function to make an annotation automatically imply a validation function.

    Use this function to make an annotation automatically imply a validation function. This registers the annotation with *this* instance, so that any use of the annotation automatically adds the validation function on the field.

    In general, if you create user-defined annotation validation functions, you will want to call this in a base trait, which all your arg classes extend, so you can use those annotations anywhere.

    annotation

    the class of the annotation to add a validation function to

    validationFunction

    the function that will be called to validate every field marked w/ the annotation. The first argument is the default value of the argument, the second is the current value, the third is the annotation, and the fourth is the name of the argument (for error msgs).

  31. def registerParser[T](parser: Parser[T]): Unit

    add the ability to parse your own custom types.

    add the ability to parse your own custom types. Note that this registers the parser *globally*, not just for this object.

    Definition Classes
    Args
  32. def runValidation(): Unit

    run all validation functions.

    run all validation functions.

    Note that parse automatically runs all validation, so in general a user will not need to call this. However, if you are programatically filling in the the args of this object, you probably want to call this.

    Definition Classes
    Args
  33. def saveConfig(): Unit

    save the config back to the external source.

    save the config back to the external source. Any parameters for this method should have already been extracted from the call to readArgs

    as with readArgs, this should in general be implemented as an abstract override with a call to super

    Definition Classes
    ArgsExternalConfig
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. var validationFunctions: Seq[() ⇒ Unit]

    Definition Classes
    Args
  37. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Args

Inherited from Serializable

Inherited from Serializable

Inherited from ExternalConfig

Inherited from AnyRef

Inherited from Any

Ungrouped