A TransitionMetadataParser for text in which the TransitionMetadata fields are provided in a key/value format.
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.
Eric Evans
Implementation of the Transition trait.
Implementation of the Transition trait.
Eric Evans
Parse an optional TransitionMetaData instance from text.
Parse an optional TransitionMetaData instance from text.
Eric Evans
A
TransitionMetadataParserfor text in which theTransitionMetadatafields 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:
Since newlines are ignored as whitespace, the following block parsed as a String also returns the same TransitionMetaData as above: as does this block:transition-before = 1.0.4 transition-after = 1.0.5 transition-destructive = trueAuthor:
Eric Evans