Class ContextManager
- java.lang.Object
-
- com.itextpdf.commons.actions.contexts.ContextManager
-
public class ContextManager extends java.lang.ObjectThe class that retrieves context of its invocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classContextManager.LengthComparator
-
Field Summary
Fields Modifier and Type Field Description private java.util.SortedMap<java.lang.String,IContext>contextMappingsprivate static ContextManagerINSTANCE
-
Constructor Summary
Constructors Constructor Description ContextManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IContextgetContext(java.lang.Class<?> clazz)Gets the context associated with the passed class object.IContextgetContext(java.lang.String className)Gets the context associated with the passed class object.static ContextManagergetInstance()Gets the singleton instance of this class.private IContextgetNamespaceMapping(java.lang.String namespace)(package private) java.lang.StringgetRecognisedNamespace(java.lang.String className)private static java.lang.Stringnormalize(java.lang.String namespace)(package private) voidregisterGenericContext(java.util.Collection<java.lang.String> namespaces, java.util.Collection<java.lang.String> products)(package private) voidunregisterContext(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
ContextManagerinstance
-
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
IContextassociated with the class, ornullif 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
IContextassociated with the class, ornullif 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)
-
-