Home | History | Annotate | Download | only in namespace

Lines Matching refs:QName

18 // $Id: QName.java 754581 2009-03-15 01:32:39Z mrglavas $
30 * <p><code>QName</code> represents a <strong>qualified name</strong>
32 * href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2:
39 * <p>The value of a <code>QName</code> contains a <strong>Namespace
43 * <p>The prefix is included in <code>QName</code> to retain lexical
47 * QName.equals(Object)} or to compute the {@link #hashCode()
48 * QName.hashCode()}. Equality and the hash code are defined using
57 * <p><code>QName</code> is immutable.</p>
61 * @see <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2: Datatypes specification</a>
67 public class QName implements Serializable {
74 * <code>org.apache.xml.namespace.QName.useCompatibleSerialVersionUID</code>
91 String compatPropValue = System.getProperty("org.apache.xml.namespace.QName.useCompatibleSerialVersionUID");
97 * <p>Namespace URI of this <code>QName</code>.</p>
102 * <p>local part of this <code>QName</code>.</p>
107 * <p>prefix of this <code>QName</code>.</p>
112 * <p><code>String</code> representation of this <code>QName</code>.</p>
117 * <p><code>QName</code> constructor specifying the Namespace URI
126 * behavior with QName 1.0. Explicitly providing the {@link
134 * compatible behavior with QName 1.0. </p>
147 * @param namespaceURI Namespace URI of the <code>QName</code>
148 * @param localPart local part of the <code>QName</code>
150 * @see #QName(String namespaceURI, String localPart, String
151 * prefix) QName(String namespaceURI, String localPart, String
154 public QName(final String namespaceURI, final String localPart) {
159 * <p><code>QName</code> constructor specifying the Namespace URI,
168 * behavior with QName 1.0. Explicitly providing the {@link
176 * compatible behavior with QName 1.0. </p>
191 * @param namespaceURI Namespace URI of the <code>QName</code>
192 * @param localPart local part of the <code>QName</code>
193 * @param prefix prefix of the <code>QName</code>
195 public QName(String namespaceURI, String localPart, String prefix) {
197 // map null Namespace URI to default to preserve compatibility with QName 1.0
204 // local part is required. "" is allowed to preserve compatibility with QName 1.0
206 throw new IllegalArgumentException("local part cannot be \"null\" when creating a QName");
212 throw new IllegalArgumentException("prefix cannot be \"null\" when creating a QName");
218 * <p><code>QName</code> constructor specifying the local part.</p>
223 * compatible behavior with QName 1.0. </p>
233 * construction of a <code>QName</code> helps prevent hard to
235 * #QName(String namespaceURI, String localPart) QName(String
237 * {@link #QName(String namespaceURI, String localPart, String prefix)}
245 * @param localPart local part of the <code>QName</code>
246 * @see #QName(String namespaceURI, String localPart) QName(String
248 * @see #QName(String namespaceURI, String localPart, String
249 * prefix) QName(String namespaceURI, String localPart, String
252 public QName(String localPart) {
260 * <p>Get the Namespace URI of this <code>QName</code>.</p>
262 * @return Namespace URI of this <code>QName</code>
269 * <p>Get the local part of this <code>QName</code>.</p>
271 * @return local part of this <code>QName</code>
278 * <p>Get the prefix of this <code>QName</code>.</p>
280 * <p>The prefix assigned to a <code>QName</code> might
282 * context. For example, a <code>QName</code> may be assigned a
286 * @return prefix of this <code>QName</code>
293 * <p>Test this <code>QName</code> for equality with another
297 * <code>QName</code> or is <code>null</code>, then this method
300 * <p>Two <code>QName</code>s are considered equal if and only if
310 * equality with this <code>QName</code>
312 * equal to this <code>QName</code> else <code>false</code>
319 // Is this a QName?
320 if (objectToTest instanceof QName) {
321 QName qName = (QName) objectToTest;
322 return localPart.equals(qName.localPart) && namespaceURI.equals(qName.namespaceURI);
328 * <p>Generate the hash code for this <code>QName</code>.</p>
331 * the local part of the <code>QName</code>. The prefix is
338 * @return hash code for this <code>QName</code> <code>Object</code>
346 * <code>QName</code>.</p>
348 * <p>The commonly accepted way of representing a <code>QName</code>
352 * This implementation represents a <code>QName</code> as:
364 * @return <code>String</code> representation of this <code>QName</code>
387 * <p><code>QName</code> derived from parsing the formatted
391 * {@link #toString() QName.toString()} formatting, an
395 * form returned by {@link #toString() QName.toString()}.</em></p>
397 * <p>The commonly accepted way of representing a <code>QName</code>
412 * <code>QName</code>.
421 * of the <code>QName</code>
422 * @return <code>QName</code> corresponding to the given <code>String</code>
423 * @see #toString() QName.toString()
425 public static QName valueOf(String qNameAsString) {
429 throw new IllegalArgumentException("cannot create QName from \"null\" or \"\" String");
432 // "" local part is valid to preserve compatible behavior with QName 1.0
434 return new QName(
442 return new QName(
462 "cannot create QName from \""
466 return new QName(
473 * For old versions of QName which didn't have a prefix field,