OBEROn SDK

com.oberon.ooql.sdk
Class OberonException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.oberon.ooql.sdk.OberonException
All Implemented Interfaces:
java.io.Serializable

public class OberonException
extends java.lang.Exception

Generic OBEROn Exception

Version:
5.0
See Also:
Serialized Form

Constructor Summary
OberonException(java.lang.String message)
          Raise new exception
OberonException(java.lang.String message, java.lang.String selectedText)
          Raise new exception
OberonException(java.lang.String errorKey, java.lang.String[] params)
          Raise new exception
 
Method Summary
 void addLevelMessage(java.lang.String levelmessage)
          When exception are nested, you can add text to extend the exception message
 void fromXML(org.jdom.Element rootElement)
          Load the OberonException object properties from XML element tree
static OberonException generateOberonException(java.lang.Exception ex)
          Convert a generic Exception to an OberonException
static OberonException generateOberonException(java.lang.Exception ex, java.lang.String levelMessage)
          Convert a generic Exception to an OberonException, appending a new level message
static java.lang.String generateOberonMessage(java.lang.Exception ex, Framework framework)
          Get the message from an Exception
 java.lang.String getErrorKey()
          Get the dictionary keyword for message translation
 java.lang.String getLocalizedMessage(Framework framework)
          Get the localized exception message Translate the message to the current user framework language
 java.lang.String getLocalizedMessage(javax.servlet.http.HttpSession session)
          Get the localized exception message Translate the message to the current session language
 java.lang.String getLocalizedMessage(java.lang.String errorSection, Framework framework)
          Get the localized exception message Translate the message to the current user framework language and search for translation inside the specified section
 java.lang.String getLocalizedMessage(java.lang.String errorSection, javax.servlet.http.HttpSession session)
          Get the localized exception message.
 java.lang.String getLocalizedMessage(java.lang.String language, java.lang.String errorSection, Framework framework)
          Get the localized exception message Translate the message to the given language and search for translation inside the specified section
 java.lang.String getLocalizedMessage(java.lang.String language, java.lang.String errorSection, javax.servlet.http.HttpSession session)
          Get the localized exception message.
 java.lang.String getMessage()
          Get the exception message
 java.lang.Object[] getParams()
          Get the parameters to be replaced in the message
 java.lang.String getSelectedText()
          Get the text (or part of a command) to highlight
 void setErrorKey(java.lang.String errorKey)
          Set the dictionary keyword for message translation
 void setMessage(java.lang.String message)
          Set the exception message
 void setParams(java.lang.String[] params)
          Set the parameters to be replaced in the message
 void setSelectedText(java.lang.String selectedText)
          Set the text (or part of a command) to highlight
 org.jdom.Element toXML()
          Return the OberonException object properties as XML element tree
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OberonException

public OberonException(java.lang.String message)
Raise new exception

Parameters:
message - the exception message

OberonException

public OberonException(java.lang.String message,
                       java.lang.String selectedText)
Raise new exception

Parameters:
message - the exception message
selectedText - set the text (or part of a command) to highlight

OberonException

public OberonException(java.lang.String errorKey,
                       java.lang.String[] params)
Raise new exception

Parameters:
errorKey - the dictionary keyword for message translation
params - parameters to be replaced in the message
Method Detail

setMessage

public void setMessage(java.lang.String message)
Set the exception message


setSelectedText

public void setSelectedText(java.lang.String selectedText)
Set the text (or part of a command) to highlight


setErrorKey

public void setErrorKey(java.lang.String errorKey)
Set the dictionary keyword for message translation


setParams

public void setParams(java.lang.String[] params)
Set the parameters to be replaced in the message


addLevelMessage

public void addLevelMessage(java.lang.String levelmessage)
When exception are nested, you can add text to extend the exception message


getMessage

public java.lang.String getMessage()
Get the exception message

Overrides:
getMessage in class java.lang.Throwable

getSelectedText

public java.lang.String getSelectedText()
Get the text (or part of a command) to highlight


getErrorKey

public java.lang.String getErrorKey()
Get the dictionary keyword for message translation


getParams

public java.lang.Object[] getParams()
Get the parameters to be replaced in the message


getLocalizedMessage

public java.lang.String getLocalizedMessage(javax.servlet.http.HttpSession session)
Get the localized exception message Translate the message to the current session language


getLocalizedMessage

public java.lang.String getLocalizedMessage(java.lang.String errorSection,
                                            javax.servlet.http.HttpSession session)
Get the localized exception message. Translate the message to the current session language and search for translation inside the specified section


getLocalizedMessage

public java.lang.String getLocalizedMessage(java.lang.String language,
                                            java.lang.String errorSection,
                                            javax.servlet.http.HttpSession session)
Get the localized exception message. Translate the message to the given language and search for translation inside the specified section


getLocalizedMessage

public java.lang.String getLocalizedMessage(Framework framework)
Get the localized exception message Translate the message to the current user framework language


getLocalizedMessage

public java.lang.String getLocalizedMessage(java.lang.String errorSection,
                                            Framework framework)
Get the localized exception message Translate the message to the current user framework language and search for translation inside the specified section


getLocalizedMessage

public java.lang.String getLocalizedMessage(java.lang.String language,
                                            java.lang.String errorSection,
                                            Framework framework)
Get the localized exception message Translate the message to the given language and search for translation inside the specified section


generateOberonMessage

public static java.lang.String generateOberonMessage(java.lang.Exception ex,
                                                     Framework framework)
Get the message from an Exception


generateOberonException

public static OberonException generateOberonException(java.lang.Exception ex)
Convert a generic Exception to an OberonException


generateOberonException

public static OberonException generateOberonException(java.lang.Exception ex,
                                                      java.lang.String levelMessage)
Convert a generic Exception to an OberonException, appending a new level message


toXML

public org.jdom.Element toXML()
Return the OberonException object properties as XML element tree


fromXML

public void fromXML(org.jdom.Element rootElement)
Load the OberonException object properties from XML element tree


OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.