Package org.forgerock.openig.script
Class DefaultScriptFactoryManager
- java.lang.Object
-
- org.forgerock.openig.script.DefaultScriptFactoryManager
-
- All Implemented Interfaces:
ScriptFactoryManager
public class DefaultScriptFactoryManager extends Object implements ScriptFactoryManager
Default implementation ofScriptFactoryManager
supporting dynamic registration and un-registration ofScriptFactory
.
-
-
Constructor Summary
Constructors Constructor Description DefaultScriptFactoryManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<ScriptFactory>
findScriptFactory(String mimeType)
Finds a factory for the given MIME type.ScriptFactory
registerFactory(String mimeType, ScriptFactory factory)
Registers a givenmimeType
for the givenScriptFactory
.ScriptFactory
unregisterFactory(String mimeType)
Un-registers the factory for the givenmimeType
.
-
-
-
Method Detail
-
registerFactory
public ScriptFactory registerFactory(String mimeType, ScriptFactory factory)
Registers a givenmimeType
for the givenScriptFactory
.- Parameters:
mimeType
- registered MIME typefactory
- factory to use for the given type- Returns:
- the previous registered factory (if any)
-
unregisterFactory
public ScriptFactory unregisterFactory(String mimeType)
Un-registers the factory for the givenmimeType
.- Parameters:
mimeType
- MIME type to un-register- Returns:
- the removed factory (if any)
-
findScriptFactory
public Optional<ScriptFactory> findScriptFactory(String mimeType)
Description copied from interface:ScriptFactoryManager
Finds a factory for the given MIME type.- Specified by:
findScriptFactory
in interfaceScriptFactoryManager
- Parameters:
mimeType
- type value- Returns:
- an empty
Optional
if not factory can be found, otherwise a valuedOptional
wrapping the factory
-
-