Libraries.Data.Formats.JavaScriptObjectNotationError Documentation

This class is used to hold the error information while parsing JavaScriptObjectNotation (JSON) formatted data.

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotation
use Libraries.Data.Formats.JavaScriptObjectNotationListener
use Libraries.Data.Formats.JavaScriptObjectNotationToken
use Libraries.Data.Formats.JavaScriptObjectNotationError

private action ThrowError(JavaScriptObjectNotationToken start, 
    JavaScriptObjectNotationToken finish,
    JavaScriptObjectNotationListener listen,
    text message)
    if listener not= undefined
        JavaScriptObjectNotationError error
        error:SetLineNumber(start:startLine)
        error:SetColumnNumber(start:startColumn)
        error:SetIndex(start:startIndex)

        if finish not= undefined
            error:SetLineNumberEnd(finish:endLine)
            error:SetColumnNumberEnd(finish:endColumn)
            error:SetIndexEnd(finish:endIndex)
        else 
            error:SetLineNumberEnd(start:endLine)
            error:SetColumnNumberEnd(start:endColumn)
            error:SetIndexEnd(start:endIndex)
        end
        error:SetErrorMessage(message)
        listener:VisitError(error)
    end
end

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetColumnNumber()This method is used to get the ColumnNumber field from a JavaScriptObjectNotationError object
GetColumnNumberEnd()This method is used to get the ColumnNumberEnd field from a JavaScriptObjectNotationError object
GetErrorMessage()This method is used to get the error message from a JavaScriptObjectNotationError object
GetHashCode()This action gets the hash code for an object.
GetIndex()This method is used to get the Index field from a JavaScriptObjectNotationError object
GetIndexEnd()This method is used to get the IndexEnd field from a JavaScriptObjectNotationError object
GetLineNumber()This method is used to get the LineNumber field from a JavaScriptObjectNotationError object
GetLineNumberEnd()This method is used to get the LineNumber field from a JavaScriptObjectNotationError object
SetColumnNumber(integer column)This method is used to set the ColumnNumber field from a JavaScriptObjectNotationError object
SetColumnNumberEnd(integer column)This method is used to set the ColumnNumberEnd field from a JavaScriptObjectNotationError object
SetErrorMessage(text value)This method is used to set the error message from a JavaScriptObjectNotationError object
SetIndex(integer index)This method is used to set the Index field from a JavaScriptObjectNotationError object
SetIndexEnd(integer index)This method is used to set the IndexEnd field from a JavaScriptObjectNotationError object
SetLineNumber(integer line)This method is used to set the LineNumber field from a JavaScriptObjectNotationError object
SetLineNumberEnd(integer line)This method is used to set the LineNumberEnd field from a JavaScriptObjectNotationError object

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetColumnNumber()

This method is used to get the ColumnNumber field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action PrintColumnNumber(JavaScriptObjectNotationError error)
        output error:GetColumnNumber()
    end

Return

integer: The column number.

GetColumnNumberEnd()

This method is used to get the ColumnNumberEnd field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action PrintColumnNumberEnd(JavaScriptObjectNotationError error)
        output error:GetColumnNumberEnd()
    end

Return

integer: The columnnumber end field.

GetErrorMessage()

This method is used to get the error message from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action PrintError(JavaScriptObjectNotationError error)
        output error:GetErrorMessage()
    end

Return

text: The error message.

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetIndex()

This method is used to get the Index field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action PrintIndex(JavaScriptObjectNotationError error)
        output error:GetIndex()
    end

Return

integer: The index value.

GetIndexEnd()

This method is used to get the IndexEnd field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action PrintIndexEnd(JavaScriptObjectNotationError error)
        output error:GetIndexEnd()
    end

Return

integer: The index end value.

GetLineNumber()

This method is used to get the LineNumber field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action PrintLineNumber(JavaScriptObjectNotationError error)
        output error:GetLineNumber()
    end

Return

integer: The line number.

GetLineNumberEnd()

This method is used to get the LineNumber field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action PrintLineNumber(JavaScriptObjectNotationError error)
        output error:GetLineNumber()
    end

Return

integer: The line number end value.

SetColumnNumber(integer column)

This method is used to set the ColumnNumber field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action SetColumnNumber(JavaScriptObjectNotationError error, text value)
        output error:SetColumnNumber(value)
    end

Parameters

SetColumnNumberEnd(integer column)

This method is used to set the ColumnNumberEnd field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action SetColumnNumberEnd(JavaScriptObjectNotationError error, text value)
        output error:SetColumnNumberEnd(value)
    end

Parameters

SetErrorMessage(text value)

This method is used to set the error message from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action SetError(JavaScriptObjectNotationError error, text value)
        output error:SetErrorMessage(value)
    end

Parameters

SetIndex(integer index)

This method is used to set the Index field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action SetIndex(JavaScriptObjectNotationError error, text value)
        output error:SetIndex(value)
    end

Parameters

SetIndexEnd(integer index)

This method is used to set the IndexEnd field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action SetIndexEnd(JavaScriptObjectNotationError error, text value)
        output error:SetIndexEnd(value)
    end

Parameters

SetLineNumber(integer line)

This method is used to set the LineNumber field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action SetLineNumber(JavaScriptObjectNotationError error, text value)
        output error:SetLineNumber(value)
    end

Parameters

SetLineNumberEnd(integer line)

This method is used to set the LineNumberEnd field from a JavaScriptObjectNotationError object

Example Code

use Libraries.Data.Formats.JavaScriptObjectNotationError

    action SetLineNumberEnd(JavaScriptObjectNotationError error, text value)
        output error:SetLineNumberEnd(value)
    end

Parameters