Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.poseidon.uml.model_management

Class AccessorMethodsHelper

com.gentleware.poseidon.uml.model_management.AccessorMethodsHelper

public final class AccessorMethodsHelper


Helper class to handle accessor methods for attributes. It is necessary as the creation of attributes, say, is distributed (copied) over PropPanelClassifier and PropPanelAttribute, but the reflection-way of doing things in the PropPanels requires methods to be in both PropPanels themselves.

Also, a delegate of this class listens to name changes of attributes and notifies the appropriate operations. Therefore, all creations and deletions of 'accessor' type dependencies must happen here!


 Attribute Summary
private static final int[]  CREATE_DEFAULT_ACCESSORS_TYPES
 
private String  confirmDeleteMessage
Lazy init. 
private String  confirmTitle
Lazy init. 
arrow_up
 

 Association Summary
private MethodBodyReplaceStrategy  _methodBodyReplaceStrategy
 
private OperationModellerIF  _modeller
This class produces an operation as Java string, if it is not null. 
private UmlProject  _project
 
arrow_up
 

 Constructor Summary
public   AccessorMethodsHelper(UmlProject project)
 
arrow_up
 

 Method Summary
public void   addCommandCreateAccessorAdder(SmId accessorSmId, SmId operationSmId, Attribute attr, MacroCommand createOperationCommand)
Create a method that add an attribute and is editable. 
public void   addCommandCreateAccessorGetter(SmId accessordependencySmId, SmId operationSmId, Attribute attribute, MacroCommand createOperationCommand)
Create a method that get the attribute and is editable. 
private static void   addCommandCreateAccessorOperation(SmId operationSmId, SmId accessorDependencySmId, Attribute attribute, int type, MacroCommand createOperationCommand)
Create a commands to create an accessor operation for the attribute, according to the type (setter, getter, ...). 
public void   addCommandCreateAccessorRemover(SmId accessorDependencySmId, SmId operationSmId, Attribute attribute, MacroCommand createOperationCommand)
Create a method that Removes an attribute and is editable. 
public void   addCommandCreateAccessorSetter(SmId accessorSmId, SmId operationSmId, Attribute attr, MacroCommand createOperationCommand)
Create a method that set the attribute and is editable. 
public void   addCommandCreateAccessorSingleGetter(SmId accessorDependencySmId, SmId operationSmId, Attribute attribute, MacroCommand createOperationCommand)
Create a method that get a single attribute and is editable. 
public static boolean   confirmCopyJavadoc(Operation operation)
The parameters may not be null. 
public static boolean   confirmCopyJavadoc(Collection operations)
 
public boolean   confirmOperationDeletion(List opNames)
Give a List of Strings naming the operations that are about to be deleted. 
public boolean   confirmReplaceOperation(List attributes)
Give a List of Strings naming the operations that are about to be deleted. 
public void   copyDownJavadoc(Operation op, Attribute accessed)
 
public Attribute   createAttribute(List opsIdList, SmId attributeId, Classifier owner, List smIdList)
Creates a new attribute, and accessors to that, if necessary. 
public Attribute   createAttribute(List opsIdLsit, SmId smid, List smIdList, Classifier owner, boolean invertAccessorGenerationPolicy)
Creates a new attribute, and accessors to that, if necessary. 
public void   createDefaultAccessors(List operationSmIds, List dependencySmIds, Attribute attr)
Create methods that get and set the attribute and are editable. 
public void   createDependency(SmId dependencyId, Attribute attr, Operation op)
Creates a dependency between the parameters. 
public void   createDependency(SmId newDependencyId, Attribute attr, Operation op, boolean overrideConfiguration, boolean keepJavadoc)
Creates a dependency between the parameters. 
public void   deleteAccessorProperty(Operation op)
Removes the accessor dependency from an operation, asks the user if the configuration demands it. 
public void   deleteAccessorProperty(Operation op, boolean doDelete)
Removes the dependency and the _listener at the attribute, if possible. 
public static void   deregisterReveng()
The reveng plugin can unset the modeller here when it is uninstalled(). 
private static String   generateMethodString(com.gentleware.poseidon.uml.generator.DefaultUMLGenerator.JavaAccessorContainer modelObject)
Create methods that get and set the attribute, beans-like. 
public Attribute   getAccessedAttribute(Operation op)
Returns the Attribute that the parameter accesses. 
public List   getAccessorDependencies(UmlProject umlProject, Attribute attribute)
 
