public class DefaultDynObjectManager extends java.lang.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(java.lang.String name)
Create and add to the manager a class with the name
passed as parameter in the default namespace.
|
DynClass |
add(java.lang.String name,
java.lang.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_v2 |
createCopy(DynClass source) |
DynClass_v2 |
createDynClass(java.lang.String name,
java.lang.String description)
Create a instance of DynClass with the name and description
Indicated as parameters.
|
DynClass_v2 |
createDynClass(java.lang.String namespace,
java.lang.String name,
java.lang.String description)
Create a instance of DynClass with the name and description
Indicated as parameters.
|
DynClassName |
createDynClassName(java.lang.String name)
Creates a
DynClassName with a DynClass
name or fullname |
DynClassName |
createDynClassName(java.lang.String namespace,
java.lang.String name)
Creates a
DynClassName with a DynClass
name and its namespace. |
DynField_v2 |
createDynField(java.lang.String name) |
DynObject |
createDynObject(DynStruct dynClass)
Create a new DynObject associated to the DynStruct or DynClass
passed as parameter.
|
DynObject |
createDynObject(java.lang.String dynClassName)
Crea un nuevo objeto asociandole como clase base la indicada que tiene el
nombre indicado.
|
DynObject |
createDynObject(java.lang.String dynClassName,
java.lang.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() |
boolean |
equals(DynObject obj1,
DynObject obj2) |
java.lang.String |
exportSimpleDynClassDefinitions(DynClass dynClass) |
void |
exportSimpleDynClassDefinitions(java.io.File out,
DynClass dynClass) |
void |
exportSimpleDynClassDefinitions(java.io.OutputStream out,
DynClass dynClass) |
DynClass |
get(DynClass[] superClasses) |
DynClass |
get(java.lang.String theName)
Obtiene la clase asociado al nombre indicado.
|
DynClass |
get(java.lang.String namespace,
java.lang.String name)
Obtiene el la clase asociado al nombre indicado dentro del
namespace pedido.
|
java.lang.Object |
getAttributeValue(java.lang.Object obj,
java.lang.String name) |
int |
getCount()
Return the count of registered DynClass.
|
java.lang.Class |
getDefaultClassOfType(int type) |
DynMethod |
getDynMethod(java.lang.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(java.lang.Object obj,
int code) |
DynMethod |
getDynMethod(java.lang.String methodName)
Retrieve an anonimous method registered in the manager.
|
int |
getDynMethodCode(java.lang.Class theClass,
java.lang.String methodName) |
int |
getDynMethodCode(DynClass dynClass,
java.lang.String methodName) |
static DefaultDynObjectManager |
getManager() |
java.util.List |
getNames()
Return the list of names of all registered DynClass.
|
UnmodifiableBasicMap<java.lang.String,DynField> |
getTags() |
boolean |
has(java.lang.String name)
Comprueba si esta registrada una clase.
|
boolean |
has(java.lang.String namespace,
java.lang.String name)
Comprueba si esta registrada una clase.
|
int |
hashCode(DynObject obj) |
java.util.Map |
importDynClassDefinitions(java.io.InputStream resource,
java.lang.ClassLoader loader)
Load the classes defined in the resource.
|
java.util.Map |
importDynClassDefinitions(XmlPullParser parser,
java.lang.ClassLoader loader,
java.lang.String defaultNamespace)
Load the classes defined in the resource and return a Map
with its.
|
java.lang.Object |
invokeDynMethod(java.lang.Object self,
int code,
DynObject context)
Invoke the method of the indicated code for the object self, with
parameters in context.
|
java.util.Iterator |
iterator()
Return an iterator over all registered DynClass.
|
java.util.Iterator |
iterator(java.lang.String nameSpace)
Return an iterator over all registered DynClass with the same namespace.
|
int |
registerDynMethod(java.lang.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.
|
DynField |
registerTag(java.lang.String name,
java.lang.String description) |
DynField |
registerTag(java.lang.String name,
java.lang.String description,
DynMethod valuesMethod) |
DynField |
registerTag(java.lang.String name,
java.lang.String description,
java.lang.String[] values) |
void |
remove(DynStruct dynClass) |
void |
setAttributeValue(java.lang.Object obj,
java.lang.String name,
java.lang.Object value) |
void |
validate(DynObject object) |
public static DefaultDynObjectManager getManager()
public DynClass_v2 createDynClass(java.lang.String name, java.lang.String description)
DynObjectManager
createDynClass
in interface DynObjectManager
name
- , the name used for DynClass name.description
- , the description associated to the
new DynClass.public DynClass_v2 createDynClass(java.lang.String namespace, java.lang.String name, java.lang.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(java.lang.String name, java.lang.String description)
DynObjectManager
add
in interface DynObjectManager
public DynClass add(java.lang.String name)
DynObjectManager
add
in interface DynObjectManager
public void remove(DynStruct dynClass)
remove
in interface DynObjectManager
public DynClass get(java.lang.String theName)
DynObjectManager
get
in interface DynObjectManager
theName
- , nombre de la clase que queremos obtener.public DynClass get(java.lang.String namespace, java.lang.String name)
DynObjectManager
get
in interface DynObjectManager
name
- , nombre de la clase que queremos obtener.public int getCount()
DynObjectManager
getCount
in interface DynObjectManager
public java.util.List getNames()
DynObjectManager
getNames
in interface DynObjectManager
public boolean has(java.lang.String name)
DynObjectManager
has
in interface DynObjectManager
public boolean has(java.lang.String namespace, java.lang.String name)
DynObjectManager
has
in interface DynObjectManager
public java.util.Iterator iterator()
DynObjectManager
iterator
in interface DynObjectManager
public DynObject createDynObject(java.lang.String dynClassName)
DynObjectManager
createDynObject
in interface DynObjectManager
public DynObject createDynObject(java.lang.String dynClassName, java.lang.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(java.lang.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 java.lang.Object invokeDynMethod(java.lang.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, java.lang.String methodName) throws DynMethodException
DynMethodException
public int getDynMethodCode(java.lang.Class theClass, java.lang.String methodName) throws DynMethodException
DynMethodException
public DynMethod getDynMethod(int code) throws DynMethodException
getDynMethod
in interface DynObjectManager
DynMethodException
public DynMethod getDynMethod(java.lang.String methodName) throws DynMethodException
DynObjectManager
getDynMethod
in interface DynObjectManager
methodName
- name of the requeted methodDynMethodException
public DynMethod getDynMethod(java.lang.Object obj, int code) throws DynMethodException
getDynMethod
in interface DynObjectManager
DynMethodException
public DynMethod getDynMethod(java.lang.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 java.lang.Class getDefaultClassOfType(int type)
getDefaultClassOfType
in interface DynObjectManager
public java.lang.String exportSimpleDynClassDefinitions(DynClass dynClass)
exportSimpleDynClassDefinitions
in interface DynObjectManager
public void exportSimpleDynClassDefinitions(java.io.File out, DynClass dynClass) throws java.io.FileNotFoundException
exportSimpleDynClassDefinitions
in interface DynObjectManager
java.io.FileNotFoundException
public void exportSimpleDynClassDefinitions(java.io.OutputStream out, DynClass dynClass)
exportSimpleDynClassDefinitions
in interface DynObjectManager
public java.util.Map importDynClassDefinitions(java.io.InputStream resource, java.lang.ClassLoader loader) throws XmlPullParserException, java.io.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
java.io.IOException
public java.util.Map importDynClassDefinitions(XmlPullParser parser, java.lang.ClassLoader loader, java.lang.String defaultNamespace) throws XmlPullParserException, java.io.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
java.io.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(java.lang.String namespace, java.lang.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(java.lang.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 java.util.Iterator iterator(java.lang.String nameSpace)
DynObjectManager
iterator
in interface DynObjectManager
public java.lang.Object getAttributeValue(java.lang.Object obj, java.lang.String name)
getAttributeValue
in interface DynObjectManager
public void setAttributeValue(java.lang.Object obj, java.lang.String name, java.lang.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 boolean equals(DynObject obj1, DynObject obj2)
equals
in interface DynObjectManager
public int hashCode(DynObject obj)
hashCode
in interface DynObjectManager
public void clear(DynObject obj)
clear
in interface DynObjectManager
public DynField_v2 createDynField(java.lang.String name)
createDynField
in interface DynObjectManager
public DynClass_v2 createCopy(DynClass source)
createCopy
in interface DynObjectManager
public UnmodifiableBasicMap<java.lang.String,DynField> getTags()
getTags
in interface DynObjectManager
public DynField registerTag(java.lang.String name, java.lang.String description)
registerTag
in interface DynObjectManager
public DynField registerTag(java.lang.String name, java.lang.String description, java.lang.String[] values)
registerTag
in interface DynObjectManager
public DynField registerTag(java.lang.String name, java.lang.String description, DynMethod valuesMethod)
registerTag
in interface DynObjectManager