org.gvsig.tools.dynobject
Interface DynObjectManager

All Known Implementing Classes:
DefaultDynObjectManager

public interface DynObjectManager

Manager for the DynObject tools library. This is the main entry point to the tools dynobjects API.

Version:
$Id$
Author:
gvSIG Team

Field Summary
static int NULLCODE
          Null value for method id.
 
Method Summary
 void add(DynClass dynClass)
          Añade la dynClass a la lista de clases registradas.
 DynClass add(String name)
          Create and add to the manager a class with the name passed as parameter in the default namespace.
 DynClass add(String name, String description)
          Create and add to the manager a class with the name passed as parameter in the default namespace.
 void consolide()
          Actualiza todas las DynClasses registradas para reflejar la herencia de forma adecuada.
 DynClass createDynClass(String name, String description)
          Create a instance of DynClass with the name and description Indicated as parameters.
 DynClass createDynClass(String namespace, String name, String description)
          Create a instance of DynClass with the name and description Indicated as parameters.
 DynClassName createDynClassName(String name)
          Creates a DynClassName with a DynClass name or fullname
 DynClassName createDynClassName(String namespace, String name)
          Creates a DynClassName with a DynClass name and its namespace.
 DynObject createDynObject(DynStruct dynStruct)
          Create a new DynObject associated to the DynStruct or DynClass passed as parameter.
 DynObject createDynObject(String classname)
          Crea un nuevo objeto asociandole como clase base la indicada que tiene el nombre indicado.
 DynObject createDynObject(String namespace, String classname)
          Crea un nuevo objeto asociandole como clase base la indicada que tiene el nombre indicado.
 DynObjectPagingHelper createDynObjectPagingHelper(DynObjectSet set)
          Creates a new DynObjectPagingHelper to page the data of a DynObjectSet.
 DynObjectPagingHelper createDynObjectPagingHelper(DynObjectSet set, int pageSize)
          Creates a new DynObjectPagingHelper to page the data of a DynObjectSet.
 DynClass get(String name)
          Obtiene la clase asociado al nombre indicado.
 DynClass get(String namespace, String name)
          Obtiene el la clase asociado al nombre indicado dentro del namespace pedido.
 int getCount()
          Return the count of registered DynClass.
 Class getDefaultClassOfType(int type)
          Deprecated. use DataTypesManager.getDefaultClass
 DynMethod getDynMethod(Class theClass, int code)
           
 DynMethod getDynMethod(DynClass dynClass, int code)
           
 DynMethod getDynMethod(DynObject dynObject, int code)
          Obtain the method for the indicated code of the dynObject.
 DynMethod getDynMethod(int code)
           
 DynMethod getDynMethod(Object obj, int code)
           
 List getNames()
          Return the list of names of all registered DynClass.
 boolean has(String name)
          Comprueba si esta registrada una clase.
 boolean has(String namespace, String name)
          Comprueba si esta registrada una clase.
 Map importDynClassDefinitions(InputStream resource, ClassLoader loader)
          Load the classes defined in the resource.
 Map importDynClassDefinitions(InputStream resource, ClassLoader loader, String defaultNamespace)
          Load the classes defined in the resource and return a Map with its.
 Map importDynClassDefinitions(org.xmlpull.v1.XmlPullParser parser, ClassLoader loader, String defaultNamespace)
          Load the classes defined in the resource.
 Object invokeDynMethod(Object self, int code, DynObject context)
          Invoke the method of the indicated code for the object self, with parameters in context.
 Iterator iterator()
          Return an iterator over all registered DynClass.
 Iterator iterator(String namespace)
          Return an iterator over all registered DynClass with the same namespace.
 int registerDynMethod(Class theClass, DynMethod dynMethod)
          Register the method in the class.
 int registerDynMethod(DynClass dynClass, DynMethod dynMethod)
          Register the method in the dynClass.
 void remove(DynStruct dynClass)
           
 void validate(DynObject object)
           
 

Field Detail

NULLCODE

static final int NULLCODE
Null value for method id. This value not is a value valid for a code of method.

See Also:
Constant Field Values
Method Detail

createDynClass

DynClass createDynClass(String name,
                        String description)