public Dependency   getAccessorDependency(Operation op)
Returns the Attribute that the parameter accesses. 
public List   getAccessorOperations(Attribute attribute)
 
private List   getAllAccessorNames(Attribute attr)
Produces a list of Strings containing the names of the accessors. 
public Command   getCommandDeleteAccessorProperty(Operation op)
Removes the accessor dependency from an operation, asks the user if the configuration demands it. 
public static MethodBodyReplaceStrategy   getMethodBodyReplaceStrategy()
 
public List   getNewSmIdList()
helper method to get Id list  
public boolean   hasAccessors(Attribute attr)
Returns true if there are dependencies stereotyped accessor. 
public boolean   isAccessor(Operation oper)
True if the operation is client to a dependency stereotyped accessor. 
public Command   makeCommandRemoveAccessor(SmId operationSmId, boolean deleteOperations)

Removes accessor dependencies for attr; if true, the dependent operations are deleted. 

public Command   makeCommandRemoveAllAccessors(SmId attrId, boolean deleteOperations)

Removes accessor dependencies for attr; if true, the dependent operations are deleted. 

public static void   registerReveng(OperationModellerIF modeller, MethodBodyReplaceStrategy strategy)
the reveng plugin can set the correct modeller here when it is installed(). 
public void   removeAllAccessors(Attribute attr)
Removes the accessor methods to attribute attr. 
private void   removeDiagramElement(DiagramElement diagramElement, RemoveVisitor removeVisitor)
 
public void   silentlyRemoveAllAccessors(Attribute attr)
Convenience method for deleting accessor operations without asking, hehehe. 
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 54
gentleware-imported-package-statement-line-number 5
 

 Attribute Detail

CREATE_DEFAULT_ACCESSORS_TYPES

private static int[] CREATE_DEFAULT_ACCESSORS_TYPES

arrow_up


confirmDeleteMessage

private String confirmDeleteMessage

Lazy init.  
arrow_up


confirmTitle

private String confirmTitle

Lazy init.  
arrow_up
 Association Detail

_methodBodyReplaceStrategy

private MethodBodyReplaceStrategy _methodBodyReplaceStrategy

arrow_up


_modeller

private OperationModellerIF _modeller

This class produces an operation as Java string, if it is not null.  
arrow_up


_project

private UmlProject _project

arrow_up
 Constructor Detail

AccessorMethodsHelper

public com.gentleware.poseidon.uml.model_management.AccessorMethodsHelper AccessorMethodsHelper(UmlProject project)

Parameters:
project -
Returns:
arrow_up
 Method Detail

addCommandCreateAccessorAdder

public void addCommandCreateAccessorAdder(SmId accessorSmId, SmId operationSmId, Attribute attr, MacroCommand createOperationCommand)


Create a method that add an attribute and is editable.  
Parameters:
accessorSmId -
operationSmId -
attr -
createOperationCommand -
arrow_up


addCommandCreateAccessorGetter

public void addCommandCreateAccessorGetter(SmId accessordependencySmId, SmId operationSmId, Attribute attribute, MacroCommand createOperationCommand)


Create a method that get the attribute and is editable.  
Parameters:
accessordependencySmId -
operationSmId -
attribute -
createOperationCommand -
arrow_up


addCommandCreateAccessorOperation

private static void addCommandCreateAccessorOperation(SmId operationSmId, SmId accessorDependencySmId, Attribute attribute, int type, MacroCommand createOperationCommand)


