001 package market; 002 003 /** 004 * Implementations of this interface provide an easy way to check if a String complies with a special 005 * format.<br> 006 * If it doesn't, a ValueChecker can return a String describing the kind of error that was detected. 007 */ 008 public interface ValueChecker extends java.io.Serializable { 009 010 /** 011 * 012 * @param content the String to be tested 013 * @return <code>true</code> if the String is valid conforming with the particular ValueChecker's 014 * implementation, otherwise <code>false</code>. 015 */ 016 boolean isValidValue(String content); 017 018 /** 019 * @return a descriptive String depending on the kind of detected error 020 */ 021 String getErrorString(); 022 }