net.ponder2.objects
Class P2Error

java.lang.Object
  extended by net.ponder2.objects.P2Object
      extended by net.ponder2.objects.P2Error
All Implemented Interfaces:
java.io.Serializable, P2Serializable, ManagedObject, Ponder2Message

public class P2Error
extends P2Object
implements ManagedObject

Object containing error details created when an error is thrown in the code. Attributes include an error message and the PonderTalk source file name, line number and character number.

This is the argument received by the block onError: message.

Version:
$Id:$
Author:
Kevin Twidle
See Also:
Serialized Form

Constructor Summary
protected P2Error(Ponder2Exception exception)
          constructor for Ponder2 serialisation
 
Method Summary
protected  java.lang.String character()
          returns the source character number
protected  java.lang.String line()
          returns the source line number
protected  java.lang.String message()
          returns the error message
 P2Object readXml(com.twicom.qdparser.TaggedElement xml, java.util.Map<java.lang.Integer,P2Serializable> read)
           
protected  java.lang.String source()
          Returns the source file name
 java.lang.String toString()
           
 com.twicom.qdparser.TaggedElement writeXml(java.util.Set<P2Object> written)
           
 
Methods inherited from class net.ponder2.objects.P2Object
asArray, asBlock, asBoolean, asClass, asDouble, asFloat, asHash, asInteger, asLong, asNumber, asP2Array, asString, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, fromXml, getManagedObject, getOID, getSMC, operation, operation, setSMC
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

P2Error

protected P2Error(Ponder2Exception exception)
constructor for Ponder2 serialisation

Method Detail

source

protected java.lang.String source()
Returns the source file name

Returns:
the source file name

line

protected java.lang.String line()
returns the source line number

Returns:
the source line number

character

protected java.lang.String character()
returns the source character number

Returns:
the source character number

message

protected java.lang.String message()
returns the error message

Returns:
the error message

writeXml

public com.twicom.qdparser.TaggedElement writeXml(java.util.Set<P2Object> written)
                                           throws Ponder2OperationException
Specified by:
writeXml in interface P2Serializable
Overrides:
writeXml in class P2Object
Throws:
Ponder2OperationException

readXml

public P2Object readXml(com.twicom.qdparser.TaggedElement xml,
                        java.util.Map<java.lang.Integer,P2Serializable> read)
                 throws Ponder2OperationException
Specified by:
readXml in interface P2Serializable
Specified by:
readXml in class P2Object
Throws:
Ponder2OperationException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008 Imperial College. All Rights Reserved.