Module entity_data :: Class Centities
[hide private]
[frames] | no frames]

Class Centities

source code

This class encapsulates the entity layer in KAF/NAF

Instance Methods [hide private]
 
__get_entity_nodes(self) source code
 
__init__(self, node=None, type='NAF')
Constructor of the object
source code
Centity
__iter__(self)
Iterator that returns the entities of the layer
source code
 
__str__(self) source code
 
add_entity(self, ent) source code
 
add_external_reference_to_entity(self, entity_id, ext_ref)
Adds an external reference to a entity specified by the entity identifier
source code
Centity
get_entity(self, entity_id)
Returns the entity object for the given entity identifier
source code
xml Element
get_node(self)
Returns the node of the element
source code
 
to_kaf(self)
Converts the layer from KAF to NAF
source code
 
to_naf(self)
Converts the layer from NAF to KAF
source code
Method Details [hide private]

__init__(self, node=None, type='NAF')
(Constructor)

source code 

Constructor of the object

Parameters:
  • node (xml Element or None (to create and empty one)) - this is the node of the element. If it is None it will create a new object
  • type (string) - the type of the object (KAF or NAF)

__iter__(self)

source code 

Iterator that returns the entities of the layer

Returns: Centity
list of entities (iterator)

add_external_reference_to_entity(self, entity_id, ext_ref)

source code 

Adds an external reference to a entity specified by the entity identifier

Parameters:
  • entity_id (string) - the entity identifier
  • ext_ref (CexternalReference) - the external reference

get_entity(self, entity_id)

source code 

Returns the entity object for the given entity identifier

Parameters:
  • entity_id (string) - the token identifier
Returns: Centity
the entity object

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element