Difference between revisions of "Extensions.StringUtil.Decode"

From emotive
Jump to navigation Jump to search
Line 1: Line 1:
 
{{DISPLAYTITLE:'''Decode '''}}[[Category:StringUtil]]
 
{{DISPLAYTITLE:'''Decode '''}}[[Category:StringUtil]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | Decode | Decodes a string | [[Term]] | [[Extensions.StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | [[Core.Actions.Throw.Exception.UnsupportedEncodingException|UnsupportedEncodingException]] <br/> [[Core.Actions.Throw.Exception.OutOfBoundsException|OutOfBoundsException]] | - }}
+
{{ClassificationActivity | Decode | Decodes a string | [[Term]] | [[Extensions.StringUtil|OTX StringUtil extension]] | [[Extensions.StringUtil#Terms|StringUtil related terms]] | [[Extensions.StringUtil.UnsupportedEncodingException|UnsupportedEncodingException]] <br/> [[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]] | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
StringTerm = Decode(ByteFieldTerm, EncodingType);
+
StringTerm = StringUtil.Decode(EncodingTerm, ByteFieldTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''Decode''' term decodes the specified '''ByteField''' corresponding to the specified encoding and returns a '''String''' as a result.
+
The '''Decode''' term shall construct a '''String''' by decoding a given '''ByteField''' using a specified encoding.
  
 
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | Decoded string according to the given encoding.}}
 
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | Decoded string according to the given encoding.}}
Line 16: Line 16:
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| ByteField | [[Core.DataTypes.ComplexDataType.ByteField|ByteField]] | [[Term]] | - | [1] | Bytefield is converted according to the encoding in the string}}
+
{{TableRowPropertie1| Encoding | [[Extensions.StringUtil.Encoding|Encoding]] | [[Ter]] | @Encoding:US-ASCII | [1] | This element represents the encoding to be used. The set of standard encodings which shall be supported by any runtime system is given by the '''Encoding''' enumeration }}
{{TableRowPropertie1| Encoding | [[Extensions.StringUtil.Encoding|Encoding]] | [[Value]] | @Encoding:US-ASCII | [1] | Encoding is applied to the string}}
+
{{TableRowPropertie2| ByteField | [[Core.DataTypes.ComplexDataType.ByteField|ByteField]] | [[Term]] | - | [1] | Represents the ByteField which shall be transformed to a String by using the given encoding.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
String result;
+
String String1;
result = Decode(&46464646, @Encoding:US-ASCII);
+
 
 +
/// Flow
 +
 
 +
String1 = StringUtil.Decode( @Encoding:US-ASCII, &46464646);
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 11:31, 3 October 2018

Classification

Name Decode
Short Description Decodes a string
Class Term
Extension OTX StringUtil extension
Group StringUtil related terms
Exceptions UnsupportedEncodingException
OutOfBoundsException
Checker Rules -
Standard Compliant Yes

OTL Syntax

StringTerm = StringUtil.Decode(EncodingTerm, ByteFieldTerm);

Description

The Decode term shall construct a String by decoding a given ByteField using a specified encoding.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
String Decoded string according to the given encoding.

Properties

Name Data Type Class Default Cardinality Description
Encoding Encoding Ter @Encoding:US-ASCII [1] This element represents the encoding to be used. The set of standard encodings which shall be supported by any runtime system is given by the Encoding enumeration
ByteField ByteField Term - [1] Represents the ByteField which shall be transformed to a String by using the given encoding.

OTL Examples

String String1;

/// Flow

String1 = StringUtil.Decode( @Encoding:US-ASCII, &46464646);

See also

ReplaceSubString
MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
IndexOf
SplitString
ToUpper
ToLower
Encode