com.taursys.model
Class ModelParseException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.taursys.util.ChainedException
              extended bycom.taursys.model.ModelException
                  extended bycom.taursys.model.ModelParseException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MultiModelParseException

public class ModelParseException
extends ModelException

ModelExceptions encountered while parsing text value. This exception stores information about the reason and various other meaningful data whenever an Exception occurs during a Parse operation.

See Also:
Serialized Form

Field Summary
protected static java.lang.String[] messages
           
static int REASON_OFFSET
           
static int REASON_PARSE_ERROR
           
 
Fields inherited from class com.taursys.model.ModelException
REASON_INTERNAL_ERROR, REASON_MODEL_IS_WRONG_CLASS, REASON_MULTI_PROPERTY_MISMATCH, REASON_OBJECTS_ARE_IMMUTABLE, REASON_PARSE_CONVERSION_ERROR
 
Fields inherited from class com.taursys.util.ChainedException
cause, diagnosticInfo, reason, REASON_INVALID_REASON_CODE, REASON_UNSPECIFIED, userFriendlyMessage
 
Constructor Summary
protected ModelParseException()
          Creates a ModelParseException with a REASON_PARSE_ERROR.
  ModelParseException(java.lang.String propertyName, int javaDataType, java.text.Format format, java.lang.String pattern, java.lang.String givenValue, java.lang.Throwable cause)
          Constructs exception for given propertyName, data type, etc.
 
Method Summary
 java.lang.String getFormatClass()
          Gets the Format object which was trying to parse given value
 java.lang.String getFormatPattern()
          Gets the Pattern used by the Format object to parse the given value
 java.lang.String getGivenValue()
          Gets the given value which was being parsed
 java.lang.String getPropertyDataType()
          Gets the data type of the property where the parsed value would be stored
 java.lang.String getPropertyName()
          Gets property name where the parsed value would be stored
static java.lang.String getReasonMessage(int reason)
          Returns String for given reason code else String for REASON_INVALID_REASON_CODE.
protected  void setDiagnosticsInfo()
          Builds the diagnosticsInfo String from the current property values.
 
Methods inherited from class com.taursys.util.ChainedException
getCause, getDiagnosticInfo, getInvalidMessage, getLocalizedMessage, getReason, getUserFriendlyMessage, main, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REASON_OFFSET

public static final int REASON_OFFSET
See Also:
Constant Field Values

REASON_PARSE_ERROR

public static final int REASON_PARSE_ERROR
See Also:
Constant Field Values

messages

protected static final java.lang.String[] messages
Constructor Detail

ModelParseException

public ModelParseException(java.lang.String propertyName,
                           int javaDataType,
                           java.text.Format format,
                           java.lang.String pattern,
                           java.lang.String givenValue,
                           java.lang.Throwable cause)
Constructs exception for given propertyName, data type, etc.


ModelParseException

protected ModelParseException()
Creates a ModelParseException with a REASON_PARSE_ERROR.

Method Detail

getReasonMessage

public static java.lang.String getReasonMessage(int reason)
Returns String for given reason code else String for REASON_INVALID_REASON_CODE.


setDiagnosticsInfo

protected void setDiagnosticsInfo()
Builds the diagnosticsInfo String from the current property values.


getPropertyDataType

public java.lang.String getPropertyDataType()
Gets the data type of the property where the parsed value would be stored


getPropertyName

public java.lang.String getPropertyName()
Gets property name where the parsed value would be stored


getGivenValue

public java.lang.String getGivenValue()
Gets the given value which was being parsed


getFormatClass

public java.lang.String getFormatClass()
Gets the Format object which was trying to parse given value


getFormatPattern

public java.lang.String getFormatPattern()
Gets the Pattern used by the Format object to parse the given value



Copyright © 2007 Martin T Phelan. All Rights Reserved.