Qizx fe-4.4p2 API

com.qizx.api
Class Message

java.lang.Object
  extended by com.qizx.api.Message

public class Message
extends Object

Message (error or warning) returned by compilation errors.


Field Summary
static int DETAIL
          Message type returned by getType() for an auxiliary information message.
static int ERROR
          Message type returned by getType() for an error.
static int WARNING
          Message type returned by getType() for a warning.
 
Constructor Summary
Message(int type, QName code, String text, String moduleURI, int position, int lineNumber, int columnNumber, String srcLine)
          For internal use.
 
Method Summary
 int getColumnNumber()
          Gets the related position in the line (or column number).
 QName getErrorCode()
          Gets the XQuery error code.
 int getLineNumber()
          Gets the related line number (first line is 1).
 String getModuleURI()
          Gets the URI of the concerned XQuery module.
 int getPosition()
          Gets the related character position in the whole source script.
 String getSourceLine()
          Gets the text of the related line in the source code.
 String getText()
          Gets the message text.
 int getType()
          Gets the message type (ERROR or WARNING or DETAIL).
 void print(PrintWriter output, boolean withSource)
          Prints a single message.
 String toString()
          Returns a displayable form of the message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
Message type returned by getType() for an error.

See Also:
Constant Field Values

WARNING

public static final int WARNING
Message type returned by getType() for a warning.

See Also:
Constant Field Values

DETAIL

public static final int DETAIL
Message type returned by getType() for an auxiliary information message.

See Also:
Constant Field Values
Constructor Detail

Message

public Message(int type,
               QName code,
               String text,
               String moduleURI,
               int position,
               int lineNumber,
               int columnNumber,
               String srcLine)
For internal use.

Parameters:
type -
code -
text -
moduleURI -
position -
lineNumber -
columnNumber -
srcLine -
Method Detail

getErrorCode

public QName getErrorCode()
Gets the XQuery error code.

Returns:
the code as a Qualified Name. The namespace of this name is "http://www.w3.org/2005/xqt-errors" (See XQuery Specifications 2.3.2)

getColumnNumber

public int getColumnNumber()
Gets the related position in the line (or column number). The first column is 0.

Returns:
the column number

getLineNumber

public int getLineNumber()
Gets the related line number (first line is 1).

Returns:
the line number

getModuleURI

public String getModuleURI()
Gets the URI of the concerned XQuery module.

Returns:
the module URI

getText

public String getText()
Gets the message text.

Returns:
the message text

getType

public int getType()
Gets the message type (ERROR or WARNING or DETAIL).

Returns:
the message type

getPosition

public int getPosition()
Gets the related character position in the whole source script.

Returns:
the character position, starting from 0

getSourceLine

public String getSourceLine()
Gets the text of the related line in the source code.

Returns:
the text of the related line without line terminator

print

public void print(PrintWriter output,
                  boolean withSource)
Prints a single message.

Parameters:
output - print output
withSource - if true, print the concerned source line with a mark under the point where the message is located

toString

public String toString()
Returns a displayable form of the message.

Overrides:
toString in class Object
Returns:
displayable string with location and message text

© 2010 Axyana Software