fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * The contents of this file are subject to the terms
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * of the Common Development and Distribution License
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * (the License). You may not use this file except in
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * compliance with the License.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * You can obtain a copy of the License at
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * https://opensso.dev.java.net/public/CDDLv1.0.html or
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * See the License for the specific language governing
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * permission and limitations under the License.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * When distributing Covered Code, include this CDDL
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Header Notice in each file and include the License file
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * If applicable, add the following below the CDDL Header,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * with the fields enclosed by brackets [] replaced by
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * your own identifying information:
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * "Portions Copyrighted [year] [name of copyright owner]"
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * $Id: ValidatorBase.java,v 1.2 2008/06/25 05:51:25 qcheng Exp $
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorpackage com.sun.identity.install.tools.configurator;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorimport com.sun.identity.install.tools.util.Debug;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorimport com.sun.identity.install.tools.util.LocalizedMessage;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Abstract class for validators to inherit from
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorpublic abstract class ValidatorBase implements IValidation {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major public ValidatorBase() throws InstallException {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Validate method
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @param name
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Validator name
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @param value
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Validation value
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @param props
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Map object
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @param state
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * IStateAccess state
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @return ValidationResult Object
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @throws InstallException
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major public ValidationResult validate(String name, String value, Map props,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major Method validatorMethod = (Method) getValidatorMap().get(name);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major validRes = (ValidationResult) validatorMethod.invoke(this,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major Debug.log("Failed to invoke validate method for "
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Initialize Validator Map
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major abstract protected void initializeValidatorMap() throws InstallException;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Get Validator map
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @return Map
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /** Hashmap of Validator names and integers */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Localized constants
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major public static String LOC_VA_ERR_VAL_METHOD_NOT_FOUND =
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major "VA_ERR_VAL_METHOD_NOT_FOUND";
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major public static String LOC_VA_ERR_VAL_FAILED_IN_SILENT =
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major "VA_ERR_VAL_FAILED_IN_SILENT";