Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.service.entity.internal
Class EntityDefinitionServiceImpl

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.service.entity.internal.AbstractEntityDefinitionService
      extended by eu.esdihumboldt.hale.ui.service.entity.internal.EntityDefinitionServiceImpl
All Implemented Interfaces:
EntityDefinitionService

public class EntityDefinitionServiceImpl
extends AbstractEntityDefinitionService

Manages instance contexts and the corresponding entity definitions.

Since:
2.5
Author:
Simon Templer

Constructor Summary
EntityDefinitionServiceImpl(AlignmentService alignmentService, ProjectService projectService)
          Create the entity definition service
 
Method Summary
 EntityDefinition addConditionContext(EntityDefinition sibling, Filter filter)
          Add a new condition context for the given entity definition and create a new sibling associated to the new context.
 EntityDefinition addIndexContext(EntityDefinition sibling, Integer index)
          Add a new index context for the given entity definition and create a new sibling associated to the new context.
protected  void addMissingContexts(Iterable<? extends Cell> cells)
          Add missing contexts for the given cells
 EntityDefinition addNamedContext(EntityDefinition sibling)
          Add a new named instance context for the given entity definition and create a new sibling associated to the new context.
protected  void clean()
          Remove all defined contexts
 Collection<? extends EntityDefinition> getChildren(EntityDefinition entity)
          Get the children of the given entity definition, i.e.
 Collection<? extends TypeEntityDefinition> getTypeEntities(TypeDefinition type, SchemaSpaceID schemaSpace)
          Get all available entity definitions for a given type.
 void removeContext(EntityDefinition entity)
          Remove the instance context associated with the given entity definition (if possible).
 
Methods inherited from class eu.esdihumboldt.hale.ui.service.entity.internal.AbstractEntityDefinitionService
addListener, createEntity, getParent, notifyContextAdded, notifyContextRemoved, notifyContextsAdded, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityDefinitionServiceImpl

public EntityDefinitionServiceImpl(AlignmentService alignmentService,
                                   ProjectService projectService)
Create the entity definition service

Parameters:
alignmentService - the alignment service
projectService - the project service
Method Detail

clean

protected void clean()
Remove all defined contexts


addNamedContext

public EntityDefinition addNamedContext(EntityDefinition sibling)
Description copied from interface: EntityDefinitionService
Add a new named instance context for the given entity definition and create a new sibling associated to the new context.

Parameters:
sibling - the entity definition which is a sibling of the entity definition to create
Returns:
the entity definition associated to the new instance context
See Also:
EntityDefinitionService.addNamedContext(EntityDefinition)

addIndexContext

public EntityDefinition addIndexContext(EntityDefinition sibling,
                                        Integer index)
Description copied from interface: EntityDefinitionService
Add a new index context for the given entity definition and create a new sibling associated to the new context.

Parameters:
sibling - the entity definition which is a sibling of the entity definition to create
index - the property index associated to the context, if null will be determined automatically
Returns:
the entity definition associated to the index context
See Also:
EntityDefinitionService.addIndexContext(EntityDefinition, Integer)

addConditionContext

public EntityDefinition addConditionContext(EntityDefinition sibling,
                                            Filter filter)
Description copied from interface: EntityDefinitionService
Add a new condition context for the given entity definition and create a new sibling associated to the new context.

Parameters:
sibling - the entity definition which is a sibling of the entity definition to create
filter - the condition filter
Returns:
the entity definition associated to the index context
See Also:
EntityDefinitionService.addConditionContext(EntityDefinition, Filter)

getTypeEntities

public Collection<? extends TypeEntityDefinition> getTypeEntities(TypeDefinition type,
                                                                  SchemaSpaceID schemaSpace)
Description copied from interface: EntityDefinitionService
Get all available entity definitions for a given type.

Parameters:
type - the type definition
schemaSpace - the type schema space
Returns:
the type entities
See Also:
EntityDefinitionService.getTypeEntities(TypeDefinition, SchemaSpaceID)

addMissingContexts

protected void addMissingContexts(Iterable<? extends Cell> cells)
Add missing contexts for the given cells

Parameters:
cells - the cells

removeContext

public void removeContext(EntityDefinition entity)
Description copied from interface: EntityDefinitionService
Remove the instance context associated with the given entity definition (if possible).

Parameters:
entity - the entity definition or null if creating an instance context is not possible FIXME report success/failure?
See Also:
EntityDefinitionService.removeContext(EntityDefinition)

getChildren

public Collection<? extends EntityDefinition> getChildren(EntityDefinition entity)
Description copied from interface: EntityDefinitionService
Get the children of the given entity definition, i.e. its properties and groups for each of the corresponding instance contexts.

Parameters:
entity - the entity definition
Returns:
the collection of child entity definitions
See Also:
EntityDefinitionService.getChildren(EntityDefinition)

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d