org.argouml.uml.cognitive.critics
Class CrUML

java.lang.Object
  extended byorg.argouml.cognitive.critics.Critic
      extended byorg.argouml.uml.cognitive.critics.CrUML
All Implemented Interfaces:
Poster, Serializable
Direct Known Subclasses:
AbstractCrTooMany, AbstractCrUnconventionalName, CrAlreadyRealizes, CrAssocNameConflict, CrAttrNameConflict, CrCircularAssocClass, CrCircularComposition, CrCircularInheritance, CrClassMustBeAbstract, CrClassWithoutComponent, CrCompInstanceWithoutNode, CrComponentInstanceWithoutClassifier, CrComponentWithoutNode, CrConflictingComposites, CrConsiderFacade, CrConsiderSingleton, CrConstructorNeeded, CrCrossNamespaceAssoc, CrDisambigClassName, CrDisambigStateName, CrDupParamName, CrDupRoleNames, CrEmptyPackage, CrFinalSubclassed, CrForkOutgoingTransition, CrIllegalGeneralization, CrIllegalName, CrInstanceWithoutClassifier, CrInterfaceAllPublic, CrInterfaceOperOnly, CrInterfaceWithoutComponent, CrInvalidBranch, CrInvalidFork, CrInvalidForkTriggerOrGuard, CrInvalidHistory, CrInvalidInitial, CrInvalidJoin, CrInvalidJoinTriggerOrGuard, CrInvalidPseudoStateTrigger, CrInvalidSynch, CrJoinIncomingTransition, CrMergeClasses, CrMissingAttrName, CrMissingClassName, CrMissingOperName, CrMissingStateName, CrMultiComposite, CrMultipleAgg, CrMultipleDeepHistoryStates, CrMultipleInheritance, CrMultipleInitialStates, CrMultipleRealization, CrMultipleShallowHistoryStates, CrNameConflict, CrNameConflictAC, CrNameConfusion, CrNavFromInterface, CrNoAssociations, CrNodeInsideElement, CrNodeInstanceInsideElement, CrNodeInstanceWithoutClassifier, CrNodesOverlap, CrNoGuard, CrNoIncomingTransitions, CrNoInitialState, CrNoInstanceVariables, CrNonAggDataType, CrNoOperations, CrNoOutgoingTransitions, CrNoTransitions, CrNoTriggerOrGuard, CrNWayAgg, CrObjectWithoutClassifier, CrObjectWithoutComponent, CrOperNameConflict, CrOppEndConflict, CrOppEndVsAttr, CrReservedName, CrSeqInstanceWithoutClassifier, CrSingletonViolatedMissingStaticAttr, CrSingletonViolatedOnlyPrivateConstructors, CrSubclassReference, CrUnnavigableAssoc, CrUselessAbstract, CrUselessInterface, CrUtilityViolated, CrWrongDepEnds, CrWrongLinkEnds, CrZeroLengthEdge

public class CrUML
extends Critic

"Abstract" Critic subclass that captures commonalities among all critics in the UML domain. This class also defines and registers the categories of design decisions that the critics can address.

See Also:
Designer, DecisionModel, Serialized Form

Field Summary
static Decision DEC_BEHAVIOR
          Decision type: BEHAVIOR
static Decision DEC_CLASS_SELECTION
          Decision type: CLASS_SELECTION
static Decision DEC_CODE_GEN
          Decision type: CODE_GEN
static Decision DEC_CONTAINMENT
          Decision type: CONTAINMENT
static Decision DEC_EXPECTED_USAGE
          Decision type: EXPECTED_USAGE
static Decision DEC_INHERITANCE
          Decision type: INHERITANCE
static Decision DEC_INSTANCIATION
          Decision type: INSTANCIATION
static Decision DEC_METHODS
          Decision type: METHODS
static Decision DEC_MODULARITY
          Decision type: MODULARITY
static Decision DEC_NAMING
          Decision type: NAMING
static Decision DEC_PATTERNS
          Decision type: PATTERNS
static Decision DEC_PLANNED_EXTENSIONS
          Decision type: PLANNED_EXTENSIONS
static Decision DEC_RELATIONSHIPS
          Decision type: RELATIONSHIPS
static Decision DEC_STATE_MACHINES
          Decision type: STATE_MACHINES
static Decision DEC_STEREOTYPES
          Decision type: STEREOTYPES
static Decision DEC_STORAGE
          Decision type: STORAGE
private static Logger LOG
           
private static String OCL_END
           
private static String OCL_START
           
 
Fields inherited from class org.argouml.cognitive.critics.Critic
DEFAULT_CLARIFIER, KT_COMPLETENESS, KT_CONSISTENCY, KT_CORRECTNESS, KT_DESIGNERS, KT_EXPERIENCIAL, KT_OPTIMIZATION, KT_ORGANIZATIONAL, KT_PRESENTATION, KT_SEMANTICS, KT_SYNTAX, KT_TOOL, NO_PROBLEM, PROBLEM_FOUND
 
Constructor Summary
CrUML()
          The constructor for this class.
 
Method Summary
 String expand(String res, org.tigris.gef.util.VectorSet offs)
          Expand text with ocl brackets in it.
 boolean predicate(Object dm, Designer dsgr)
          Perform the Critic's analysis of the design.
 boolean predicate2(Object dm, Designer dsgr)
          This is the decision routine for the critic.
 void setHeadline(String s)
          Set up the locale specific text for the critic headline (the one liner that appears in the to-do pane) and the critic description (the detailed explanation that appears in the to-do tab of the details pane).
 void setResource(String key)
          Set the resources for this critic based on the class name.
 ToDoItem toDoItem(Object dm, Designer dsgr)
          create a new UMLToDoItem.
 
