WebNMS TL1 API Release 4 Specification

com.adventnet.tl1.parser
Class TL1ParserException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.adventnet.tl1.TL1Exception
                    |
                    +--com.adventnet.tl1.parser.TL1ParserException
All Implemented Interfaces:
java.io.Serializable

public class TL1ParserException
extends TL1Exception

This TL1ParserException is thrown by the factory methods and the getter (extractor of a specific message part) methods of all the TL1 message parsers.

Since:
TL1 API 3
See Also:
Serialized Form

Constructor Summary
TL1ParserException()
          Constructs a TL1ParserException without a detailed error message.
TL1ParserException(java.lang.String message)
          Constructs a TL1ParserException with the detailed error message specified.
TL1ParserException(java.lang.String reason, java.lang.String parser, java.lang.String mode)
          Constructs a special TL1ParserException object with a failure message and a header.
 
Method Summary
 java.lang.String getMessage()
          Returns the error message string of this TL1ParserException object.
 java.lang.String getMode()
          Gets the mode of the parser in which it was operating when the exception occurred.
 java.lang.String getParser()
          Gets the name of the parser where the exception occurred.
 java.lang.String getReason()
          Gets the reason for failure.
 java.lang.Object getTL1Message()
          Gets the partially created TL1 Message component object.
 void setTL1Message(java.lang.Object tl1message)
          Sets the TL1ParserException with the partially created TL1 Message component object.
 
Methods inherited from class com.adventnet.tl1.TL1Exception
getProblem, setProblem
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TL1ParserException

public TL1ParserException()
Constructs a TL1ParserException without a detailed error message.
Since:
TL1 API 3

TL1ParserException

public TL1ParserException(java.lang.String message)
Constructs a TL1ParserException with the detailed error message specified.
Parameters:
message - the detailed error message.
Since:
TL1 API 3

TL1ParserException

public TL1ParserException(java.lang.String reason,
                          java.lang.String parser,
                          java.lang.String mode)
Constructs a special TL1ParserException object with a failure message and a header. The header has the parser name and the parser mode embedded in it. This special constructor changes the semantics of getMessage().
Parameters:
reason - the error message outlining the reason for this exception.
parser - the name of the parser where this exception occurred.
mode - the parser mode of the parser, either FLEXIBLE or RIGID.
Since:
TL1 API 4
Method Detail

getMessage

public java.lang.String getMessage()
Returns the error message string of this TL1ParserException object.

This method has the standard behaviour when this object is created using the standard construtors. On the other hand, if the special constrcutor is used the error message string contains the parser name, mode in which the parser was operating and the reason for failure.

Overrides:
getMessage in class java.lang.Throwable
Returns:
the error message string of this TL1ParserException object if created with an error message string; or null if created without any error message.
Since:
TL1 API 4

getReason

public java.lang.String getReason()
Gets the reason for failure. It is applicable only for the special constructor.
Returns:
the error message string of this TL1ParserException object if created with a reason; or null if created without any reason.
Since:
TL1 API 4

getParser

public java.lang.String getParser()
Gets the name of the parser where the exception occurred. It is applicable only for the special constructor.
Returns:
the name of the parser if this TL1ParserException object if created with the name of the parser; or null if created without any name.
Since:
TL1 API 4

getMode

public java.lang.String getMode()
Gets the mode of the parser in which it was operating when the exception occurred. It is applicable only for the special constructor.
Returns:
the mode of the parser if this TL1ParserException object is created with the mode of parser; or null if created without any mode.
Since:
TL1 API 4

setTL1Message

public void setTL1Message(java.lang.Object tl1message)
Sets the TL1ParserException with the partially created TL1 Message component object.

This partially created TL1Message object will contain all the fields that has been set on it until the point at which an error is encountered by the parser. This enables applications perform root-cause analysis of the cause of this exception.

Parameters:
tl1message - the partially created TL1 Message component object.
Since:
TL1 API 3

getTL1Message

public java.lang.Object getTL1Message()
Gets the partially created TL1 Message component object.
Returns:
the partially created TL1Message component object.
Since:
TL1 API 3

WebNMS TL1 API Release 4 Specification