%Library.EnumString
datatype class %Library.EnumString extends %Library.DataType
ODBC Type: VARCHAR
The %EnumString data type class represents a string. This is a specialized type of %String that allows you to define an enumerated set of possible values (using the DISPLAYLIST and VALUELIST parameters). Unlike the regular %String class, the display values for this property are used when columns of this type are queried via ODBC.The logical value of the %EnumString data type is a string.
Method Inventory
Parameters
parameter COLLATION;
The default collation value used for this data type.
Note that if you specify a truncation length and also a VALUELIST then your truncation length must
be longer or equal to your longest VALUELIST value
parameter CONTENT = STRING;
XML element content "MIXED" for mixed="true" and "STRING" or "ESCAPE" for mixed="false".
If CONTENT="STRING" (default) XML special characters are put in a CDATA section during XML export.
If CONTENT="ESCAPE" XML special characters are escaped during XML export.
If CONTENT="ESCAPE-C14N" XML special characters are escaped during XML export using
the translate table, XMLC, specified for XML Canonicalizaton.
The main difference is that CR is escaped as
parameter DISPLAYLIST;
Used for enumerated (multiple-choice) attributes.
Used in conjunction with the VALUELIST parameter for enumerated
(multiple-choice) attributes. DISPLAYLIST, if not null,
represents the display values for the attribute corresponding with
the logical values listed in VALUELIST.
The display values are returned by the LogicalToDisplay method.
parameter ESCAPE = XML;
Controls the translate table used to escape content when CONTENT="MIXED" is specified.
parameter JSONTYPE = string;
JSONTYPE is JSON type used for this datatype.
parameter MAXLEN = 50;
The maximum number of characters the string can contain.
parameter MINLEN;
The minimum number of characters the string can contain.
parameter PATTERN;
A pattern which the string should match.
The value of PATTERN should be a valid ObjectScript pattern match expression.
parameter TRUNCATE = 0;
Determines whether to truncate the string to MAXLEN characters.
parameter VALUELIST;
Used for enumerated (multiple-choice) attributes.
VALUELIST is either a null string ("") or a delimiter
separated list (where the delimiter is the first character) of logical values.
If a non-null value is present, then the attribute is restricted to values
in the list, and the validation code simply checks to see if the value is in the list.
parameter XSDTYPE = string;
Declares the XSD type used when projecting XML Schemas.
Methods
Converts the input value %val, which is a string, into the logical string format.
Returns the logical value of the input string %val.
classmethod IsValid(%val As %RawString) as %Status
Tests if the logical value %val, which is a string, is valid.
The validation is based on the class parameter settings used for the class attribute this data type is associated with.
In this case, MINLEN, MAXLEN, VALUELIST, and PATTERN.
Converts the value of %val, which is in logical format, into a display string. Removes all the null characters from the string.
Returns the string value of %val.
Converts the value of %val, which is in logical format, into a display string.
Converts VALUELIST entries to their cooresponding DISPLAYLIST value.
Returns the string value of %val.
classmethod Normalize(%val As %RawString) as %String
Truncates value %val to MAXLEN, characters.
Converts the input value %val, which is a string, into the logical string format.
Converts DISPLAYLIST entries to their cooresponding VALUELIST value.
If there is no entry specified for the given value in the DISPLAYLIST, the input value is returned.
If this input value does not match a value in the VALUELIST a validation error will probably be returned upon filing or saving.
Returns the logical value of the input string %val.