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 * @since 1.2.0 029 * @deprecated Use the new ISBNValidator in the routines package 030 */ 031@Deprecated 032public class ISBNValidator { 033 034 /** 035 * Default Constructor. 036 */ 037 public ISBNValidator() { 038 } 039 040 /** 041 * If the ISBN is formatted with space or dash separators its format is 042 * validated. Then the digits in the number are weighted, summed, and 043 * divided by 11 according to the ISBN algorithm. If the result is zero, 044 * the ISBN is valid. This method accepts formatted or raw ISBN codes. 045 * 046 * @param isbn Candidate ISBN number to be validated. {@code null} is 047 * considered invalid. 048 * @return true if the string is a valid ISBN code. 049 */ 050 public boolean isValid(final String isbn) { 051 return org.apache.commons.validator.routines.ISBNValidator.getInstance().isValidISBN10(isbn); 052 } 053 054}