|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tmatesoft.svn.core.SVNErrorMessage
public class SVNErrorMessage
The SVNErrorMessage class represents error and warning messages describing reasons of exceptions occurred during runtime. An error message may be of two levels:
SVNErrorCode
)
what gives an ability to find out what kind of an error it is.
Error messages may be formatted. SVNErrorMessage performs formatting with the
help of the JDK's MessageFormat
class. To make a formatted message, use
MessageFormat
parsable format patterns and provide an array of related objects
when creating an SVNErrorMessage.
Error messages may be supplied within exceptions of the main exception type -
SVNException
.
Field Summary | |
---|---|
static int |
TYPE_ERROR
Error messages of this type are considered to be errors (most critical) rather than warnings. |
static int |
TYPE_WARNING
Error messages of this type are considered to be warnings, what in certain situations may be OK. |
static SVNErrorMessage |
UNKNOWN_ERROR_MESSAGE
This is a type of an error message denoting an error of an unknown nature. |
Constructor Summary | |
---|---|
protected |
SVNErrorMessage(SVNErrorCode code,
java.lang.String message,
java.lang.Object[] relatedObjects,
java.lang.Throwable th,
int type)
|
Method Summary | |
---|---|
static SVNErrorMessage |
create(SVNErrorCode code)
Creates an error message given an error code. |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.String message)
Creates an error message given an error code and description. |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.String message,
int type)
Creates an error message given an error code, description and a type ( whether it's a warning or an error). |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.String message,
java.lang.Object... objects)
Creates an error message given an error code, description and may be related objects to be formatted with the error description. |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.String message,
java.lang.Object object)
Creates an error message given an error code, description and may be a related object to be formatted with the error description. |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.String message,
java.lang.Object[] objects,
int type)
Creates an error message given an error code, description, an error type (whether it's a warning or an error) and may be related objects to be formatted with the error description. |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.String message,
java.lang.Object[] objects,
int type,
java.lang.Throwable cause)
Creates an error message given an error code, description, an error type (whether it's a warning or an error) and may be related objects to be formatted with the error description and an optional cause. |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.String message,
java.lang.Object object,
int type)
Creates an error message given an error code, description, an error type (whether it's a warning or an error) and may be a related object to be formatted with the error description. |
static SVNErrorMessage |
create(SVNErrorCode code,
java.lang.Throwable cause)
Creates an error message given an error code and cause. |
SVNErrorMessage |
findChildWithErrorCode(SVNErrorCode errorCode)
|
java.lang.Throwable |
getCause()
Returns throwable that is cause of the error if any. |
SVNErrorMessage |
getChildErrorMessage()
Returns an error message (if any) that was returned from a deeper method call. |
SVNErrorCode |
getErrorCode()
Returns the error code of the error. |
java.lang.String |
getFullMessage()
Gets a string representation of the entire stack trace of error messages (if they were provided) starting with the initial cause of the error. |
java.lang.String |
getMessage()
Returns an error description formatted with the related objects if needed. |
java.lang.String |
getMessageTemplate()
Returns an error description which may contain message format patterns. |
java.lang.Object[] |
getRelatedObjects()
Returns objects (if any) that were provided to be formatted with the error description. |
SVNErrorMessage |
getRootErrorMessage()
Follows the children chain and returns the error message of the last child in this chain. |
int |
getType()
Returns the type of the error (whether it's a warning or an error). |
boolean |
hasChildErrorMessage()
Says if this error message object has got a child error message. |
boolean |
hasChildWithErrorCode(SVNErrorCode errorCode)
|
boolean |
isDontShowErrorCode()
|
boolean |
isErrorCodeShouldShown()
|
boolean |
isWarning()
Returns true if this message is a warning message, not error one. |
void |
setChildErrorMessage(SVNErrorMessage childMessage)
Sets a child error message for this one. |
void |
setDontShowErrorCode(boolean dontShowErrorCode)
|
boolean |
setType(int type)
Sets the type of this error message. |
java.lang.String |
toString()
Returns a string representation of this error message object formatting (if needed) the error description with the provided related objects. |
SVNErrorMessage |
wrap(java.lang.String parentMessage)
Wraps this error message into a new one that is returned as a parent error message. |
SVNErrorMessage |
wrap(java.lang.String parentMessage,
java.lang.Object relatedObject)
Wraps this error message into a new one that is returned as a parent error message. |
SVNErrorMessage |
wrap(java.lang.String parentMessage,
java.lang.Object[] relatedObjects)
Wraps this error message into a new one that is returned as a parent error message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_ERROR
public static final int TYPE_WARNING
public static SVNErrorMessage UNKNOWN_ERROR_MESSAGE
SVNErrorCode.UNKNOWN
error.
Constructor Detail |
---|
protected SVNErrorMessage(SVNErrorCode code, java.lang.String message, java.lang.Object[] relatedObjects, java.lang.Throwable th, int type)
Method Detail |
---|
public static SVNErrorMessage create(SVNErrorCode code)
code
- an error code
public static SVNErrorMessage create(SVNErrorCode code, java.lang.String message)
code
- an error codemessage
- an error description
public static SVNErrorMessage create(SVNErrorCode code, java.lang.Throwable cause)
code
- an error codecause
- cause of the error
public static SVNErrorMessage create(SVNErrorCode code, java.lang.String message, java.lang.Object object)
object
with the message
, you
should use valid format patterns parsable for MessageFormat
.
code
- an error codemessage
- an error descriptionobject
- an object related to the error message
public static SVNErrorMessage create(SVNErrorCode code, java.lang.String message, java.lang.Object... objects)
objects
with the message
, you
should use valid format patterns parsable for MessageFormat
.
code
- an error codemessage
- an error descriptionobjects
- an array of objects related to the error message
public static SVNErrorMessage create(SVNErrorCode code, java.lang.String message, int type)
code
- an error codemessage
- an error descriptiontype
- an error type
public static SVNErrorMessage create(SVNErrorCode code, java.lang.String message, java.lang.Object object, int type)
object
with the message
, you should use valid format patterns parsable for
MessageFormat
.
code
- an error codemessage
- an error descriptionobject
- an object related to the error message
type
- an error type
public static SVNErrorMessage create(SVNErrorCode code, java.lang.String message, java.lang.Object[] objects, int type)
objects
with the message
, you should use valid format patterns parsable for
MessageFormat
.
code
- an error codemessage
- an error descriptionobjects
- an array of objects related to the error message
type
- an error type
public static SVNErrorMessage create(SVNErrorCode code, java.lang.String message, java.lang.Object[] objects, int type, java.lang.Throwable cause)
objects
with the message
, you should use valid format patterns parsable for
MessageFormat
.
code
- an error codemessage
- an error descriptionobjects
- an array of objects related to the error message
type
- an error typecause
- cause of the error
public int getType()
public SVNErrorCode getErrorCode()
public java.lang.String getMessage()
toString()
public java.lang.String getFullMessage()
public java.lang.String getMessageTemplate()
public java.lang.Object[] getRelatedObjects()
MessageFormat
engine.
public SVNErrorMessage getChildErrorMessage()
public boolean hasChildErrorMessage()
public java.lang.Throwable getCause()
public java.lang.String toString()
SVNErrorCode
).
toString
in class java.lang.Object
public boolean isErrorCodeShouldShown()
public void setChildErrorMessage(SVNErrorMessage childMessage)
childMessage
- a child error messagepublic SVNErrorMessage wrap(java.lang.String parentMessage)
parentMessage
- a parent error description
public SVNErrorMessage wrap(java.lang.String parentMessage, java.lang.Object relatedObject)
parentMessage
- a parent error descriptionrelatedObject
- an object to be formatted with parentMessage
public SVNErrorMessage wrap(java.lang.String parentMessage, java.lang.Object[] relatedObjects)
parentMessage
with corresponding relatedObjects
to
format the error description, and this error message as its child.
parentMessage
- a parent error descriptionrelatedObjects
- objects to be formatted with parentMessage
public boolean isWarning()
TYPE_WARNING
} and false
otherwisepublic boolean setType(int type)
type
must be either TYPE_ERROR
or TYPE_WARNING
.
This method is intended for inner (within internals) purposes only and
must not be used by API users.
type
- error message type
public SVNErrorMessage getRootErrorMessage()
getChildErrorMessage()
.
public boolean isDontShowErrorCode()
public void setDontShowErrorCode(boolean dontShowErrorCode)
public SVNErrorMessage findChildWithErrorCode(SVNErrorCode errorCode)
public boolean hasChildWithErrorCode(SVNErrorCode errorCode)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |