org.designwizard.patternchecker
Class SingletonPatternChecker

java.lang.Object
  extended by org.designwizard.patternchecker.SingletonPatternChecker
All Implemented Interfaces:
PatternChecker

public class SingletonPatternChecker
extends java.lang.Object
implements PatternChecker


Field Summary
static java.lang.String GET_INSTANCE_FIELD_MISS_WARN
           
static java.lang.String GET_INSTANCE_NOT_FOUND_ERROR
           
static java.lang.String MULTIPLE_SINGLETON_FIELDS_ERROR
           
static java.lang.String NO_SINGLETON_FIELDS_ERROR
           
static java.lang.String PUBLIC_CONSTRUCTOR_ERROR
           
static java.lang.String VERIFIED_PATTERN_NAME
           
 
Constructor Summary
SingletonPatternChecker(ClassNode classEntity)
           
 
Method Summary
 boolean getVeredict()
           
 void setDesign(DesignIF design)
          Sets the design to be checked by this PatternChecker.
 CheckingResult verify()
          Verifies whether the design implements the pattern which is checked by this PatternChecker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERIFIED_PATTERN_NAME

public static final java.lang.String VERIFIED_PATTERN_NAME
See Also:
Constant Field Values

PUBLIC_CONSTRUCTOR_ERROR

public static final java.lang.String PUBLIC_CONSTRUCTOR_ERROR
See Also:
Constant Field Values

MULTIPLE_SINGLETON_FIELDS_ERROR

public static final java.lang.String MULTIPLE_SINGLETON_FIELDS_ERROR
See Also:
Constant Field Values

GET_INSTANCE_NOT_FOUND_ERROR

public static final java.lang.String GET_INSTANCE_NOT_FOUND_ERROR
See Also:
Constant Field Values

NO_SINGLETON_FIELDS_ERROR

public static final java.lang.String NO_SINGLETON_FIELDS_ERROR
See Also:
Constant Field Values

GET_INSTANCE_FIELD_MISS_WARN

public static final java.lang.String GET_INSTANCE_FIELD_MISS_WARN
See Also:
Constant Field Values
Constructor Detail

SingletonPatternChecker

public SingletonPatternChecker(ClassNode classEntity)
Method Detail

getVeredict

public boolean getVeredict()
Specified by:
getVeredict in interface PatternChecker
Returns:
true if the pattern is correctly implemented by the design; false otherwise.

setDesign

public void setDesign(DesignIF design)
Description copied from interface: PatternChecker
Sets the design to be checked by this PatternChecker.

Specified by:
setDesign in interface PatternChecker
Parameters:
design - the new design.

verify

public CheckingResult verify()
Description copied from interface: PatternChecker
Verifies whether the design implements the pattern which is checked by this PatternChecker.

Specified by:
verify in interface PatternChecker
Returns:
the result of the verification.