org.gvsig.tools.locator
Class AbstractLocator

java.lang.Object
  extended by org.gvsig.tools.locator.AbstractLocator
All Implemented Interfaces:
Locator
Direct Known Subclasses:
BaseLocator, ToolsLocator

public abstract class AbstractLocator
extends Object
implements Locator

Locator implementation based on the use of the ExtensionPoints.

Author:
Cèsar Ordiñana

Constructor Summary
AbstractLocator()
           
 
Method Summary
 Object get(String name)
          Returns a reference to the object with the given name.
 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)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.gvsig.tools.locator.Locator
getLocatorName
 

Constructor Detail

AbstractLocator

public AbstractLocator()
Method Detail

get

public Object get(String name)
           throws LocatorException
Description copied from interface: Locator
Returns a reference to the object with the given name.

Specified by:
get in interface Locator
Parameters:
name - of the object to return
Returns:
an instance of an object, or null if not found
Throws:
LocatorException - if there is no access to the class or the class cannot be instantiated

getNames

public String[] getNames()
Description copied from interface: Locator
Returns the list of names of references available through this Locator. Must return null if there are not any registered names.

Specified by:
getNames in interface Locator
Returns:
the list of names of references

register

public void register(String name,
                     Class clazz)
Description copied from interface: Locator
Registers a class related to a name. The class is used to create an instance of the object to return in the Locator.get(String) method.

Specified by:
register in interface Locator
Parameters:
name - of the object to register
clazz - the Class of the object to register

registerDefault

public void registerDefault(String name,
                            Class clazz)
Specified by:
registerDefault in interface Locator

register

public void register(String name,
                     String description,
                     Class clazz)
Description copied from interface: Locator
Registers a class related to a name. The class is used to create an instance of the object to return in the Locator.get(String) method.

Specified by:
register in interface Locator
Parameters:
name - of the object to register
description - of the object to register
clazz - the Class of the object to register

registerDefault

public void registerDefault(String name,
                            String description,
                            Class clazz)
Specified by:
registerDefault in interface Locator

register

public void register(String name,
                     LocatorObjectFactory factory)
Description copied from interface: Locator
Registers an object factory related to a name. The factory is used to create an instance of the object to return in the Locator.get(String) method.

Specified by:
register in interface Locator
Parameters:
name - of the object to register
factory - the factory of objects to register

register

public void register(String name,
                     String description,
                     LocatorObjectFactory factory)
Description copied from interface: Locator
Registers an object factory related to a name. The factory is used to create an instance of the object to return in the Locator.get(String) method.

Specified by:
register in interface Locator
Parameters:
name - of the object to register
description - of the object to register
factory - the factory of objects to register

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2011 gvSIG. All Rights Reserved.