@AlfrescoPublicApi public class NamedObjectRegistry<T> extends Object
Constructor and Description |
---|
NamedObjectRegistry()
Default constructor.
|
NamedObjectRegistry(Class<T> type)
Constructor that takes care of
setStorageType(Class) . |
Modifier and Type | Method and Description |
---|---|
Map<String,T> |
getAllNamedObjects() |
T |
getNamedObject(String name)
Get a named object if it has been registered
|
void |
register(String name,
T object)
Register a named object instance.
|
void |
reset() |
void |
setNamePattern(String namePattern)
Optionally set a pattern to which all object names must conform
|
void |
setStorageType(Class<T> clazz)
Set the type of class that the registry holds.
|
public NamedObjectRegistry()
setStorageType(Class)
method must be called.public NamedObjectRegistry(Class<T> type)
setStorageType(Class)
.setStorageType(Class)
public void setStorageType(Class<T> clazz)
clazz
- the type to storepublic void setNamePattern(String namePattern)
namePattern
- a regular expressionpublic void register(String name, T object)
name
- the name of the objectobject
- the instance to register, which correspond to the typepublic T getNamedObject(String name)
name
- the name of the object to retrievepublic Map<String,T> getAllNamedObjects()
public void reset()
Copyright © 2005–2015 Alfresco Software. All rights reserved.