Create a commands to create an accessor operation for the attribute, according to the type (setter, getter, ...).  
Parameters:
operationSmId -
accessorDependencySmId -
attribute - The accessed attribute.
type - The type of accessor. See {@link com.gentleware.poseidon.uml.generator.DefaultUMLGenerator.JavaAccessorContainer}
createOperationCommand - to this macro-command all neccessary commands to create the operation and required
arrow_up


addCommandCreateAccessorRemover

public void addCommandCreateAccessorRemover(SmId accessorDependencySmId, SmId operationSmId, Attribute attribute, MacroCommand createOperationCommand)


Create a method that Removes an attribute and is editable.  
Parameters:
accessorDependencySmId -
operationSmId -
attribute -
createOperationCommand -
arrow_up


addCommandCreateAccessorSetter

public void addCommandCreateAccessorSetter(SmId accessorSmId, SmId operationSmId, Attribute attr, MacroCommand createOperationCommand)


Create a method that set the attribute and is editable.  
Parameters:
accessorSmId -
operationSmId -
attr -
createOperationCommand -
arrow_up


addCommandCreateAccessorSingleGetter

public void addCommandCreateAccessorSingleGetter(SmId accessorDependencySmId, SmId operationSmId, Attribute attribute, MacroCommand createOperationCommand)


Create a method that get a single attribute and is editable.  
Parameters:
accessorDependencySmId -
operationSmId -
attribute -
createOperationCommand -
arrow_up


confirmCopyJavadoc

public static boolean confirmCopyJavadoc(Operation operation)


The parameters may not be null.  
Parameters:
operation -
Returns:
arrow_up


confirmCopyJavadoc

public static boolean confirmCopyJavadoc(Collection operations)

Parameters:
operations -
Returns:
arrow_up


confirmOperationDeletion

public boolean confirmOperationDeletion(List opNames)


Give a List of Strings naming the operations that are about to be deleted.  
Parameters:
opNames -
Returns:
arrow_up


confirmReplaceOperation

public boolean confirmReplaceOperation(List attributes)


Give a List of Strings naming the operations that are about to be deleted.  
Parameters:
attributes -
Returns:
arrow_up


copyDownJavadoc

public void copyDownJavadoc(Operation op, Attribute accessed)

Parameters:
op -
accessed -
arrow_up


createAttribute

public Attribute createAttribute(List opsIdList, SmId attributeId, Classifier owner, List smIdList)


Creates a new attribute, and accessors to that, if necessary.  
Parameters:
opsIdList -
attributeId -
owner -
smIdList -
Returns:
arrow_up


createAttribute

public Attribute createAttribute(List opsIdLsit, SmId smid, List smIdList, Classifier owner, boolean invertAccessorGenerationPolicy)


Creates a new attribute, and accessors to that, if necessary.  
Parameters:
opsIdLsit -
smid -
smIdList -
owner -
invertAccessorGenerationPolicy - If this parameter is set to true, then the accessor-generation-policy is inverted!
Returns:
arrow_up


createDefaultAccessors

public void createDefaultAccessors(List operationSmIds, List dependencySmIds, Attribute attr)


Create methods that get and set the attribute and are editable.  
Parameters:
operationSmIds -
dependencySmIds -
attr -
arrow_up


createDependency

public void createDependency(SmId dependencyId, Attribute attr, Operation op)


Creates a dependency between the parameters. May ask the user if that is ok.  
Parameters:
dependencyId -
attr -
op -
arrow_up


createDependency

public void createDependency(SmId newDependencyId, Attribute attr, Operation op, boolean overrideConfiguration, boolean keepJavadoc)


Creates a dependency between the parameters.  
Parameters:
newDependencyId -
attr -
op -
overrideConfiguration -
keepJavadoc - If true, the javadoc will not be modified. Otherwise, the user may be aked if copying the javadoc from the attribute is ok, or it may just happen.
arrow_up


deleteAccessorProperty

public void deleteAccessorProperty(Operation op)


Removes the accessor dependency from an operation, asks the user if the configuration demands it.  
Parameters:
op -
arrow_up


deleteAccessorProperty

