Package org.dom4j.tree
Class QNameCache
- java.lang.Object
-
- org.dom4j.tree.QNameCache
-
public class QNameCache extends Object
QNameCache
caches instances ofQName
for reuse both across documents and within documents.
-
-
Constructor Summary
Constructors Constructor Description QNameCache()
QNameCache(DocumentFactory documentFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,QName>
createMap()
A factory methodprotected QName
createQName(String name)
Factory method to create a new QName object which can be overloaded to create derived QName instancesprotected QName
createQName(String name, Namespace namespace)
Factory method to create a new QName object which can be overloaded to create derived QName instancesprotected QName
createQName(String name, Namespace namespace, String qualifiedName)
Factory method to create a new QName object which can be overloaded to create derived QName instancesQName
get(String name)
DOCUMENT ME!QName
get(String qualifiedName, String uri)
QName
get(String name, Namespace namespace)
DOCUMENT ME!QName
get(String localName, Namespace namespace, String qName)
DOCUMENT ME!protected Map<String,QName>
getNamespaceCache(Namespace namespace)
DOCUMENT ME!List<QName>
getQNames()
Returns a list of all the QName instances currently usedQName
intern(QName qname)
DOCUMENT ME!
-
-
-
Constructor Detail
-
QNameCache
public QNameCache()
-
QNameCache
public QNameCache(DocumentFactory documentFactory)
-
-
Method Detail
-
getQNames
public List<QName> getQNames()
Returns a list of all the QName instances currently used- Returns:
- DOCUMENT ME!
-
get
public QName get(String name)
DOCUMENT ME!- Parameters:
name
- DOCUMENT ME!- Returns:
- the QName for the given name and no namepsace
-
get
public QName get(String name, Namespace namespace)
DOCUMENT ME!- Parameters:
name
- DOCUMENT ME!namespace
- DOCUMENT ME!- Returns:
- the QName for the given local name and namepsace
-
get
public QName get(String localName, Namespace namespace, String qName)
DOCUMENT ME!- Parameters:
localName
- DOCUMENT ME!namespace
- DOCUMENT ME!qName
- DOCUMENT ME!- Returns:
- the QName for the given local name, qualified name and namepsace
-
intern
public QName intern(QName qname)
DOCUMENT ME!- Parameters:
qname
- DOCUMENT ME!- Returns:
- the cached QName instance if there is one or adds the given qname to the cache if not
-
getNamespaceCache
protected Map<String,QName> getNamespaceCache(Namespace namespace)
DOCUMENT ME!- Parameters:
namespace
- DOCUMENT ME!- Returns:
- the cache for the given namespace. If one does not currently exist it is created.
-
createMap
protected Map<String,QName> createMap()
A factory method- Returns:
- a newly created
Map
instance.
-
createQName
protected QName createQName(String name)
Factory method to create a new QName object which can be overloaded to create derived QName instances- Parameters:
name
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
createQName
protected QName createQName(String name, Namespace namespace)
Factory method to create a new QName object which can be overloaded to create derived QName instances- Parameters:
name
- DOCUMENT ME!namespace
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
createQName
protected QName createQName(String name, Namespace namespace, String qualifiedName)
Factory method to create a new QName object which can be overloaded to create derived QName instances- Parameters:
name
- DOCUMENT ME!namespace
- DOCUMENT ME!qualifiedName
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
-