author | aefimov |
Thu, 23 Nov 2017 18:23:15 +0000 | |
changeset 47930 | f2de2c55c6c7 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
12009 | 1 |
/* |
45678
65fdff10664d
8176508: Update JAX-WS RI integration to latest version
aefimov
parents:
31746
diff
changeset
|
2 |
* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. |
12009 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package javax.xml.soap; |
|
27 |
||
28 |
/** |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
29 |
* {@code SOAPElementFactory} is a factory for XML fragments that |
12009 | 30 |
* will eventually end up in the SOAP part. These fragments |
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
31 |
* can be inserted as children of the {@code SOAPHeader} or |
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
32 |
* {@code SOAPBody} or {@code SOAPEnvelope}. |
12009 | 33 |
* |
34 |
* <p>Elements created using this factory do not have the properties |
|
35 |
* of an element that lives inside a SOAP header document. These |
|
36 |
* elements are copied into the XML document tree when they are |
|
37 |
* inserted. |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
38 |
* @deprecated - Use {@code javax.xml.soap.SOAPFactory} for creating SOAPElements. |
12009 | 39 |
* @see javax.xml.soap.SOAPFactory |
25840 | 40 |
* @since 1.6 |
12009 | 41 |
*/ |
42 |
public class SOAPElementFactory { |
|
43 |
||
44 |
private SOAPFactory soapFactory; |
|
45 |
||
46 |
private SOAPElementFactory(SOAPFactory soapFactory) { |
|
47 |
this.soapFactory = soapFactory; |
|
48 |
} |
|
49 |
||
50 |
/** |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
51 |
* Create a {@code SOAPElement} object initialized with the |
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
52 |
* given {@code Name} object. |
12009 | 53 |
* |
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
54 |
* @param name a {@code Name} object with the XML name for |
12009 | 55 |
* the new element |
56 |
* |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
57 |
* @return the new {@code SOAPElement} object that was |
12009 | 58 |
* created |
59 |
* |
|
60 |
* @exception SOAPException if there is an error in creating the |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
61 |
* {@code SOAPElement} object |
12009 | 62 |
* |
63 |
* @deprecated Use |
|
64 |
* javax.xml.soap.SOAPFactory.createElement(javax.xml.soap.Name) |
|
65 |
* instead |
|
66 |
* |
|
67 |
* @see javax.xml.soap.SOAPFactory#createElement(javax.xml.soap.Name) |
|
68 |
* @see javax.xml.soap.SOAPFactory#createElement(javax.xml.namespace.QName) |
|
69 |
*/ |
|
70 |
public SOAPElement create(Name name) throws SOAPException { |
|
71 |
return soapFactory.createElement(name); |
|
72 |
} |
|
73 |
||
74 |
/** |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
75 |
* Create a {@code SOAPElement} object initialized with the |
12009 | 76 |
* given local name. |
77 |
* |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
78 |
* @param localName a {@code String} giving the local name for |
12009 | 79 |
* the new element |
80 |
* |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
81 |
* @return the new {@code SOAPElement} object that was |
12009 | 82 |
* created |
83 |
* |
|
84 |
* @exception SOAPException if there is an error in creating the |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
85 |
* {@code SOAPElement} object |
12009 | 86 |
* |
87 |
* @deprecated Use |
|
88 |
* javax.xml.soap.SOAPFactory.createElement(String localName) instead |
|
89 |
* |
|
90 |
* @see javax.xml.soap.SOAPFactory#createElement(java.lang.String) |
|
91 |
*/ |
|
92 |
public SOAPElement create(String localName) throws SOAPException { |
|
93 |
return soapFactory.createElement(localName); |
|
94 |
} |
|
95 |
||
96 |
/** |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
97 |
* Create a new {@code SOAPElement} object with the given |
12009 | 98 |
* local name, prefix and uri. |
99 |
* |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
100 |
* @param localName a {@code String} giving the local name |
12009 | 101 |
* for the new element |
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
102 |
* @param prefix the prefix for this {@code SOAPElement} |
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
103 |
* @param uri a {@code String} giving the URI of the |
12009 | 104 |
* namespace to which the new element belongs |
105 |
* |
|
45678
65fdff10664d
8176508: Update JAX-WS RI integration to latest version
aefimov
parents:
31746
diff
changeset
|
106 |
* @return the new {@code SOAPElement} object that was |
65fdff10664d
8176508: Update JAX-WS RI integration to latest version
aefimov
parents:
31746
diff
changeset
|
107 |
* created |
65fdff10664d
8176508: Update JAX-WS RI integration to latest version
aefimov
parents:
31746
diff
changeset
|
108 |
* |
12009 | 109 |
* @exception SOAPException if there is an error in creating the |
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
110 |
* {@code SOAPElement} object |
12009 | 111 |
* |
112 |
* @deprecated Use |
|
113 |
* javax.xml.soap.SOAPFactory.createElement(String localName, |
|
114 |
* String prefix, |
|
115 |
* String uri) |
|
116 |
* instead |
|
117 |
* |
|
118 |
* @see javax.xml.soap.SOAPFactory#createElement(java.lang.String, java.lang.String, java.lang.String) |
|
119 |
*/ |
|
120 |
public SOAPElement create(String localName, String prefix, String uri) |
|
121 |
throws SOAPException { |
|
122 |
return soapFactory.createElement(localName, prefix, uri); |
|
123 |
} |
|
124 |
||
125 |
/** |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
126 |
* Creates a new instance of {@code SOAPElementFactory}. |
12009 | 127 |
* |
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
128 |
* @return a new instance of a {@code SOAPElementFactory} |
12009 | 129 |
* |
130 |
* @exception SOAPException if there was an error creating the |
|
31746
7573de6b8e46
8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents:
28326
diff
changeset
|
131 |
* default {@code SOAPElementFactory} |
12009 | 132 |
*/ |
133 |
public static SOAPElementFactory newInstance() throws SOAPException { |
|
134 |
try { |
|
135 |
return new SOAPElementFactory(SOAPFactory.newInstance()); |
|
136 |
} catch (Exception ex) { |
|
137 |
throw new SOAPException( |
|
138 |
"Unable to create SOAP Element Factory: " + ex.getMessage()); |
|
139 |
} |
|
140 |
} |
|
141 |
} |