net.sf.jsefa.xml.namespace
Class QNameParser

java.lang.Object
  extended by net.sf.jsefa.xml.namespace.QNameParser

public final class QNameParser
extends Object

A QNameParser allows for creating a QName from its String representation.

The format is prefix:localname
if an explicit prefix is given and localname if no explicit prefix is given.

Author:
Norman Lahme-Huetig

Method Summary
static QName parse(String name, boolean forElement, NamespaceManager namespaceManager)
          Creates a QName from a String representation using the given namespace manager for namespace prefix resolving.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static QName parse(String name,
                          boolean forElement,
                          NamespaceManager namespaceManager)
Creates a QName from a String representation using the given namespace manager for namespace prefix resolving.

In the case the String representation contains no prefix it is assumed that the name belongs to the default namespace only if the argument forElement is true and if a default namespace is registered.

Parameters:
name - the String representation of the QName as desribed above
forElement - true, if a default namespace should be taken into account; false otherwise.
namespaceManager - the namespace manager used to retrieve the URI for a given prefix
Returns:
the QName


Copyright © 2014. All rights reserved.