Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.faces.component.validator;
import com.sun.faces.facelets.tag.jsf.ComponentSupport;
import com.sun.faces.util.RequestStateManager;
import javax.faces.context.FacesContext;
import javax.faces.component.EditableValueHolder;
import javax.faces.validator.Validator;
import javax.faces.application.Application;
import javax.faces.view.facelets.ValidatorHandler;
import javax.faces.view.facelets.FaceletContext;
import java.util.*;
import javax.faces.event.PhaseId;
/**
*
* This class is responsible for adding default validators and/or validators
* that wrap multiple EditableValueHolder instances within the view.
*
*/
public class ComponentValidators {
/**
* Key within the FacesContext's attribute map under which
* a single ComponentValidators instance will be stored.
*/
private static final String COMPONENT_VALIDATORS = "javax.faces.component.ComponentValidators";
/**
* Stack of ValidatorInfo instances. Each instance represents
* a particular nesting level within the view. As a nesting level is encountered,
* a ValidatorInfo will be pushed to the stack and all
* EditableValueHolder instances will be configured based on
* all ValidatorInfos on the stack. When the current nesting level
* is closed, the ValidatorInfo instance will be popped and thus
* have no impact on other EditableValueHolders.
*/
private LinkedList validatorStack = null;
// ------------------------------------------------------------ Constructors
public ComponentValidators() {
validatorStack = new LinkedList<>();
}
// ---------------------------------------------------------- Public Methods
/**
* @param context the FacesContext for the current request
* @param createIfNull flag indicating whether or not a
* ComponentValidators instance should be created or not
* @return a ComponentValidators instance for processing
* a view request. If createIfNull is false
* and no ComponentValidators has been created, this method
* will return null
*/
public static ComponentValidators getValidators(FacesContext context,
boolean createIfNull) {
Map