Class ContextManager
- java.lang.Object
-
- com.itextpdf.commons.actions.contexts.ContextManager
-
public class ContextManager extends java.lang.Object
The class that retrieves context of its invocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ContextManager.LengthComparator
-
Field Summary
Fields Modifier and Type Field Description private java.util.SortedMap<java.lang.String,IContext>
contextMappings
private static ContextManager
INSTANCE
-
Constructor Summary
Constructors Constructor Description ContextManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IContext
getContext(java.lang.Class<?> clazz)
Gets the context associated with the passed class object.IContext
getContext(java.lang.String className)
Gets the context associated with the passed class object.static ContextManager
getInstance()
Gets the singleton instance of this class.private IContext
getNamespaceMapping(java.lang.String namespace)
(package private) java.lang.String
getRecognisedNamespace(java.lang.String className)
private static java.lang.String
normalize(java.lang.String namespace)
(package private) void
registerGenericContext(java.util.Collection<java.lang.String> namespaces, java.util.Collection<java.lang.String> products)
(package private) void
unregisterContext(java.util.Collection<java.lang.String> namespaces)
-
-
-
Field Detail
-
INSTANCE
private static final ContextManager INSTANCE
-
contextMappings
private final java.util.SortedMap<java.lang.String,IContext> contextMappings
-
-
Method Detail
-
getInstance
public static ContextManager getInstance()
Gets the singleton instance of this class.- Returns:
- the
ContextManager
instance
-
getContext
public IContext getContext(java.lang.Class<?> clazz)
Gets the context associated with the passed class object. The context is determined by class namespace.- Parameters:
clazz
- the class for which the context will be determined.- Returns:
- the
IContext
associated with the class, ornull
if the class is unknown.
-
getContext
public IContext getContext(java.lang.String className)
Gets the context associated with the passed class object. The context is determined by class namespace.- Parameters:
className
- the class name with the namespace for which the context will be determined.- Returns:
- the
IContext
associated with the class, ornull
if the class is unknown.
-
getRecognisedNamespace
java.lang.String getRecognisedNamespace(java.lang.String className)
-
unregisterContext
void unregisterContext(java.util.Collection<java.lang.String> namespaces)
-
getNamespaceMapping
private IContext getNamespaceMapping(java.lang.String namespace)
-
registerGenericContext
void registerGenericContext(java.util.Collection<java.lang.String> namespaces, java.util.Collection<java.lang.String> products)
-
normalize
private static java.lang.String normalize(java.lang.String namespace)
-
-