Create a instance of DynClass with the name and description Indicated as parameters.

Parameters:
name - , the name used for DynClass name.
description - , the description associated to the new DynClass.
Returns:
the DynClass created.

createDynClass

DynClass createDynClass(String namespace,
                        String name,
                        String description)
Create a instance of DynClass with the name and description Indicated as parameters.

Parameters:
namespace - , the namespace used for the new DynClass.
name - , the name used for the new DynClass.
description - , the description associated to the new DynClass.
Returns:
the DynClass created.

importDynClassDefinitions

Map importDynClassDefinitions(InputStream resource,
                              ClassLoader loader,
                              String defaultNamespace)
                              throws org.xmlpull.v1.XmlPullParserException,
                                     IOException
Load the classes defined in the resource and return a Map with its. The classes do not be registered in the manager.

Parameters:
resource - , XML with the definition of dynamic classes.
loader - , loader used to load classes used in "classOfValue" in the resource.
defaultNamespace - , namespace used in classes that do not specify a namespace in the resource.
Returns:
The Map of loaded dynamic classes
Throws:
org.xmlpull.v1.XmlPullParserException
IOException

importDynClassDefinitions

Map importDynClassDefinitions(InputStream resource,
                              ClassLoader loader)
                              throws org.xmlpull.v1.XmlPullParserException,
                                     IOException
Load the classes defined in the resource. When the class do not specify a namespace this is set to null. The classes do not be registered in the manager.

Parameters:
resource - , XML with the definition of dynamic classes.
loader - , loader used to load classes used in "classOfValue" in the resource.
Returns:
The Map of loaded dynamic classes
Throws:
org.xmlpull.v1.XmlPullParserException
IOException

importDynClassDefinitions

Map importDynClassDefinitions(org.xmlpull.v1.XmlPullParser parser,
                              ClassLoader loader,
                              String defaultNamespace)
                              throws org.xmlpull.v1.XmlPullParserException,
                                     IOException
Load the classes defined in the resource. When the class do not specify a namespace this is set to null. The classes do not be registered in the manager.

Parameters:
parser - , XML parser used in the definition of dynamic classes.
loader - , loader used to load classes used in "classOfValue" in the resource.
defaultNamespace - , namespace used in classes that do not specify a namespace in the resource.
Returns:
The Map of loaded dynamic classes
Throws:
org.xmlpull.v1.XmlPullParserException
IOException

add

void add(DynClass dynClass)
         throws DuplicateDynClassException
Añade la dynClass a la lista de clases registradas. Falla lanzando una excepcion si ya existe una clase registrada con ese nombre en ese namespace.

Parameters:
dynClass -
Throws:
DuplicateDynClassException

add

DynClass add(String name,
             String description)
Create and add to the manager a class with the name passed as parameter in the default namespace.

Parameters:
name -
description -
Returns:
the new class created.

add

DynClass add(String name)
Create and add to the manager a class with the name passed as parameter in the default namespace.

Parameters:
name -
description -
Returns:
the new class created.

remove

void remove(DynStruct dynClass)

get

DynClass get(String name)
Obtiene la clase asociado al nombre indicado. Si se indica un nombre con namespace la buscara en ese namespace. if not se usara el namespace por defecto.

Parameters:
name - , nombre de la clase que queremos obtener.
Returns:
la clase requerida.

get

DynClass get(String namespace,
             String name)
Obtiene el la clase asociado al nombre indicado dentro del namespace pedido.

Parameters:
name - , nombre de la clase que queremos obtener.
Returns:
la clase requerida.

has

boolean has(String name)
Comprueba si esta registrada una clase.

Returns:
true si la clase "name" esta registrada, false si no.

has

boolean has(String namespace,
            String name)
Comprueba si esta registrada una clase.

Returns:
true si la clase "name" esta registrada, false si no.

getCount

int getCount()
Return the count of registered DynClass.

Returns:
count of DynClass

iterator

Iterator iterator()
Return an iterator over all registered DynClass.

Returns:
the iterator.

iterator

Iterator iterator(String namespace)
Return an iterator over all registered DynClass with the same namespace.

Returns:
the iterator.

getNames

