|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.soap Class SOAPFactory
java.lang.Object javax.xml.soap.SOAPFactory
public abstract class SOAPFactory
- extends Object
SOAPFactory
是用来创建存在于 SOAP XML 树中的各种对象的工厂。SOAPFactory
可以用于创建最终成为 SOAP 部分的 XML 片段。这些片段可以作为 SOAPHeaderElement
、SOAPBodyElement
、SOAPEnvelope
或其他 SOAPElement
对象的子级插入。SOAPFactory
还具有创建 javax.xml.soap.Detail
对象以及 java.xml.soap.Name
对象的方法。
SOAPFactory
is a factory for creating various objects
that exist in the SOAP XML tree.
SOAPFactory
can be
used to create XML fragments that will eventually end up in the
SOAP part. These fragments can be inserted as children of the
SOAPHeaderElement
or SOAPBodyElement
or
SOAPEnvelope
or other SOAPElement
objects.
SOAPFactory
also has methods to create
javax.xml.soap.Detail
objects as well as
java.xml.soap.Name
objects.
Constructor Summary | |
---|---|
SOAPFactory()
|
Method Summary | |
---|---|
abstract Detail |
createDetail()
Creates a new Detail object which serves as a container
for DetailEntry objects. |
SOAPElement |
createElement(Element domElement)
Creates a SOAPElement object from an existing DOM
Element . |
abstract SOAPElement |
createElement(Name name)
Creates a SOAPElement object initialized with the
given Name object. |
SOAPElement |
createElement(QName qname)
Creates a SOAPElement object initialized with the
given QName object. |
abstract SOAPElement |
createElement(String localName)
Creates a SOAPElement object initialized with the
given local name. |
abstract SOAPElement |
createElement(String localName,
String prefix,
String uri)
Creates a new SOAPElement object with the given
local name, prefix and uri. |
abstract SOAPFault |
createFault()
Creates a new default SOAPFault object |
abstract SOAPFault |
createFault(String reasonText,
QName faultCode)
Creates a new SOAPFault object initialized with the given reasonText
and faultCode |
abstract Name |
createName(String localName)
Creates a new Name object initialized with the
given local name. |
abstract Name |
createName(String localName,
String prefix,
String uri)
Creates a new Name object initialized with the
given local name, namespace prefix, and namespace URI. |
static SOAPFactory |
newInstance()
Creates a new SOAPFactory object that is an instance of
the default implementation (SOAP 1.1),
This method uses the following ordered lookup procedure to determine the SOAPFactory implementation class to load:
Use the javax.xml.soap.SOAPFactory system property. |
static SOAPFactory |
newInstance(String protocol)
Creates a new SOAPFactory object that is an instance of
the specified implementation, this method uses the SAAJMetaFactory to
locate the implementation class and create the SOAPFactory instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
SOAPFactory()
英文文档:
SOAPFactory
public SOAPFactory()
Method Detail |
---|
public SOAPElement
createElement(org.w3c.dom.Element domElement) throws SOAPException
根据现有的 DOM Element
创建 SOAPElement
对象。如果作为参数传入的 DOM Element
已经是一个 SOAPElement
,那么此方法必须不作任何修改地返回该参数。否则,会创建新的 SOAPElement
并进行此 domElement
参数的深层复制。返回值的具体类型将取决于 domElement
参数的名称。如果以 domElement
为根的树的任何部分违背了 SOAP 规则,则会抛出 SOAPException
。
domElement |
要复制的 Element 。 |
return |
一个新的 SOAPElement ,它是 domElement 的副本。
|
Throws | SOAPException:
如果在创建 SOAPElement 对象时存在错误 |
since | SAAJ 1.3 |
createElement
public SOAPElement createElement(Element domElement) throws SOAPException
- Creates a
SOAPElement
object from an existing DOMElement
. If the DOMElement
that is passed in as an argument is already aSOAPElement
then this method must return it unmodified without any further work. Otherwise, a newSOAPElement
is created and a deep copy is made of thedomElement
argument. The concrete type of the return value will depend on the name of thedomElement
argument. If any part of the tree rooted indomElement
violates SOAP rules, aSOAPException
will be thrown. - Parameters:
domElement
- - theElement
to be copied.- Returns:
- a new
SOAPElement
that is a copy ofdomElement
. - Throws:
SOAPException
- if there is an error in creating theSOAPElement
object- Since:
- SAAJ 1.3
abstract public SOAPElement
createElement(Name name) throws SOAPException
创建使用给定 Name
对象初始化的 SOAPElement
对象。返回值的具体类型将取决于提供给新 SOAPElement
的名称。例如,一个带有名称 "{http://www.w3.org/2003/05/soap-envelope}Envelope" 的新 SOAPElement
会导致创建支持 SOAP 1.2 行为的 SOAPEnvelope
。
name |
带有新元素 XML 名称的 Name 对象 |
return |
创建的新 SOAPElement 对象
|
Throws | SOAPException:
如果在创建 SOAPElement 对象时存在错误 |
See also | createElement(javax.xml.namespace.QName) |
createElement
public abstract SOAPElement createElement(Name name) throws SOAPException
- Creates a
SOAPElement
object initialized with the givenName
object. The concrete type of the return value will depend on the name given to the newSOAPElement
. For instance, a newSOAPElement
with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause aSOAPEnvelope
that supports SOAP 1.2 behavior to be created. - Parameters:
name
- aName
object with the XML name for the new element- Returns:
- the new
SOAPElement
object that was created - Throws:
SOAPException
- if there is an error in creating theSOAPElement
object- See Also:
createElement(javax.xml.namespace.QName)
public SOAPElement
createElement(javax.xml.namespace.QName qname) throws SOAPException
创建使用给定 QName
对象初始化的 SOAPElement
对象。返回值的具体类型将取决于提供给新 SOAPElement
的名称。例如,一个带有名称 "{http://www.w3.org/2003/05/soap-envelope}Envelope" 的新 SOAPElement
会导致创建支持 SOAP 1.2 行为的 SOAPEnvelope
。
qname |
带有新元素 XML 名称的 QName 对象 |
return |
创建的新 SOAPElement 对象
|
Throws | SOAPException:
如果在创建 SOAPElement 对象时存在错误 |
since | SAAJ 1.3 |
See also | createElement(Name) |
createElement
public SOAPElement createElement(QName qname) throws SOAPException
- Creates a
SOAPElement
object initialized with the givenQName
object. The concrete type of the return value will depend on the name given to the newSOAPElement
. For instance, a newSOAPElement
with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause aSOAPEnvelope
that supports SOAP 1.2 behavior to be created. - Parameters:
qname
- aQName
object with the XML name for the new element- Returns:
- the new
SOAPElement
object that was created - Throws:
SOAPException
- if there is an error in creating theSOAPElement
object- Since:
- SAAJ 1.3
- See Also:
createElement(Name)
abstract public SOAPElement
createElement(String localName) throws SOAPException
创建使用给定本地名称初始化的 SOAPElement
对象。
localName |
给出新元素本地名称的 String |
return |
创建的新 SOAPElement 对象
|
Throws | SOAPException:
如果在创建 SOAPElement 对象时存在错误 |
createElement
public abstract SOAPElement createElement(String localName) throws SOAPException
- Creates a
SOAPElement
object initialized with the given local name. - Parameters:
localName
- aString
giving the local name for the new element- Returns:
- the new
SOAPElement
object that was created - Throws:
SOAPException
- if there is an error in creating theSOAPElement
object
abstract public SOAPElement
createElement(String localName, String prefix, String uri) throws SOAPException
使用本地名称、前缀和 URI 创建新的 SOAPElement
对象。返回值的具体类型将取决于提供给新 SOAPElement
的名称。例如,一个带有名称 "{http://www.w3.org/2003/05/soap-envelope}Envelope" 的新 SOAPElement
会导致创建支持 SOAP 1.2 行为的 SOAPEnvelope
。
localName |
给出新元素本地名称的 String |
prefix |
此 SOAPElement 的前缀 |
uri |
给出新元素所属命名空间 URI 的 String |
Throws | SOAPException:
如果在创建 SOAPElement 对象时存在错误 |
createElement
public abstract SOAPElement createElement(String localName, String prefix, String uri) throws SOAPException
- Creates a new
SOAPElement
object with the given local name, prefix and uri. The concrete type of the return value will depend on the name given to the newSOAPElement
. For instance, a newSOAPElement
with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause aSOAPEnvelope
that supports SOAP 1.2 behavior to be created. - Parameters:
localName
- aString
giving the local name for the new elementprefix
- the prefix for thisSOAPElement
uri
- aString
giving the URI of the namespace to which the new element belongs- Throws:
SOAPException
- if there is an error in creating theSOAPElement
object
abstract public Detail
createDetail() throws SOAPException
创建充当 DetailEntry
对象容器的新 Detail
对象。
此工厂方法创建 Detail
对象,用于不可能使用 SOAPFault
抽象的情况。
return |
一个 Detail 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
Throws | UnsupportedOperationException:
如果为 SOAPFactory 指定的协议是 DYNAMIC_SOAP_PROTOCOL |
createDetail
public abstract Detail createDetail() throws SOAPException
- Creates a new
Detail
object which serves as a container forDetailEntry
objects.This factory method creates
Detail
objects for use in situations where it is not practical to use theSOAPFault
abstraction. - Returns:
- a
Detail
object - Throws:
SOAPException
- if there is a SOAP errorUnsupportedOperationException
- if the protocol specified for the SOAPFactory wasDYNAMIC_SOAP_PROTOCOL
abstract public SOAPFault
createFault(String reasonText, javax.xml.namespace.QName faultCode) throws SOAPException
创建使用给定 reasonText
和 faultCode
初始化的新 SOAPFault
对象
reasonText | 错误的 ReasonText/FaultString |
faultCode | 错误的 FaultCode |
return |
一个 SOAPFault 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
since | SAAJ 1.3 |
createFault
public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException
- Creates a new
SOAPFault
object initialized with the givenreasonText
andfaultCode
- Parameters:
reasonText
- the ReasonText/FaultString for the faultfaultCode
- the FaultCode for the fault- Returns:
- a
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error- Since:
- SAAJ 1.3
abstract public SOAPFault
createFault() throws SOAPException
创建一个新的默认 SOAPFault
对象
return |
一个 SOAPFault 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
since | SAAJ 1.3 |
createFault
public abstract SOAPFault createFault() throws SOAPException
- Creates a new default
SOAPFault
object - Returns:
- a
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error- Since:
- SAAJ 1.3
abstract public Name
createName(String localName, String prefix, String uri) throws SOAPException
创建使用给定本地名称、名称空间前缀和名称空间 URI 初始化的新 Name
对象。
此工厂方法创建 Name
对象,用于不可能使用 SOAPEnvelope
抽象的情况。
localName |
给出本地名称的 String |
prefix |
给出名称空间前缀的 String |
uri |
给出名称空间 URI 的 String |
return |
使用给定本地名称、名称空间前缀和名称空间 URI 初始化的 Name 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
createName
public abstract Name createName(String localName, String prefix, String uri) throws SOAPException
- Creates a new
Name
object initialized with the given local name, namespace prefix, and namespace URI.This factory method creates
Name
objects for use in situations where it is not practical to use theSOAPEnvelope
abstraction. - Parameters:
localName
- aString
giving the local nameprefix
- aString
giving the prefix of the namespaceuri
- aString
giving the URI of the namespace- Returns:
- a
Name
object initialized with the given local name, namespace prefix, and namespace URI - Throws:
SOAPException
- if there is a SOAP error
abstract public Name
createName(String localName) throws SOAPException
创建使用给定本地名称初始化的新 Name
对象。
此工厂方法创建 Name
对象,用于不可能使用 SOAPEnvelope
抽象的情况。
localName |
给出本地名称的 String |
return |
使用给定本地名称初始化的 Name 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
createName
public abstract Name createName(String localName) throws SOAPException
- Creates a new
Name
object initialized with the given local name.This factory method creates
Name
objects for use in situations where it is not practical to use theSOAPEnvelope
abstraction. - Parameters:
localName
- aString
giving the local name- Returns:
- a
Name
object initialized with the given local name - Throws:
SOAPException
- if there is a SOAP error
public static SOAPFactory
newInstance() throws SOAPException
创建新的 SOAPFactory
对象,该对象是默认实现 (SOAP 1.1) 的实例。
此方法使用以下查找过程顺序来确定要加载的 SOAPFactory 实现类:
- 使用 javax.xml.soap.SOAPFactory 系统属性。
- 使用 JRE 文件夹中的属性文件 "lib/jaxm.properties"。此配置文件格式是标准的 java.util.Properties 格式且包含实现类的完全限定名,其中实现类的键是上文定义的系统属性。
- 如果 Services API(在 JAR 规范中进行了详细描述)可用,可以使用它来确定类名称。Services API 将查找在运行时可用的 jar 中 META-INF/services/javax.xml.soap.SOAPFactory 文件中的类名称。
- 使用 SAAJMetaFactory 实例来定位 SOAPFactory 实现类。
return |
新的 SOAPFactory 实例
|
Throws | SOAPException:
如果在创建默认 SOAPFactory 时出现错误 |
See also | javax.xml.soap.SAAJMetaFactory |
newInstance
public static SOAPFactory newInstance() throws SOAPException
- Creates a new
SOAPFactory
object that is an instance of the default implementation (SOAP 1.1), This method uses the following ordered lookup procedure to determine the SOAPFactory implementation class to load:- Use the javax.xml.soap.SOAPFactory system property.
- Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
- Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.soap.SOAPFactory in jars available to the runtime.
- Use the SAAJMetaFactory instance to locate the SOAPFactory implementation class.
- Returns:
- a new instance of a
SOAPFactory
- Throws:
SOAPException
- if there was an error creating the defaultSOAPFactory
- See Also:
SAAJMetaFactory
public static SOAPFactory
newInstance(String protocol) throws SOAPException
创建新的 SOAPFactory
对象,该对象是指定实现的实例,此方法使用 SAAJMetaFactory 来定位实现类并创建 SOAPFactory 实例。
return |
新的 SOAPFactory 实例
|
protocol |
字符串常量,表示指定 SOAP 工厂实现的协议。可以是 DYNAMIC_SOAP_PROTOCOL 、DEFAULT_SOAP_PROTOCOL (等同于 SOAP_1_1_PROTOCOL )或 SOAP_1_2_PROTOCOL 。 |
Throws | SOAPException:
如果在创建指定 SOAPFactory 时出现错误 |
since | SAAJ 1.3 |
See also | javax.xml.soap.SAAJMetaFactory |
newInstance
public static SOAPFactory newInstance(String protocol) throws SOAPException
- Creates a new
SOAPFactory
object that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance. - Parameters:
protocol
- a string constant representing the protocol of the specified SOAP factory implementation. May be eitherDYNAMIC_SOAP_PROTOCOL
,DEFAULT_SOAP_PROTOCOL
(which is the same as)SOAP_1_1_PROTOCOL
, orSOAP_1_2_PROTOCOL
.- Returns:
- a new instance of a
SOAPFactory
- Throws:
SOAPException
- if there was an error creating the specifiedSOAPFactory
- Since:
- SAAJ 1.3
- See Also:
SAAJMetaFactory
|
|||||||||
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 : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!