|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.persistence.EntityRegistry
The EntityRegistry can be used to collect frequently occuring
Attribute's when it comes to storing them in XML
documents. Every Attribute that appears multiple times can be
replaced with a short reference to an entity. Method
getEntitiesForDTD() returns the needed the Entity definitions
needed for the corresponding XML document.
| Method Summary | |
void |
addCandidate(Attribute attribute,
java.lang.String entityName)
Adds an Attribute as a possible candidate for XML write out
to this registry. |
void |
addCandidate(java.lang.String name)
|
void |
addCollectionAsCandidate(Attribute topLevelAttribute,
java.lang.String entityName)
Add an attribute holding an AttributeCollection with depth 1
to the list of entity candidates.
|
void |
checkCandidate(Attribute attribute)
|
void |
checkCandidates(AttributeCollection attributes)
|
static void |
destroy()
Explicitly kill this instance, so that the GC can do his work. |
void |
dump()
Dumps out the content of the entity pool. |
static boolean |
getEnabled()
Returns true, if the the accumulation of entities is
enabled. |
java.lang.String |
getEntitiesForDTD()
Returns the entity definitions. |
java.lang.String |
getEntityName(Attribute attribute)
Returns the entity name for the given Attribute. |
static EntityRegistry |
getInstance()
Returns an instance of the EntityRegistry. |
boolean |
isEmpty()
Indicates whether the pool for entities is empty. |
boolean |
isEntity(Attribute attribute)
Returns true, if the given Attribute is an
Entity. |
static void |
setEnabled(boolean b)
En- / disables the accumulation of entities globally. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static EntityRegistry getInstance()
EntityRegistry.
EntityRegistry.public static void destroy()
public void addCandidate(Attribute attribute,
java.lang.String entityName)
Attribute as a possible candidate for XML write out
to this registry. The entity declaration for this Attribute will get the
name given by entityName.
attribute - the Attribute to add.entityName - a name for this Entity.
public void addCollectionAsCandidate(Attribute topLevelAttribute,
java.lang.String entityName)
AttributeCollection with depth 1
to the list of entity candidates.
AttributeCollection with depth 1 will
be accepted.
topLevelAttribute - the top-level attribute holding the
AttributeSet or AttributeList.entityName - a name for this Entity.public boolean isEntity(Attribute attribute)
true, if the given Attribute is an
Entity. An Attribute is supposed to be an entity if it's in
the map more than twice.
attribute - the Attribute to look up.
true, if the given Attribute is an
Entity.public java.lang.String getEntityName(Attribute attribute)
Attribute. This
method is needed during write out replacement of Attributes.
attribute - the Attribute to look up the name for.
Attribute.public java.lang.String getEntitiesForDTD()
public boolean isEmpty()
true, if the entity pool is empty.public static void setEnabled(boolean b)
b - true enables the accumulation of entities.public static boolean getEnabled()
true, if the the accumulation of entities is
enabled.
true, if the the accumulation of entities is
enabled.public void dump()
public void addCandidate(java.lang.String name)
public void checkCandidate(Attribute attribute)
public void checkCandidates(AttributeCollection attributes)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||