List getNames()
Return the list of names of all registered DynClass.

Returns:
list of DynClass names.

createDynObject

DynObject createDynObject(DynStruct dynStruct)
Create a new DynObject associated to the DynStruct or DynClass passed as parameter.

Parameters:
dynStruct - or dynClass to use for create the dynObject
Returns:
the new DynObject

createDynObject

DynObject createDynObject(String classname)
Crea un nuevo objeto asociandole como clase base la indicada que tiene el nombre indicado.

Parameters:
dynClassName -
Returns:
el nuevo DynObject

createDynObject

DynObject createDynObject(String namespace,
                          String classname)
Crea un nuevo objeto asociandole como clase base la indicada que tiene el nombre indicado.

Parameters:
dynClassName -
Returns:
el nuevo DynObject

consolide

void consolide()
Actualiza todas las DynClasses registradas para reflejar la herencia de forma adecuada.


registerDynMethod

int registerDynMethod(DynClass dynClass,
                      DynMethod dynMethod)
Register the method in the dynClass.

Parameters:
dynClass - class over the method is registred
dynMethod - method to registry
Returns:
unique code of method

registerDynMethod

int registerDynMethod(Class theClass,
                      DynMethod dynMethod)
Register the method in the class.

Parameters:
theClass - class over the method is registred
dynMethod - method to registry
Returns:
unique code of method

getDynMethod

DynMethod getDynMethod(DynObject dynObject,
                       int code)
                       throws DynMethodException
Obtain the method for the indicated code of the dynObject.

Parameters:
dynObject -
code - code of the requeted method
Returns:
the required DynMethod
Throws:
DynMethodException

getDynMethod

DynMethod getDynMethod(DynClass dynClass,
                       int code)
                       throws DynMethodException
Throws:
DynMethodException

getDynMethod

DynMethod getDynMethod(Object obj,
                       int code)
                       throws DynMethodException
Throws:
DynMethodException

getDynMethod

DynMethod getDynMethod(Class theClass,
                       int code)
                       throws DynMethodException
Throws:
DynMethodException

getDynMethod

DynMethod getDynMethod(int code)
                       throws DynMethodException
Throws:
DynMethodException

invokeDynMethod

Object invokeDynMethod(Object self,
                       int code,
                       DynObject context)
                       throws DynMethodException
Invoke the method of the indicated code for the object self, with parameters in context.

Parameters:
self - object over the method is invoked
code - code for the method to invoke
context - paramters of method
Returns:
return value for the method
Throws:
DynMethodException

validate

void validate(DynObject object)
              throws DynObjectValidateException
Throws:
DynObjectValidateException

getDefaultClassOfType

Class getDefaultClassOfType(int type)
Deprecated. use DataTypesManager.getDefaultClass


createDynObjectPagingHelper

DynObjectPagingHelper createDynObjectPagingHelper(DynObjectSet set)
                                                  throws BaseException
Creates a new DynObjectPagingHelper to page the data of a DynObjectSet.

Parameters:
set - to page the data of
Returns:
a DynObjectPagingHelper
Throws:
BaseException - if there is an error creating the paging helper, usually because of an error getting the data of the DynObjectSet

createDynObjectPagingHelper

DynObjectPagingHelper createDynObjectPagingHelper(DynObjectSet set,
                                                  int pageSize)
                                                  throws BaseException
Creates a new DynObjectPagingHelper to page the data of a DynObjectSet.

Parameters:
set - to page the data of
pageSize - the size of the page to load using the helper
Returns:
a DynObjectPagingHelper
Throws:
BaseException - if there is an error creating the paging helper, usually because of an error getting the data of the DynObjectSet

createDynClassName

DynClassName createDynClassName(String namespace,
                                String name)
Creates a DynClassName with a DynClass name and its namespace.

Parameters:
namespace - where the DynClass belongs to
name - of the DynClass
Returns:
a new DynClassName

createDynClassName

DynClassName createDynClassName(String name)
Creates a DynClassName with a DynClass name or fullname

Parameters:
name - of the DynClass. It might be a simple name or a composed full name (namespace and name)
Returns:
a new DynClassName


Copyright © 2004-2011 gvSIG. All Rights Reserved.