org.gvsig.tools.persistence
Class AbstractMultiPersistenceFactory

java.lang.Object
  extended by org.gvsig.tools.persistence.AbstractMultiPersistenceFactory
All Implemented Interfaces:
PersistenceFactory

public abstract class AbstractMultiPersistenceFactory
extends Object
implements PersistenceFactory


Field Summary
protected  List classes
           
protected  List definitions
           
protected  Map nameToClass
           
protected  Map nameToDefinition
           
 
Constructor Summary
protected AbstractMultiPersistenceFactory()
           
 
Method Summary
protected  DynStruct addDefinition(Class managedClass, String name, String description)
           
 DynStruct getDefinition(String className)
          Returns the associated definition to the java class name
 List getDefinitions()
          Return a List of the definition managed by this factory where the key is className and value is definition
 String getDomainName()
          Returns the domain name of the objects persisted by this factory.
 String getDomainURL()
          Returns the domain URL to use for the schema.
 Class getManagedClass(Object object)
          Return the class or interface the factory asociate to the object.
 Class getManagedClass(PersistentState state)
          Return the class or interface the factory asociate to the object.
 Class getManagedClass(String name)
          Return the class or interface the factory asociate to the java class name.
 List getManagedClasses()
          Return the list of classes or interfaces managed by this factory.
 String getManagedClassName(Object object)
          Return the name class or interface the factory asociate to the object.
 void loadFromState(PersistentState state, Object object)
          Load a instance of classToUse from state data.
protected abstract  void makeDefinitions()
          Create DynStruct definition and call to #addDefinition(Class, DynStruct) to add to the factory.
 boolean manages(Class theClass)
          Informs if theClass is managed by this factory.
 boolean manages(Object object)
          Informs if object is managed by this factory.
 boolean manages(PersistentState state)
          Informs if this factory can recreate the object represented by state.
 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.persistence.PersistenceFactory
createFromState, saveToState
 

Field Detail

classes

protected List classes

definitions

protected List definitions

nameToDefinition

protected Map nameToDefinition

nameToClass

protected Map nameToClass
Constructor Detail

AbstractMultiPersistenceFactory

protected AbstractMultiPersistenceFactory()
Method Detail

addDefinition

protected DynStruct addDefinition(Class managedClass,
                                  String name,
                                  String description)

toString

public String toString()
Overrides:
toString in class Object

loadFromState

public void loadFromState(PersistentState state,
                          Object object)
                   throws PersistenceException
Description copied from interface: PersistenceFactory
Load a instance of classToUse from state data.

Specified by:
loadFromState in interface PersistenceFactory
Throws:
PersistenceException

getDomainName

public String getDomainName()
Description copied from interface: PersistenceFactory
Returns the domain name of the objects persisted by this factory.

Specified by:
getDomainName in interface PersistenceFactory
Returns:
the domain name

getDomainURL

public String getDomainURL()
Description copied from interface: PersistenceFactory
Returns the domain URL to use for the schema.

Specified by:
getDomainURL in interface PersistenceFactory
Returns:
the domain URL

getDefinitions

public List getDefinitions()
Description copied from interface: PersistenceFactory
Return a List of the definition managed by this factory where the key is className and value is definition

Specified by:
getDefinitions in interface PersistenceFactory
Returns:
Map

getManagedClasses

public List getManagedClasses()
Description copied from interface: PersistenceFactory
Return the list of classes or interfaces managed by this factory. Can return null if factory not use it.

Specified by:
getManagedClasses in interface PersistenceFactory
Returns:
List of interfaces the factory manage

getDefinition

public DynStruct getDefinition(String className)
Description copied from interface: PersistenceFactory
Returns the associated definition to the java class name

Specified by:
getDefinition in interface PersistenceFactory
Parameters:
className - of a java Class
Returns:
the related definition or null if not managed by this factory

manages

public boolean manages(Object object)
Description copied from interface: PersistenceFactory
Informs if object is managed by this factory.

Specified by:
manages in interface PersistenceFactory
Returns:
true if the object is managed by the factory.

manages

public boolean manages(Class theClass)
Description copied from interface: PersistenceFactory
Informs if theClass is managed by this factory.

Specified by:
manages in interface PersistenceFactory
Returns:
true if the class is managed by the factory.

manages

public boolean manages(PersistentState state)
Description copied from interface: PersistenceFactory
Informs if this factory can recreate the object represented by state.

Specified by:
manages in interface PersistenceFactory
Returns:

getManagedClass

public Class getManagedClass(PersistentState state)
Description copied from interface: PersistenceFactory
Return the class or interface the factory asociate to the object. Can return null if factory not asociate an interface to the object.

Specified by:
getManagedClass in interface PersistenceFactory
Returns:
interface or class the factory manage asociated to the state.

getManagedClass

public Class getManagedClass(String name)
Description copied from interface: PersistenceFactory
Return the class or interface the factory asociate to the java class name. Can return null if factory not asociate an interface to that name.

Specified by:
getManagedClass in interface PersistenceFactory
Returns:
interface or class the factory manage asociated to the name.

getManagedClass

public Class getManagedClass(Object object)
Description copied from interface: PersistenceFactory
Return the class or interface the factory asociate to the object. Can return null if factory not asociate an interface to the object.

Specified by:
getManagedClass in interface PersistenceFactory
Returns:
interface the factory manage asociated to the object.

getManagedClassName

public String getManagedClassName(Object object)
Description copied from interface: PersistenceFactory
Return the name class or interface the factory asociate to the object. Can return null if factory not asociate an interface to the object.

Specified by:
getManagedClassName in interface PersistenceFactory
Returns:
interface the factory manage asociated to the object.

makeDefinitions

protected abstract void makeDefinitions()
Create DynStruct definition and call to #addDefinition(Class, DynStruct) to add to the factory.



Copyright © 2004-2011 gvSIG. All Rights Reserved.