org.gvsig.tools.persistence
Class AbstractSinglePersistenceFactory

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

public abstract class AbstractSinglePersistenceFactory
extends Object
implements PersistenceFactory


Constructor Summary
protected AbstractSinglePersistenceFactory(Class theClass, String name, String description, String domainName, String domainUrl)
           
 
Method Summary
protected  DynStruct getDefinition()
           
 DynStruct getDefinition(String name)
          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.
 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
 

Constructor Detail

AbstractSinglePersistenceFactory

protected AbstractSinglePersistenceFactory(Class theClass,
                                           String name,
                                           String description,
                                           String domainName,
                                           String domainUrl)
Method Detail

getDefinition

protected DynStruct getDefinition()

getDefinition

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

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

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

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

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.

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

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

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:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2011 gvSIG. All Rights Reserved.