Package net.sf.jasperreports.extensions
Class ExtensionsEnvironment
- java.lang.Object
-
- net.sf.jasperreports.extensions.ExtensionsEnvironment
-
public final class ExtensionsEnvironment extends Object
A class that provides means of setting and accessingExtensionsRegistryinstances.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
getExtensionsRegistry()
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXCEPTION_MESSAGE_KEY_NULL_EXTENSIONS_REGISTRYprotected static ObjectNULL_CACHE_KEYstatic StringPROPERTY_EXTENSIONS_REGISTRY_CLASSA property that provides the defaultExtensionsRegistryimplementation class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectgetExtensionsCacheKey()Returns an object that can be used as cache key for extension-related caches.static ExtensionsRegistrygetExtensionsRegistry()Returns the extensions registry to be used in the current context.static ExtensionsRegistrygetSystemExtensionsRegistry()Returns the system default extensions registry object.static ExtensionsRegistrygetThreadExtensionsRegistry()Returns the thread extensions registry, if any.static voidresetThreadExtensionsRegistry()Resets (to null) the thread extensions registry.static voidsetSystemExtensionsRegistry(ExtensionsRegistry extensionsRegistry)Sets the system default extensions registry.static voidsetThreadExtensionsRegistry(ExtensionsRegistry extensionsRegistry)Sets the thread extensions registry.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_NULL_EXTENSIONS_REGISTRY
public static final String EXCEPTION_MESSAGE_KEY_NULL_EXTENSIONS_REGISTRY
- See Also:
- Constant Field Values
-
NULL_CACHE_KEY
protected static final Object NULL_CACHE_KEY
-
PROPERTY_EXTENSIONS_REGISTRY_CLASS
public static final String PROPERTY_EXTENSIONS_REGISTRY_CLASS
A property that provides the defaultExtensionsRegistryimplementation class.This property is only read at initialization time, therefore changing the property value at a later time will have no effect.
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSystemExtensionsRegistry
public static ExtensionsRegistry getSystemExtensionsRegistry()
Returns the system default extensions registry object.This is either the one instantiated based on
PROPERTY_EXTENSIONS_REGISTRY_CLASS, or the one set bysetSystemExtensionsRegistry(ExtensionsRegistry).- Returns:
- the system default extensions registry object
-
setSystemExtensionsRegistry
public static void setSystemExtensionsRegistry(ExtensionsRegistry extensionsRegistry)
Sets the system default extensions registry.- Parameters:
extensionsRegistry- the extensions registry
-
getThreadExtensionsRegistry
public static ExtensionsRegistry getThreadExtensionsRegistry()
Returns the thread extensions registry, if any.- Returns:
- the thread extensions registry
-
setThreadExtensionsRegistry
public static void setThreadExtensionsRegistry(ExtensionsRegistry extensionsRegistry)
Sets the thread extensions registry.- Parameters:
extensionsRegistry-- See Also:
getExtensionsRegistry()
-
resetThreadExtensionsRegistry
public static void resetThreadExtensionsRegistry()
Resets (to null) the thread extensions registry.
-
getExtensionsRegistry
public static ExtensionsRegistry getExtensionsRegistry()
Returns the extensions registry to be used in the current context.The method returns the thread extensions registry (as returned by
getThreadExtensionsRegistry()) if it exists, and the system registry (as returned bygetSystemExtensionsRegistry()) otherwise.- Returns:
- the context extensions registry
-
getExtensionsCacheKey
public static Object getExtensionsCacheKey()
Returns an object that can be used as cache key for extension-related caches.- Returns:
- an extension-related cache key
-
-