InvalidBerData class: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
in the <var>Longstring</var> of the bad data, and <var>Description</var> describes the | in the <var>Longstring</var> of the bad data, and <var>Description</var> describes the | ||
problem. There are currently no standardized error codes. | problem. There are currently no standardized error codes. | ||
__NOTOC__ | |||
The <var>InvalidBerData</var> exception class validates whether the data being processed by the called method conforms to the BER (Privacy Enhanced Mail) protocol. BER data is base64-encoded binary data. | |||
The <var>InvalidBerData</var> class has properties that indicate the position and description of the non-conforming data. | |||
A system method that throws this exception is <var>[[PemToString (String function)|PemToString]]</var>. | |||
To produce an <var>InvalidBerData</var> exception for yourself, you typically use a <var class="product">User Language</var> <var>[[Exceptions#Throwing exceptions|Throw]]</var> statement calling the <var>InvalidBerData</var> <var>[[New_(InvalidBerData_constructor)|New]]</var> constructor: | |||
<p class="code"> throw %(InvalidBerData):new(line=1, position=13) | |||
</p> | |||
The methods of the <var>InvalidBerData</var> exception class are described below. | |||
This class is available as of <var class="product">[[Sirius Mods]]</var> Version 8.0. | |||
<h2>The InvalidBerData methods</h2> | |||
{{Template:List of InvalidBerData methods}} | |||
The methods in the class are described in the subsections that follow. In addition: | |||
<ul> | |||
<li>[[Notation conventions for methods|"Notation conventions for methods"]] has information | |||
about the conventions followed. | |||
<li>[[InvalidBerData methods syntax|"InvalidBerData methods syntax"]] is a single page that contains the syntax diagrams of the methods in the class. | |||
</ul> | |||
<h2>Description property</h2> | |||
{{Template:InvalidBerData:Description subtitle}} | |||
This <var>[[Classes and Objects#readWrite|ReadOnly]]</var> property returns the description . . . | |||
<h3>Syntax</h3> | |||
{{Template:InvalidBerData:Description syntax}} | |||
<h4>Syntax terms</h4> | |||
<table class="syntaxTable"> | |||
<tr><th>%number</th> | |||
<td>This numeric value is the line in the data being validated where a non-PEM-conforming character was found. | |||
</td></tr> | |||
<tr><th>invalidBerData</th> | |||
<td>A reference to an instance of an <var>InvalidBerData</var> object. | |||
</td></tr></table> | |||
<h2>New constructor</h2> | |||
{{Template:InvalidBerData:New subtitle}} | |||
This method generates an instance of an <var>[[InvalidBerData_class|InvalidBerData]]</var> exception. The <var>New</var> method format is as follows: | |||
<h3>Syntax</h3> | |||
{{Template:InvalidBerData:New syntax}} | |||
<h4>Syntax terms</h4> | |||
<table class="syntaxTable"> | |||
<tr><th>%invalidBerData</th> | |||
<td>A reference to an instance of a <var>InvalidBerData</var> object.</td></tr> | |||
<tr><th><var>%(InvalidBerData)</var></th><td>The class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|"Usage notes"]], below, for more information about invoking a <var>InvalidBerData</var> <var>Constructor</var>.</td></tr> | |||
</table> | |||
<h3>Usage notes</h3> | |||
<ul> | |||
<li>As described in [[Object variables#Using New or other Constructors|"Using New or other Constructors"]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is <var>Null</var>:<p class="code">%invalidBer = new | |||
%invalidBer = %(InvalidBerData):new | |||
%invalidBer = %invalidBer:new | |||
</p> | |||
</ul> | |||
<h2>Position property</h2> | |||
{{Template:InvalidBerData:Position subtitle}} | |||
This <var>[[Classes and Objects#readWrite|ReadOnly]]</var> property returns the position in the (expected) base64-encoded string where a non-BER-conforming character was found. | |||
<h3>Syntax</h3> | |||
{{Template:InvalidBerData:Position syntax}} | |||
<h4>Syntax terms</h4> | |||
<table class="syntaxTable"> | |||
<tr><th>%number</th> | |||
<td>This numeric value is the position in the base64 string (in the line identified by the value of <var>[[InvalidBerData class#Line property|Line]]</var>) where a non-BER-conforming character was found. | |||
</td></tr> | |||
<tr><th>invalidBerData</th> | |||
<td>A reference to an instance of an <var>InvalidBerData</var> object. | |||
</td></tr></table> | |||
[[Category:System exception classes]] |
Revision as of 22:51, 23 April 2012
An InvalidBerData exception can be thrown by any of the DER-to-XmlDoc methods. It has properties (Position and Description): Position indicates the position in the Longstring of the bad data, and Description describes the problem. There are currently no standardized error codes.
The InvalidBerData exception class validates whether the data being processed by the called method conforms to the BER (Privacy Enhanced Mail) protocol. BER data is base64-encoded binary data. The InvalidBerData class has properties that indicate the position and description of the non-conforming data.
A system method that throws this exception is PemToString.
To produce an InvalidBerData exception for yourself, you typically use a User Language Throw statement calling the InvalidBerData New constructor:
throw %(InvalidBerData):new(line=1, position=13)
The methods of the InvalidBerData exception class are described below.
This class is available as of Sirius Mods Version 8.0.
The InvalidBerData methods
The following are the available InvalidBerData class methods.
Method | Description |
---|---|
Description | Description of error |
New | Create a new InvalidBerData object |
Position | Position where error encountered |
The methods in the class are described in the subsections that follow. In addition:
- "Notation conventions for methods" has information about the conventions followed.
- "InvalidBerData methods syntax" is a single page that contains the syntax diagrams of the methods in the class.
Description property
Description of error (InvalidBerData class)
[Introduced in Sirius Mods 8.0]
This ReadOnly property returns the description . . .
Syntax
%string = invalidBerData:Description
Syntax terms
%number | This numeric value is the line in the data being validated where a non-PEM-conforming character was found. |
---|---|
invalidBerData | A reference to an instance of an InvalidBerData object. |
New constructor
Create a new InvalidBerData object (InvalidBerData class)
[Introduced in Sirius Mods 8.0]
This method generates an instance of an InvalidBerData exception. The New method format is as follows:
Syntax
%invalidBerData = [%(InvalidBerData):]New( Position= number, - Description= string)
Syntax terms
%invalidBerData | A reference to an instance of a InvalidBerData object. |
---|---|
%(InvalidBerData) | The class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a InvalidBerData Constructor. |
Usage notes
- As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is Null:
%invalidBer = new %invalidBer = %(InvalidBerData):new %invalidBer = %invalidBer:new
Position property
Position where error encountered (InvalidBerData class)
[Introduced in Sirius Mods 8.0]
This ReadOnly property returns the position in the (expected) base64-encoded string where a non-BER-conforming character was found.
Syntax
%number = invalidBerData:Position
Syntax terms
%number | This numeric value is the position in the base64 string (in the line identified by the value of Line) where a non-BER-conforming character was found. |
---|---|
invalidBerData | A reference to an instance of an InvalidBerData object. |