ParamsMode enum

Modes for processing parameter values.

Used to determine the behaviour of the RequestParams.values and RequestParamsMutable.remove methods.

Typically, ParamsMode.standard is used for parameters that do not have multiple lines, and ParamsMode.rawLines is used for parameters that can have multiple lines. The ParamsMode.raw is used to obtain the values without any changes.

For example, if the request contained the value of "\t a b \t\t c \r\n d \t":

  • the standard value will be "a b c d";
  • the rawLines value will be "a b \t\t c \n d"; and
  • the raw value will be "\t a b \t\t c \r\n d \t".

Be aware that values can contain any Unicode code point. In particular, the rawLines mode can return values containing horizontal tabs (U+0009), non-breaking spaces (U+00A0), zero width no-break space (U+FEFF) and other Unicode whitespaces. The raw mode may also return values containing carriage return (U+000D), vertical tabs (U+000B), line separators (U+2028) and paragraph separators (U+2029).

Line terminators are defined as the ECMA script line terminator code points (line terminator) and whitespace defined as the ECMA script whitespace code points (whitespace).

Inheritance
Available extensions

Values

standard → const ParamsMode

Whitespace and line terminators are sanitized.

  • line terminators are converted into spaces (U+0020);
  • all other whitespaces are also converted into spaces (U+0020);
  • multiple spaces are collapsed into a single space; and
  • spaces at either end of the string are trimmed away.
rawLines → const ParamsMode

Line terminators are converted into a line feed.

This means:

  • line terminators are converted into a line feed (U+000A);
  • whitespace at either end of the string are trimmed away.

Note: multiple line terminators are converted into the same number of line feeds. They are not collapsed together (except if they are trimmed from the ends).

raw → const ParamsMode

Values are unchanged.

This mode is the same as setting the deprecated raw parameter to true.

Most applications will probably want to use the rawLines mode, unless they really want to preserve the different types of line terminators and/or keep leading and trailing whitespace.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ParamsMode>
A constant List of the values in this enum, in order of their declaration.