org.apache.commons.validator
public class ISBNValidator extends Object
Since: Validator 1.2.0
Version: $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $
Field Summary | |
---|---|
static String | CHECK |
static String | GROUP |
static String | ISBN_PATTERN
ISBN consists of 4 groups of numbers separated by either dashes (-)
or spaces. |
static String | PUBLISHER |
static String | SEP |
static String | TITLE |
Constructor Summary | |
---|---|
ISBNValidator()
Default Constructor. |
Method Summary | |
---|---|
String | clean(String isbn)
Removes all non-digit characters except for 'X' which is a valid ISBN
character. |
boolean | isFormatted(String isbn)
Returns true if the ISBN contains one of the separator characters space
or dash. |
boolean | isValid(String isbn)
If the ISBN is formatted with space or dash separators its format is
validated. |
boolean | isValidPattern(String isbn)
Returns true if the ISBN is formatted properly. |
int | sum(String isbn)
Returns the sum of the weighted ISBN characters. |
int | toInt(char ch)
Returns the numeric value represented by the character. |
Parameters: isbn Candidate ISBN number to be validated. null
is
considered invalid.
Returns: true if the string is a valid ISBN code.