public class DefaultDynObjectManager extends Object implements DynObjectManager
DynObjectManager
implementation.DYNCLASS_NAME_SEPARATOR, NULLCODE
Constructor and Description |
---|
DefaultDynObjectManager() |
Modifier and Type | Method and Description |
---|---|
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 |
clear(DynObject obj) |
void |
consolide()
Actualiza todas las DynClasses registradas para reflejar la
herencia de forma adecuada.
|
void |
copy(DynObject source,
DynObject target) |
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. |
DynField |
createDynField(String name) |
DynObject |
createDynObject(DynStruct dynClass)
Create a new DynObject associated to the DynStruct or DynClass
passed as parameter.
|
DynObject |
createDynObject(String dynClassName)
Crea un nuevo objeto asociandole como clase base la indicada que tiene el
nombre indicado.
|
DynObject |
createDynObject(String dynClassName,
String namespace)
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 . |
DynObjectEncoder |
createSimpleDynObjectEncoder() |
String |
exportSimpleDynClassDefinitions(DynClass dynClass) |
void |
exportSimpleDynClassDefinitions(File out,
DynClass dynClass) |
void |
exportSimpleDynClassDefinitions(OutputStream out,
DynClass dynClass) |
DynClass |
get(DynClass[] superClasses) |
DynClass |
get(String theName)
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.
|
Object |
getAttributeValue(Object obj,
String name) |
int |
getCount()
Return the count of registered DynClass.
|
Class |
getDefaultClassOfType(int type) |
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) |
DynMethod |
getDynMethod(String methodName)
Retrieve an anonimous method registered in the manager.
|
int |
getDynMethodCode(Class theClass,
String methodName) |
int |
getDynMethodCode(DynClass dynClass,
String methodName) |
static DefaultDynObjectManager |
getManager() |
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(XmlPullParser parser,
ClassLoader loader,
String defaultNamespace)
Load the classes defined in the resource and return a Map
with its.
|
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.
|
int |
registerDynMethod(DynMethod dynMethod)
Register an anonimous method.
|
void |
remove(DynStruct dynClass) |
void |
setAttributeValue(Object obj,
String name,
Object value) |
void |
validate(DynObject object) |
public static DefaultDynObjectManager getManager()
public DynClass createDynClass(String name, String description)
DynObjectManager
createDynClass
in interface DynObjectManager
name
- , the name used for DynClass name.description
- , the description associated to the
new DynClass.public DynClass createDynClass(String namespace, String name, String description)
DynObjectManager
createDynClass
in interface DynObjectManager
namespace
- , the namespace used for the new DynClass.name
- , the name used for the new DynClass.description
- , the description associated to the
new DynClass.public void add(DynClass dynClass)
DynObjectManager
add
in interface DynObjectManager
public DynClass add(String name, String description)
DynObjectManager
add
in interface DynObjectManager
public DynClass add(String name)
DynObjectManager
add
in interface DynObjectManager
public void remove(DynStruct dynClass)
remove
in interface DynObjectManager
public DynClass get(String theName)
DynObjectManager
get
in interface DynObjectManager
theName
- , nombre de la clase que queremos obtener.public DynClass get(String namespace, String name)
DynObjectManager
get
in interface DynObjectManager
name
- , nombre de la clase que queremos obtener.public int getCount()
DynObjectManager
getCount
in interface DynObjectManager
public List getNames()
DynObjectManager
getNames
in interface DynObjectManager
public boolean has(String name)
DynObjectManager
has
in interface DynObjectManager
public boolean has(String namespace, String name)
DynObjectManager
has
in interface DynObjectManager
public Iterator iterator()
DynObjectManager
iterator
in interface DynObjectManager
public DynObject createDynObject(String dynClassName)
DynObjectManager
createDynObject
in interface DynObjectManager
public DynObject createDynObject(String dynClassName, String namespace)
DynObjectManager
createDynObject
in interface DynObjectManager
public DynObject createDynObject(DynStruct dynClass)
DynObjectManager
createDynObject
in interface DynObjectManager
dynClass
- or dynClass to use for create the dynObjectpublic void consolide()
DynObjectManager
consolide
in interface DynObjectManager
public int registerDynMethod(DynClass dynClass, DynMethod dynMethod)
DynObjectManager
registerDynMethod
in interface DynObjectManager
dynClass
- class over the method is registreddynMethod
- method to registrypublic int registerDynMethod(Class theClass, DynMethod dynMethod)
DynObjectManager
registerDynMethod
in interface DynObjectManager
theClass
- class over the method is registreddynMethod
- method to registrypublic int registerDynMethod(DynMethod dynMethod)
DynObjectManager
registerDynMethod
in interface DynObjectManager
dynMethod
- method to registrypublic Object invokeDynMethod(Object self, int code, DynObject context) throws DynMethodException
DynObjectManager
invokeDynMethod
in interface DynObjectManager
self
- object over the method is invokedcode
- code for the method to invokecontext
- paramters of methodDynMethodException
public int getDynMethodCode(DynClass dynClass, String methodName) throws DynMethodException
DynMethodException
public int getDynMethodCode(Class theClass, String methodName) throws DynMethodException
DynMethodException
public DynMethod getDynMethod(int code) throws DynMethodException
getDynMethod
in interface DynObjectManager
DynMethodException
public DynMethod getDynMethod(String methodName) throws DynMethodException
DynObjectManager
getDynMethod
in interface DynObjectManager
methodName
- name of the requeted methodDynMethodException
public DynMethod getDynMethod(Object obj, int code) throws DynMethodException
getDynMethod
in interface DynObjectManager
DynMethodException
public DynMethod getDynMethod(Class theClass, int code) throws DynMethodException
getDynMethod
in interface DynObjectManager
DynMethodException
public DynMethod getDynMethod(DynClass dynClass, int code) throws DynMethodException
getDynMethod
in interface DynObjectManager
DynMethodException
public DynMethod getDynMethod(DynObject dynObject, int code) throws DynMethodException
DynObjectManager
getDynMethod
in interface DynObjectManager
code
- code of the requeted methodDynMethodException
public void validate(DynObject object)
validate
in interface DynObjectManager
public Class getDefaultClassOfType(int type)
getDefaultClassOfType
in interface DynObjectManager
public String exportSimpleDynClassDefinitions(DynClass dynClass)
exportSimpleDynClassDefinitions
in interface DynObjectManager
public void exportSimpleDynClassDefinitions(File out, DynClass dynClass) throws FileNotFoundException
exportSimpleDynClassDefinitions
in interface DynObjectManager
FileNotFoundException
public void exportSimpleDynClassDefinitions(OutputStream out, DynClass dynClass)
exportSimpleDynClassDefinitions
in interface DynObjectManager
public Map importDynClassDefinitions(InputStream resource, ClassLoader loader) throws XmlPullParserException, IOException
DynObjectManager
importDynClassDefinitions
in interface DynObjectManager
resource
- , XML with the definition of dynamic
classes.loader
- , loader used to load classes used in
"classOfValue" in the resource.XmlPullParserException
IOException
public Map importDynClassDefinitions(XmlPullParser parser, ClassLoader loader, String defaultNamespace) throws XmlPullParserException, IOException
DynObjectManager
importDynClassDefinitions
in interface DynObjectManager
parser
- , 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.XmlPullParserException
IOException
public DynObjectPagingHelper createDynObjectPagingHelper(DynObjectSet set) throws BaseException
DynObjectManager
DynObjectPagingHelper
to page the data of a
DynObjectSet
.createDynObjectPagingHelper
in interface DynObjectManager
set
- to page the data ofDynObjectPagingHelper
BaseException
- if there is an error creating the paging helper, usually
because of an error getting the data of the
DynObjectSet
public DynObjectPagingHelper createDynObjectPagingHelper(DynObjectSet set, int pageSize) throws BaseException
DynObjectManager
DynObjectPagingHelper
to page the data of a
DynObjectSet
.createDynObjectPagingHelper
in interface DynObjectManager
set
- to page the data ofpageSize
- the size of the page to load using the helperDynObjectPagingHelper
BaseException
- if there is an error creating the paging helper, usually
because of an error getting the data of the
DynObjectSet
public DynClassName createDynClassName(String namespace, String name)
DynObjectManager
DynClassName
with a DynClass
name and its namespace.createDynClassName
in interface DynObjectManager
namespace
- where the DynClass
belongs toname
- of the DynClass
DynClassName
public DynClassName createDynClassName(String name)
DynObjectManager
DynClassName
with a DynClass
name or fullnamecreateDynClassName
in interface DynObjectManager
name
- of the DynClass
. It might be a simple name or a
composed full name (namespace and name)DynClassName
public Iterator iterator(String nameSpace)
DynObjectManager
iterator
in interface DynObjectManager
public Object getAttributeValue(Object obj, String name)
getAttributeValue
in interface DynObjectManager
public void setAttributeValue(Object obj, String name, Object value)
setAttributeValue
in interface DynObjectManager
public DynObjectEncoder createSimpleDynObjectEncoder()
createSimpleDynObjectEncoder
in interface DynObjectManager
public void copy(DynObject source, DynObject target)
copy
in interface DynObjectManager
public void clear(DynObject obj)
clear
in interface DynObjectManager
public DynField createDynField(String name)
createDynField
in interface DynObjectManager