001/*
002 * Copyright 2015-2017 UnboundID Corp.
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2015-2017 UnboundID Corp.
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.util.args;
022
023
024
025import com.unboundid.util.Extensible;
026import com.unboundid.util.ThreadSafety;
027import com.unboundid.util.ThreadSafetyLevel;
028
029
030
031/**
032 * This class defines an API that may be used to create argument value
033 * validators, which can be used to enforce additional constraints on the values
034 * provided to an argument.
035 */
036@Extensible()
037@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
038public abstract class ArgumentValueValidator
039{
040  /**
041   * Examines the value(s) assigned to the provided argument to determine
042   * whether they are acceptable.
043   *
044   * @param  argument     The argument to which the value is being provided.
045   * @param  valueString  The string representation of the value to be
046   *                      validated.  This value will have already passed any
047   *                      normal validation performed by the argument.
048   *
049   * @throws  ArgumentException  If the provided value is determined to be
050   *                             unacceptable.
051   */
052  public abstract void validateArgumentValue(final Argument argument,
053                                             final String valueString)
054         throws ArgumentException;
055}