Home | History | Annotate | Download | only in namespace

Lines Matching defs:QName

18 // $Id: QName.java 754581 2009-03-15 01:32:39Z mrglavas $
28 * <p><code>QName</code> represents a <strong>qualified name</strong>
30 * href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2:
37 * <p>The value of a <code>QName</code> contains a <strong>Namespace
41 * <p>The prefix is included in <code>QName</code> to retain lexical
45 * QName.equals(Object)} or to compute the {@link #hashCode()
46 * QName.hashCode()}. Equality and the hash code are defined using
55 * <p><code>QName</code> is immutable.</p>
59 * @see <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2: Datatypes specification</a>
65 public class QName implements Serializable {
72 * <code>org.apache.xml.namespace.QName.useCompatibleSerialVersionUID</code>
89 String compatPropValue = System.getProperty("org.apache.xml.namespace.QName.useCompatibleSerialVersionUID");
95 * <p>Namespace URI of this <code>QName</code>.</p>
100 * <p>local part of this <code>QName</code>.</p>
105 * <p>prefix of this <code>QName</code>.</p>
110 * <p><code>String</code> representation of this <code>QName</code>.</p>
115 * <p><code>QName</code> constructor specifying the Namespace URI
124 * behavior with QName 1.0. Explicitly providing the {@link
132 * compatible behavior with QName 1.0. </p>
145 * @param namespaceURI Namespace URI of the <code>QName</code>
146 * @param localPart local part of the <code>QName</code>
148 * @see #QName(String namespaceURI, String localPart, String
149 * prefix) QName(String namespaceURI, String localPart, String
152 public QName(final String namespaceURI, final String localPart) {
157 * <p><code>QName</code> constructor specifying the Namespace URI,
166 * behavior with QName 1.0. Explicitly providing the {@link
174 * compatible behavior with QName 1.0. </p>
189 * @param namespaceURI Namespace URI of the <code>QName</code>
190 * @param localPart local part of the <code>QName</code>
191 * @param prefix prefix of the <code>QName</code>
193 public QName(String namespaceURI, String localPart, String prefix) {
195 // map null Namespace URI to default to preserve compatibility with QName 1.0
202 // local part is required. "" is allowed to preserve compatibility with QName 1.0
204 throw new IllegalArgumentException("local part cannot be \"null\" when creating a QName");
210 throw new IllegalArgumentException("prefix cannot be \"null\" when creating a QName");
216 * <p><code>QName</code> constructor specifying the local part.</p>
221 * compatible behavior with QName 1.0. </p>
231 * construction of a <code>QName</code> helps prevent hard to
233 * #QName(String namespaceURI, String localPart) QName(String
235 * {@link #QName(String namespaceURI, String localPart, String prefix)}
243 * @param localPart local part of the <code>QName</code>
244 * @see #QName(String namespaceURI, String localPart) QName(String
246 * @see #QName(String namespaceURI, String localPart, String
247 * prefix) QName(String namespaceURI, String localPart, String
250 public QName(String localPart) {
258 * <p>Get the Namespace URI of this <code>QName</code>.</p>
260 * @return Namespace URI of this <code>QName</code>
267 * <p>Get the local part of this <code>QName</code>.</p>
269 * @return local part of this <code>QName</code>
276 * <p>Get the prefix of this <code>QName</code>.</p>
278 * <p>The prefix assigned to a <code>QName</code> might
280 * context. For example, a <code>QName</code> may be assigned a
284 * @return prefix of this <code>QName</code>
291 * <p>Test this <code>QName</code> for equality with another
295 * <code>QName</code> or is <code>null</code>, then this method
298 * <p>Two <code>QName</code>s are considered equal if and only if
308 * equality with this <code>QName</code>
310 * equal to this <code>QName</code> else <code>false</code>
317 // Is this a QName?
318 if (objectToTest instanceof QName) {
319 QName qName = (QName) objectToTest;
320 return localPart.equals(qName.localPart) && namespaceURI.equals(qName.namespaceURI);
326 * <p>Generate the hash code for this <code>QName</code>.</p>
329 * the local part of the <code>QName</code>. The prefix is
336 * @return hash code for this <code>QName</code> <code>Object</code>
344 * <code>QName</code>.</p>
346 * <p>The commonly accepted way of representing a <code>QName</code>
350 * This implementation represents a <code>QName</code> as:
362 * @return <code>String</code> representation of this <code>QName</code>
385 * <p><code>QName</code> derived from parsing the formatted
389 * {@link #toString() QName.toString()} formatting, an
393 * form returned by {@link #toString() QName.toString()}.</em></p>
395 * <p>The commonly accepted way of representing a <code>QName</code>
410 * <code>QName</code>.
419 * of the <code>QName</code>
420 * @return <code>QName</code> corresponding to the given <code>String</code>
421 * @see #toString() QName.toString()
423 public static QName valueOf(String qNameAsString) {
427 throw new IllegalArgumentException("cannot create QName from \"null\" or \"\" String");
430 // "" local part is valid to preserve compatible behavior with QName 1.0
432 return new QName(
440 return new QName(
460 "cannot create QName from \""
464 return new QName(
471 * For old versions of QName which didn't have a prefix field,