Package org.dom4j.tree
Class NamespaceCache
- java.lang.Object
-
- org.dom4j.tree.NamespaceCache
-
public class NamespaceCache extends Object
NamespaceCachecaches instances ofDefaultNamespacefor reuse both across documents and within documents.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Map<String,Map<String,WeakReference<Namespace>>>cacheprotected static Map<String,WeakReference<Namespace>>noPrefixCacheCache ofNamespaceinstances indexed by URI for default namespaces with no prefixes
-
Constructor Summary
Constructors Constructor Description NamespaceCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NamespacecreateNamespace(String prefix, String uri)A factory method to createNamespaceinstanceNamespaceget(String uri)DOCUMENT ME!Namespaceget(String prefix, String uri)DOCUMENT ME!protected Map<String,WeakReference<Namespace>>getURICache(String uri)DOCUMENT ME!
-
-
-
Method Detail
-
get
public Namespace get(String prefix, String uri)
DOCUMENT ME!- Parameters:
prefix- DOCUMENT ME!uri- DOCUMENT ME!- Returns:
- the namespace for the given prefix and uri
-
get
public Namespace get(String uri)
DOCUMENT ME!- Parameters:
uri- DOCUMENT ME!- Returns:
- the name model for the given name and namepsace
-
getURICache
protected Map<String,WeakReference<Namespace>> getURICache(String uri)
DOCUMENT ME!- Parameters:
uri- DOCUMENT ME!- Returns:
- the cache for the given namespace URI. If one does not currently exist it is created.
-
-