public interface Locator
Modifier and Type | Method and Description |
---|---|
Object |
get(String name)
Returns a reference to the object with the given name.
|
String |
getLocatorName()
Returns the name of the Locator, for registration, logging, and other
uses.
|
String[] |
getNames()
Returns the list of names of references available through this Locator.
|
void |
register(String name,
Class clazz)
Registers a class related to a name.
|
void |
register(String name,
LocatorObjectFactory factory)
Registers an object factory related to a name.
|
void |
register(String name,
String description,
Class clazz)
Registers a class related to a name.
|
void |
register(String name,
String description,
LocatorObjectFactory factory)
Registers an object factory related to a name.
|
void |
registerDefault(String name,
Class clazz) |
void |
registerDefault(String name,
String description,
Class clazz) |
Object get(String name) throws LocatorException
name
- of the object to returnLocatorException
- if there is no access to the class or the class cannot be
instantiatedString[] getNames()
void register(String name, Class clazz)
get(String)
method.name
- of the object to registerclazz
- the Class of the object to registervoid register(String name, String description, Class clazz)
get(String)
method.name
- of the object to registerdescription
- of the object to registerclazz
- the Class of the object to registervoid register(String name, LocatorObjectFactory factory)
get(String)
method.name
- of the object to registerfactory
- the factory of objects to registervoid register(String name, String description, LocatorObjectFactory factory)
get(String)
method.name
- of the object to registerdescription
- of the object to registerfactory
- the factory of objects to registerString getLocatorName()