001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.validator; 018 019/** 020 * A class for validating 10 digit ISBN codes. 021 * Based on this 022 * <a href="http://www.isbn.org/standards/home/isbn/international/html/usm4.htm"> 023 * algorithm</a> 024 * 025 * <b>NOTE:</b> This has been replaced by the new 026 * {@link org.apache.commons.validator.routines.ISBNValidator}. 027 * 028 * @version $Revision$ 029 * @since Validator 1.2.0 030 * @deprecated Use the new ISBNValidator in the routines package 031 */ 032@Deprecated 033public class ISBNValidator { 034 035 /** 036 * Default Constructor. 037 */ 038 public ISBNValidator() { 039 super(); 040 } 041 042 /** 043 * If the ISBN is formatted with space or dash separators its format is 044 * validated. Then the digits in the number are weighted, summed, and 045 * divided by 11 according to the ISBN algorithm. If the result is zero, 046 * the ISBN is valid. This method accepts formatted or raw ISBN codes. 047 * 048 * @param isbn Candidate ISBN number to be validated. <code>null</code> is 049 * considered invalid. 050 * @return true if the string is a valid ISBN code. 051 */ 052 public boolean isValid(String isbn) { 053 return org.apache.commons.validator.routines.ISBNValidator.getInstance().isValidISBN10(isbn); 054 } 055 056}