|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.soap Class SOAPException
java.lang.Object java.lang.Throwable java.lang.Exception javax.xml.soap.SOAPException
- All Implemented Interfaces:
- Serializable
public class SOAPException
- extends Exception
当发生 SOAP 异常时,抛出此异常。
SOAPException
对象可以包含给出异常原因的 String
或嵌入的 Throwable
对象,也可以同时包含两者。此类提供检索原因消息的方法和检索嵌入 Throwable
对象的方法。
抛出 SOAPException
对象的通常原因是难以设置头、无法发送消息以及无法获取与提供者的连接之类的问题。嵌入 Throwable
对象的原因包括诸如输入/输出错误之类的问题或解析问题,如解析头时出现错误。
An exception that signals that a SOAP exception has occurred. A
SOAPException
object may contain a String
that gives the reason for the exception, an embedded
Throwable
object, or both. This class provides methods
for retrieving reason messages and for retrieving the embedded
Throwable
object.
Typical reasons for throwing a SOAPException
object are problems such as difficulty setting a header, not being
able to send a message, and not being able to get a connection with
the provider. Reasons for embedding a Throwable
object include problems such as input/output errors or a parsing
problem, such as an error in parsing a header.
- See Also:
- Serialized Form
Constructor Summary | |
---|---|
SOAPException()
Constructs a SOAPException object with no
reason or embedded Throwable object. |
|
SOAPException(String reason)
Constructs a SOAPException object with the given
String as the reason for the exception being thrown. |
|
SOAPException(String reason,
Throwable cause)
Constructs a SOAPException object with the given
String as the reason for the exception being thrown
and the given Throwable object as an embedded
exception. |
|
SOAPException(Throwable cause)
Constructs a SOAPException object initialized
with the given Throwable object. |
Method Summary | |
---|---|
Throwable |
getCause()
Returns the Throwable object embedded in this
SOAPException if there is one. |
String |
getMessage()
Returns the detail message for this SOAPException
object. |
Throwable |
initCause(Throwable cause)
Initializes the cause field of this SOAPException
object with the given Throwable object. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public
SOAPException()
构造不带原因或内置 Throwable
对象的 SOAPException
对象。
英文文档:
SOAPException
public SOAPException()
- Constructs a
SOAPException
object with no reason or embeddedThrowable
object.
public
SOAPException(String reason)
构造一个 SOAPException
对象,使用给定 String
作为抛出异常的原因。
reason | 对导致异常的原因的描述 |
SOAPException
public SOAPException(String reason)
- Constructs a
SOAPException
object with the givenString
as the reason for the exception being thrown.- Parameters:
reason
- a description of what caused the exception
public
SOAPException(String reason, Throwable cause)
构造一个 SOAPException
对象,使用给定 String
作为抛出异常的原因,使用给定 Throwable
对象作为嵌入的异常。
reason | 对导致异常的原因的描述 |
cause |
要嵌入此 SOAPException 对象的 Throwable 对象 |
SOAPException
public SOAPException(String reason, Throwable cause)
- Constructs a
SOAPException
object with the givenString
as the reason for the exception being thrown and the givenThrowable
object as an embedded exception.- Parameters:
reason
- a description of what caused the exceptioncause
- aThrowable
object that is to be embedded in thisSOAPException
object
public
SOAPException(Throwable cause)
构造使用给定 Throwable
对象初始化的 SOAPException
对象。
英文文档:
SOAPException
public SOAPException(Throwable cause)
- Constructs a
SOAPException
object initialized with the givenThrowable
object.
Method Detail |
---|
public String
getMessage()
返回此 SOAPException
对象的详细消息。
如果有嵌入的 Throwable
对象,并且 SOAPException
对象没有自己的详细消息,则此方法将返回嵌入的 Throwable
对象的详细消息。
return |
此 SOAPException 的错误或警告消息,如果没有此类消息,则返回嵌入的 Throwable 对象(如果有)的消息 |
getMessage
public String getMessage()
- Returns the detail message for this
SOAPException
object.If there is an embedded
Throwable
object, and if theSOAPException
object has no detail message of its own, this method will return the detail message from the embeddedThrowable
object. - Overrides:
getMessage
in classThrowable
- Returns:
- the error or warning message for this
SOAPException
or, if it has none, the message of the embeddedThrowable
object, if there is one
public Throwable
getCause()
返回此 SOAPException
中嵌入的 Throwable
对象(如果有)。否则,此方法返回 null
。
return |
嵌入的 Throwable 对象,如果没有此类对象,则返回 null |
getCause
public Throwable getCause()
- Returns the
Throwable
object embedded in thisSOAPException
if there is one. Otherwise, this method returnsnull
. - Returns:
- the embedded
Throwable
object ornull
if there is none
public Throwable
initCause(Throwable cause)
使用给定的 Throwable
对象初始化此 SOAPException
对象的 cause
字段。
此方法至多可以调用一次。此方法通常从构造方法中调用,或者在构造方法返回新的 SOAPException
对象后立即调用。如果此 SOAPException
对象是使用构造方法 #SOAPException(Throwable)
或 #SOAPException(String,Throwable)
创建的,则意味着它的 cause
字段已经有一个值,此方法一次也不能调用。
cause |
导致抛出此 SOAPException 对象的 Throwable 对象。保存此参数的值,以便以后通过 #getCause() 方法检索它。此参数值可以为 null,指示 cause 不存在或是未知的。 |
return |
对此 SOAPException 实例的引用 |
Throws | IllegalArgumentException:
如果 cause 是此 Throwable 对象。(Throwable 对象不能是它自己的 cause。) |
Throws | IllegalStateException:
如果此 SOAPException 对象的 cause 已经初始化 |
initCause
public Throwable initCause(Throwable cause)
- Initializes the
cause
field of thisSOAPException
object with the givenThrowable
object.This method can be called at most once. It is generally called from within the constructor or immediately after the constructor has returned a new
SOAPException
object. If thisSOAPException
object was created with the constructorSOAPException(Throwable)
orSOAPException(String,Throwable)
, meaning that itscause
field already has a value, this method cannot be called even once. - Parameters:
cause
- theThrowable
object that caused thisSOAPException
object to be thrown. The value of this parameter is saved for later retrieval by thegetCause()
method. A null value is permitted and indicates that the cause is nonexistent or unknown.- Returns:
- a reference to this
SOAPException
instance - Throws:
IllegalArgumentException
- ifcause
is thisThrowable
object. (AThrowable
object cannot be its own cause.)IllegalStateException
- if the cause for thisSOAPException
object has already been initialized
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!