public void deleteAccessorProperty(Operation op, boolean doDelete)


Removes the dependency and the _listener at the attribute, if possible.  
Parameters:
op -
doDelete - If true, it is attempted to delete the operation instead of removing the dependency only.
arrow_up


deregisterReveng

public static void deregisterReveng()


The reveng plugin can unset the modeller here when it is uninstalled().  
arrow_up


generateMethodString

private static String generateMethodString(com.gentleware.poseidon.uml.generator.DefaultUMLGenerator.JavaAccessorContainer modelObject)


Create methods that get and set the attribute, beans-like.  
Parameters:
modelObject -
Returns:
arrow_up


getAccessedAttribute

public Attribute getAccessedAttribute(Operation op)


Returns the Attribute that the parameter accesses.  
Parameters:
op -
Returns:
arrow_up


getAccessorDependencies

public List getAccessorDependencies(UmlProject umlProject, Attribute attribute)

Parameters:
umlProject -
attribute -
Returns:
a List of dependencies that are connected to the given attribute with a dependency stereotyped 'accessor'
arrow_up


getAccessorDependency

public Dependency getAccessorDependency(Operation op)


Returns the Attribute that the parameter accesses.  
Parameters:
op -
Returns:
arrow_up


getAccessorOperations

public List getAccessorOperations(Attribute attribute)

Parameters:
attribute -
Returns:
a List of Operations that are connected to the given attribute with a dependency stereotyped 'accessor'
arrow_up


getAllAccessorNames

private List getAllAccessorNames(Attribute attr)


Produces a list of Strings containing the names of the accessors.  
Parameters:
attr -
Returns:
arrow_up


getCommandDeleteAccessorProperty

public Command getCommandDeleteAccessorProperty(Operation op)


Removes the accessor dependency from an operation, asks the user if the configuration demands it.  
Parameters:
op -
Returns:
arrow_up


getMethodBodyReplaceStrategy

public static MethodBodyReplaceStrategy getMethodBodyReplaceStrategy()

Returns:
arrow_up


getNewSmIdList

public List getNewSmIdList()


helper method to get Id list  
Returns:
arrow_up


hasAccessors

public boolean hasAccessors(Attribute attr)


Returns true if there are dependencies stereotyped accessor.  
Parameters:
attr -
Returns:
arrow_up


isAccessor

public boolean isAccessor(Operation oper)


True if the operation is client to a dependency stereotyped accessor.  
Parameters:
oper -
Returns:
arrow_up


makeCommandRemoveAccessor

public Command makeCommandRemoveAccessor(SmId operationSmId, boolean deleteOperations)


Removes accessor dependencies for attr; if true, the dependent operations are deleted.

Pre-Condition: The attribute to the given ID must still exist.

 
Parameters:
operationSmId -
deleteOperations -
Returns:
arrow_up


makeCommandRemoveAllAccessors

public Command makeCommandRemoveAllAccessors(SmId attrId, boolean deleteOperations)


Removes accessor dependencies for attr; if true, the dependent operations are deleted.

Pre-Condition: The attribute to the given ID must still exist.

 
Parameters:
attrId -
deleteOperations -
Returns:
arrow_up


registerReveng

public static void registerReveng(OperationModellerIF modeller, MethodBodyReplaceStrategy strategy)


the reveng plugin can set the correct modeller here when it is installed().  
Parameters:
modeller -
strategy -
arrow_up


removeAllAccessors

public void removeAllAccessors(Attribute attr)


Removes the accessor methods to attribute attr. Asks the user if the suitable configuration key demands it.  
Parameters:
attr -
arrow_up


removeDiagramElement

private void removeDiagramElement(DiagramElement diagramElement, RemoveVisitor removeVisitor)

Parameters:
diagramElement -
removeVisitor -
arrow_up


silentlyRemoveAllAccessors

public void silentlyRemoveAllAccessors(Attribute attr)


Convenience method for deleting accessor operations without asking, hehehe.  
Parameters:
attr -
arrow_up
Created  2004 - 12 - 1

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.