Humboldt Alignment Editor 2.5.0

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

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.service.entity.internal.EntityDefinitionServiceDecorator
All Implemented Interfaces:
EntityDefinitionService
Direct Known Subclasses:
EntityDefinitionServiceUndoSupport

public class EntityDefinitionServiceDecorator
extends Object
implements EntityDefinitionService

Entity definition service decorator.

Author:
Kai Schwierczek

Field Summary
protected  EntityDefinitionService entityDefinitionService
          The decorated entity definition service.
 
Constructor Summary
EntityDefinitionServiceDecorator(EntityDefinitionService entityDefinitionService)
          Create a decorator for 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.
 void addListener(EntityDefinitionServiceListener listener)
          Adds a listener to the service
 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.
 Collection<? extends EntityDefinition> getChildren(EntityDefinition entity)
          Get the children of the given entity definition, i.e.
 EntityDefinition getParent(EntityDefinition entity)
          Get the parent entity definition for the given entity definition.
 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).
 void removeListener(EntityDefinitionServiceListener listener)
          Removes a listener from the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityDefinitionService

protected EntityDefinitionService entityDefinitionService
The decorated entity definition service.

Constructor Detail

EntityDefinitionServiceDecorator

public EntityDefinitionServiceDecorator(EntityDefinitionService entityDefinitionService)
Create a decorator for the entity definition service.

Parameters:
entityDefinitionService - the entity definition service
Method Detail

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.

Specified by:
getChildren in interface EntityDefinitionService
Parameters:
entity - the entity definition
Returns:
the collection of child entity definitions
See Also:
EntityDefinitionService.getChildren(eu.esdihumboldt.hale.common.align.model.EntityDefinition)

getTypeEntities

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

Specified by:
getTypeEntities in interface EntityDefinitionService
Parameters:
type - the type definition
schemaSpace - the type schema space
Returns:
the type entities
See Also:
EntityDefinitionService.getTypeEntities(eu.esdihumboldt.hale.common.schema.model.TypeDefinition, eu.esdihumboldt.hale.common.schema.SchemaSpaceID)

getParent

public EntityDefinition getParent(EntityDefinition entity)
Description copied from interface: EntityDefinitionService
Get the parent entity definition for the given entity definition.

Specified by:
getParent in interface EntityDefinitionService
Parameters:
entity - the entity definition
Returns:
the parent entity definition or null if the given entity definition represents a type
See Also:
EntityDefinitionService.getParent(eu.esdihumboldt.hale.common.align.model.EntityDefinition)

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.

Specified by:
addNamedContext in interface EntityDefinitionService
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(eu.esdihumboldt.hale.common.align.model.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.

Specified by:
addIndexContext in interface EntityDefinitionService
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(eu.esdihumboldt.hale.common.align.model.EntityDefinition, java.lang.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.

Specified by:
addConditionContext in interface EntityDefinitionService
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(eu.esdihumboldt.hale.common.align.model.EntityDefinition, eu.esdihumboldt.hale.common.instance.model.Filter)

removeContext

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

Specified by:
removeContext in interface EntityDefinitionService
Parameters:
entity - the entity definition or null if creating an instance context is not possible FIXME report success/failure?
See Also:
EntityDefinitionService.removeContext(eu.esdihumboldt.hale.common.align.model.EntityDefinition)

addListener

public void addListener(EntityDefinitionServiceListener listener)
Description copied from interface: EntityDefinitionService
Adds a listener to the service

Specified by:
addListener in interface EntityDefinitionService
Parameters:
listener - the listener to add
See Also:
EntityDefinitionService.addListener(eu.esdihumboldt.hale.ui.service.entity.EntityDefinitionServiceListener)

removeListener

public void removeListener(EntityDefinitionServiceListener listener)
Description copied from interface: EntityDefinitionService
Removes a listener from the service

Specified by:
removeListener in interface EntityDefinitionService
Parameters:
listener - the listener to remove
See Also:
EntityDefinitionService.removeListener(eu.esdihumboldt.hale.ui.service.entity.EntityDefinitionServiceListener)

Humboldt Alignment Editor 2.5.0

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