org.gvsig.tools.persistence.impl
Class DynObjectPersistenceFactory

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

public class DynObjectPersistenceFactory
extends Object
implements PersistenceFactory


Constructor Summary
DynObjectPersistenceFactory()
           
 
Method Summary
 Object createFromState(PersistentState state)
          Create an instance of the object represented by the state.
 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.
 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.
 void saveToState(PersistentState state, Object obj)
          Fill state with data to persist of obj.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynObjectPersistenceFactory

public DynObjectPersistenceFactory()
Method Detail

createFromState

public Object createFromState(PersistentState state)
                       throws PersistenceException
Description copied from interface: PersistenceFactory
Create an instance of the object represented by the state. This method can't call PersistenceFactory.loadFromState(PersistentState, Object) only create the object.

Specified by:
createFromState in interface PersistenceFactory
Returns:
the object
Throws:
PersistenceException

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

saveToState

public void saveToState(PersistentState state,
                        Object obj)
                 throws PersistenceException
Description copied from interface: PersistenceFactory
Fill state with data to persist of obj.

Specified by:
saveToState in interface PersistenceFactory
Throws:
PersistenceException

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:

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

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

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

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

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.

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.


Copyright © 2004-2011 gvSIG. All Rights Reserved.