com.bowstreet.generation
Interface GenElement


public interface GenElement

Container for constructing objects during regen. This is a recursive structure that can contain any number of GenElement children. Each entry holds a reference to a domain object. Entries are added here for two purposes: - This is the container for all constructed domain objects. Builders can add or find objects here. - The Designer knows how to display the tree of entries contained here. For each entry in a GenElement tree, there are these values maintained: - The name (unique ID) of the entry - The type (e.g. Page, Variable). - The domain object, which is type Object and is completely domain specific. - The builder Call ID of the builder that created the object. - A list of children GenElements.


Field Summary
static int[] ASSOCIATION_MAP
           
static int ASSODIR_BOTH
           
static int ASSODIR_NO_ARROW
          Appropriate values for 'direction' parameter in addAssociation
static int ASSODIR_SOURCE
           
static int ASSODIR_TARGET
           
static java.lang.String TYPE_MATCHALL
           
 
Method Summary
 void addAssociation(GenElement genElement, java.lang.String builderId, java.lang.String type, java.lang.String comment, int direction)
          Add an association between two GenElements.
 GenElement addChildDomainObject(java.lang.String type, java.lang.String objectName, BuilderCall builderCall, java.lang.String builderId, java.lang.Object obj)
          Add a new child Domain object.
 GenElement addChildElement(GenElement genElement)
          Add an existing GenElement as a child.
 void addExternalAssociation(com.bowstreet.generation.Association.ExternalAssociation association)
          Add an assoiaction to an external entity.
 void addModelEditorLayoutListener(IModelEditorLayoutListener listener)
          Adds a layout listener to this genElement
 void addModifierBuilderId(java.lang.String builderId)
          Add a BuilderID to the modifier list.
 java.util.Collection getAssociations()
          Get all the associations related to this GenElement
 BuilderCall getBuilderCall()
          Get the BuilderCall that created this GenElement.
 java.lang.String getBuilderId()
          Get the id of the Builder that created this GenElement.
 java.lang.Object getChildDomainObject(java.lang.String type, java.lang.String objectName)
          Get child domain object by type/name.
 java.util.Iterator getChildDomainObjects(java.lang.String type)
          Get the child domain objects with a specified type.
 GenElement getChildElement(java.lang.String type, java.lang.String objectName)
          Get a child GenElement by type/name.
 java.util.Collection getChildElements(java.lang.String type)
          Get the child Elements with a specified type.
 java.util.Collection getChildTypes()
          Get a list of strings types represented by all the children of this GenElement.
 java.lang.Object getDomainObject()
          Get the Domain Object.
 boolean getIsHidden()
          returns true if this element should be hidden in the UI
 java.util.Collection getModelEditorLayoutListeners()
          Get the layout listeners that have been added to this genElement
 java.util.Set getModifierBuilderIds()
          Get a list of the ids of the builders that have modified the DomainObject
 java.lang.String getName()
          Get the name of this entry.
 GenElement getParent()
          get the parent genElement.
 java.lang.String getSelector()
          get a selector string that identifies this GenElement
 java.lang.String getType()
          Get the type of this entry.
 java.lang.String getTypeForced()
          Get the type whether it is hidden or not.
 void internalAddAssociation(com.bowstreet.generation.Association association)
          Interfaces don't offer protected -- seems stupid.
 void removeChildElement(GenElement genElement)
          Removes this GenElement or one that "matches" it (i.e. same type and objectName)
 void removeChildElement(java.lang.String type, java.lang.String objectName)
          Remove the GenElement that you would find if you searched by this name and type.
 void setHiddenType(java.lang.String type)
          Set a type that will be hidden from getType and getChildTypes.
 void setIsHidden(boolean hidden)
          Set the state of whether or not this element should be hidden in the UI.
 

Field Detail

ASSOCIATION_MAP

static final int[] ASSOCIATION_MAP

ASSODIR_BOTH

static final int ASSODIR_BOTH
See Also:
Constant Field Values

ASSODIR_NO_ARROW

static final int ASSODIR_NO_ARROW
Appropriate values for 'direction' parameter in addAssociation

See Also:
Constant Field Values

ASSODIR_SOURCE

static final int ASSODIR_SOURCE
See Also:
Constant Field Values

