Großmarkt

market
Class VCDummy

java.lang.Object
  |
  +--market.VCDummy
All Implemented Interfaces:
Serializable, ValueChecker

public class VCDummy
extends Object
implements ValueChecker

The simplest implementation of ValueChecker. It only checks a String for emptiness, if wanted.
A VCDummy is used for text fields, that need to be a JTFCheckable to allow access from outside the defining class, but for which no content checking is required.

See Also:
Serialized Form

Field Summary
protected  String identifier
          The identifier used by getErrorString().
protected  boolean mayBeEmpty
          Defines if an empty String is considered to be an error or not.
 
Constructor Summary
VCDummy(String identifier)
           
VCDummy(String identifier, boolean mayBeEmpty)
           
 
Method Summary
 String getErrorString()
           
 boolean isValidValue(String content)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

protected String identifier
The identifier used by getErrorString().


mayBeEmpty

protected boolean mayBeEmpty
Defines if an empty String is considered to be an error or not.

Constructor Detail

VCDummy

public VCDummy(String identifier,
               boolean mayBeEmpty)
Parameters:
identifier - the identifier.
mayBeEmpty - true if an empty should be considered valid, otherwise false.

VCDummy

public VCDummy(String identifier)
Parameters:
identifier - the identifier.
Method Detail

isValidValue

public boolean isValidValue(String content)
Specified by:
isValidValue in interface ValueChecker
Parameters:
content - the String to be checked.
Returns:
always true if mayBeEmpty is true, otherwise it returns true if content is not empty.

getErrorString

public String getErrorString()
Specified by:
getErrorString in interface ValueChecker
Returns:
an error message if the String is empty when it shouldn't.

Großmarkt