Package

org.elevans.migration

parse

Permalink

package parse

Visibility
  1. Public
  2. All

Type Members

  1. class KeyValueTransitionMetadataParser extends RegexTransitionMetadataParser

    Permalink

    A TransitionMetadataParser for text in which the TransitionMetadata fields are provided in a key/value format.

    A TransitionMetadataParser for text in which the TransitionMetadata fields are provided in a key/value format.

    The keys are beforeStateKey, afterStateKey, and isDestructiveKey, and they must appear in that order in the parsed text. By default, the keys are case-insensitive; this can be explicitly set using caseSensitiveKeys.

    Each key and its value may be separated by an optional token (keyValueSeparator), which may itself be surrounded by zero or more whitespace characters (spaces, tabs, newlines, etc.). The keyValueSeparator defaults to "".

    The value for the before state and the after state in the parsed text may contain any non-whitespace characters, and it must be separated from the subsequent text by at least one whitespace character (i.e., the value is "end-delimited" by whitespace). The value for the 'is destructive' flag must be either "true" or "false", and is case-insensitive.

    For example: If instantiated with beforeStateKey = "transition-before", afterStateKey = "transition-after", isDestructiveKey = "transition-destructive", and keyValueSeparator = "=", all of the following Strings will parse to a TransitionMetaData with beforeState="1.0.4", afterState="1.0.5", and isDestructive=true:

     "transition-before = 1.0.4 transition-after = 1.0.5 transition-destructive = true"
     "transition-before=1.0.4 ; transition-after=1.0.5 ; transition-destructive=true"
     "Transition-Before = 1.0.4  Transition-After = 1.0.5   Transition-Destructive = True"
     "TRANSITION-BEFORE = 1.0.4 TRANSITION-AFTER = 1.0.5 TRANSITION-DESTRUCTIVE = TRUE"
    
    Since newlines are ignored as whitespace, the following block parsed as a String also returns the same TransitionMetaData as above:
     -- transition-before = 1.0.4
     -- transition-after = 1.0.5
     -- transition-destructive = true
    
    as does this block:
        transition-before =
        1.0.4
        transition-after
          = 1.0.5
    
        transition-destructive
        =
    
        true
    

    Author:

    Eric Evans

  2. class RegexTransitionMetadataParser extends TransitionMetadataParser

    Permalink

    TransitionMetadataParser implementation that can use any Regex that matches the three components of TransitionMetaData.

    TransitionMetadataParser implementation that can use any Regex that matches the three components of TransitionMetaData.

    Author:

    Eric Evans

  3. case class TransitionMetaData(beforeState: String, afterState: String, isDestructive: Boolean) extends Transition with Product with Serializable

    Permalink

    Implementation of the Transition trait.

    Implementation of the Transition trait.

    Author:

    Eric Evans

  4. trait TransitionMetadataParser extends AnyRef

    Permalink

    Parse an optional TransitionMetaData instance from text.

    Parse an optional TransitionMetaData instance from text.

    Author:

    Eric Evans

Ungrouped