ASSODIR_TARGET

static final int ASSODIR_TARGET
See Also:
Constant Field Values

TYPE_MATCHALL

static final java.lang.String TYPE_MATCHALL
See Also:
Constant Field Values
Method Detail

addAssociation

void addAssociation(GenElement genElement,
                    java.lang.String builderId,
                    java.lang.String type,
                    java.lang.String comment,
                    int direction)
Add an association between two GenElements. This will create a bi-directional association.

Parameters:
genElement - the GenElement to association this one to -- if null this call will be a nop
builderId - the BuilderCall making this association
type - Type of association -- interpreted to the graphical representation
comment - Additional text about the association
direction - which ends have arrow heads.

addChildDomainObject

GenElement addChildDomainObject(java.lang.String type,
                                java.lang.String objectName,
                                BuilderCall builderCall,
                                java.lang.String builderId,
                                java.lang.Object obj)
Add a new child Domain object.


addChildElement

GenElement addChildElement(GenElement genElement)
Add an existing GenElement as a child.


addExternalAssociation

void addExternalAssociation(com.bowstreet.generation.Association.ExternalAssociation association)
Add an assoiaction to an external entity.

Parameters:
association -

addModelEditorLayoutListener

void addModelEditorLayoutListener(IModelEditorLayoutListener listener)
Adds a layout listener to this genElement

Parameters:
listener -

addModifierBuilderId

void addModifierBuilderId(java.lang.String builderId)
Add a BuilderID to the modifier list.

Parameters:
builderId -

getAssociations

java.util.Collection getAssociations()
Get all the associations related to this GenElement

Returns:
colllection of Association objects

getBuilderCall

BuilderCall getBuilderCall()
Get the BuilderCall that created this GenElement. The BuilderCall is only available when running in the designer.


getBuilderId

java.lang.String getBuilderId()
Get the id of the Builder that created this GenElement.


getChildDomainObject

java.lang.Object getChildDomainObject(java.lang.String type,
                                      java.lang.String objectName)
Get child domain object by type/name.


getChildDomainObjects

java.util.Iterator getChildDomainObjects(java.lang.String type)
Get the child domain objects with a specified type.


getChildElement

GenElement getChildElement(java.lang.String type,
                           java.lang.String objectName)
Get a child GenElement by type/name.


getChildElements

java.util.Collection getChildElements(java.lang.String type)
Get the child Elements with a specified type.


getChildTypes

java.util.Collection getChildTypes()
Get a list of strings types represented by all the children of this GenElement.


getDomainObject

java.lang.Object getDomainObject()
Get the Domain Object.


getIsHidden

boolean getIsHidden()
returns true if this element should be hidden in the UI


getModelEditorLayoutListeners

java.util.Collection getModelEditorLayoutListeners()
Get the layout listeners that have been added to this genElement

Returns:
Collection

getModifierBuilderIds

java.util.Set getModifierBuilderIds()
Get a list of the ids of the builders that have modified the DomainObject

Returns:
Set of Strings

getName

java.lang.String getName()
Get the name of this entry.


getParent

GenElement getParent()
get the parent genElement. null if no parent


getSelector

java.lang.String getSelector()
get a selector string that identifies this GenElement


getType

java.lang.String getType()
Get the type of this entry.


getTypeForced

java.lang.String getTypeForced()
Get the type whether it is hidden or not.


internalAddAssociation

void internalAddAssociation(com.bowstreet.generation.Association association)
Interfaces don't offer protected -- seems stupid. Anyway, this is only to be used by implementations of this Interface. It will make half of the association.

Parameters:
association - The association to add

removeChildElement

void removeChildElement(GenElement genElement)
Removes this GenElement or one that "matches" it (i.e. same type and objectName)


removeChildElement

void removeChildElement(java.lang.String type,
                        java.lang.String objectName)
Remove the GenElement that you would find if you searched by this name and type.


setHiddenType

void setHiddenType(java.lang.String type)
Set a type that will be hidden from getType and getChildTypes.

Parameters:
type -

setIsHidden

void setIsHidden(boolean hidden)
Set the state of whether or not this element should be hidden in the UI.

Parameters:
hidden - true to hide it.


Copyright © 2009 IBM. All Rights Reserved.