Methods inherited from class org.argouml.cognitive.critics.Critic
addControlRec, addKnowledgeType, addSupportedDecision, addSupportedGoal, addTrigger, beActive, beInactive, canFixIt, containsKnowledgeType, critique, defaultMoreInfoURL, fixIt, getArg, getArgs, getClarifier, getControlRec, getCriticCategory, getCriticKey, getCriticName, getCriticType, getDecisionCategory, getDescription, getDescriptionTemplate, getExpertEmail, getHeadline, getHeadline, getHeadline, getKnowledgeTypes, getMoreInfoURL, getMoreInfoURL, getPriority, getPriority, getSupportedDecisions, getSupportedGoals, getTriggerMask, getWizardClass, initWizard, isActive, isEnabled, isRelevantToDecisions, isRelevantToGoals, makeWizard, matchReason, postItem, reasonCodeFor, setArg, setArgs, setDecisionCategory, setDescription, setEnabled, setExpertEmail, setKnowledgeTypes, setKnowledgeTypes, setKnowledgeTypes, setKnowledgeTypes, setMoreInfoURL, setPriority, snooze, snoozeOrder, stillValid, supports, supports, toString, unsnooze
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

DEC_INHERITANCE

public static final Decision DEC_INHERITANCE
Decision type: INHERITANCE


DEC_CONTAINMENT

public static final Decision DEC_CONTAINMENT
Decision type: CONTAINMENT


DEC_PATTERNS

public static final Decision DEC_PATTERNS
Decision type: PATTERNS


DEC_RELATIONSHIPS

public static final Decision DEC_RELATIONSHIPS
Decision type: RELATIONSHIPS


DEC_STORAGE

public static final Decision DEC_STORAGE
Decision type: STORAGE


DEC_BEHAVIOR

public static final Decision DEC_BEHAVIOR
Decision type: BEHAVIOR


DEC_INSTANCIATION

public static final Decision DEC_INSTANCIATION
Decision type: INSTANCIATION


DEC_NAMING

public static final Decision DEC_NAMING
Decision type: NAMING


DEC_MODULARITY

public static final Decision DEC_MODULARITY
Decision type: MODULARITY


DEC_CLASS_SELECTION

public static final Decision DEC_CLASS_SELECTION
Decision type: CLASS_SELECTION


DEC_EXPECTED_USAGE

public static final Decision DEC_EXPECTED_USAGE
Decision type: EXPECTED_USAGE


DEC_METHODS

public static final Decision DEC_METHODS
Decision type: METHODS


DEC_CODE_GEN

public static final Decision DEC_CODE_GEN
Decision type: CODE_GEN


DEC_PLANNED_EXTENSIONS

public static final Decision DEC_PLANNED_EXTENSIONS
Decision type: PLANNED_EXTENSIONS


DEC_STEREOTYPES

public static final Decision DEC_STEREOTYPES
Decision type: STEREOTYPES


DEC_STATE_MACHINES

public static final Decision DEC_STATE_MACHINES
Decision type: STATE_MACHINES


OCL_START

private static final String OCL_START
See Also:
Constant Field Values

OCL_END

private static final String OCL_END
See Also:
Constant Field Values
Constructor Detail

CrUML

public CrUML()
The constructor for this class.

Method Detail

setResource

public void setResource(String key)
Set the resources for this critic based on the class name.

Parameters:
key - is the class name.

setHeadline

public final void setHeadline(String s)
Set up the locale specific text for the critic headline (the one liner that appears in the to-do pane) and the critic description (the detailed explanation that appears in the to-do tab of the details pane). TODO: Since the parameter is ignored, will be deprecated in good time. MVW: Maybe we can make it part of the constructor CrUML()?

Overrides:
setHeadline in class Critic
Parameters:
s - the english headline, but ignored!

predicate

public boolean predicate(Object dm,
                         Designer dsgr)
Description copied from class: Critic
Perform the Critic's analysis of the design. Subclasses should test the given Object to make sure that it is the type of object that is expected. Each object in the design registers its own critics with the run-time system. The dm parameter is bound to each design object that registered this critic, one per call. Returning true means that feedback should be delivered to the Designer. By convention, subclasses should return their superclass predicate method if their own predicate would return false.

Overrides:
predicate in class Critic
Parameters:
dm - the design material, which is to be checked
dsgr - the designer
Returns:
the critic result
See Also:
Critic.predicate( java.lang.Object, org.argouml.cognitive.Designer)

predicate2

public boolean predicate2(Object dm,
                          Designer dsgr)
This is the decision routine for the critic.

Parameters:
dm - is the UML entity (an NSUML object) that is being checked.
dsgr - is for future development and can be ignored.
Returns:
boolean problem found

expand

public String expand(String res,
                     org.tigris.gef.util.VectorSet offs)
Expand text with ocl brackets in it. No recursive expansion.

Specified by:
expand in interface Poster
Overrides:
expand in class Critic
Parameters:
res - is the text to expand.
offs - is the elements to replace
Returns:
the expanded text
See Also:
Poster.expand(java.lang.String, org.tigris.gef.util.VectorSet)

toDoItem

public ToDoItem toDoItem(Object dm,
                         Designer dsgr)
create a new UMLToDoItem.

Overrides:
toDoItem in class Critic
See Also:
UMLToDoItem


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook