Package org.apache.myfaces.extensions.validator.core.validation.strategy

Examples of org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy


    protected void processFieldValidation(FacesContext facesContext,
                                          UIComponent uiComponent,
                                          Object convertedObject,
                                          PropertyInformation propertyInformation)
    {
        ValidationStrategy validationStrategy;
        SkipValidationEvaluator skipValidationEvaluator = ExtValContext.getContext().getSkipValidationEvaluator();
        for (MetaDataEntry entry : propertyInformation.getMetaDataEntries())
        {
            validationStrategy = ExtValUtils.getValidationStrategyForMetaData(entry.getKey());

            if (validationStrategy != null &&
                    isValidationStrategyCompatibleWithValue(validationStrategy,  convertedObject))
            {
                if(skipValidationEvaluator.skipValidation(facesContext, uiComponent, validationStrategy, entry))
                {
                    if(logger.isTraceEnabled())
                    {
                        logger.trace("skip validation of " + entry.getValue() +
                                " with " + validationStrategy.getClass().getName());
                    }
                    //don't break maybe there are constraints which don't support the skip-mechanism
                    continue;
                }

                if(logger.isTraceEnabled())
                {
                    logger.trace("validate " + entry.getValue() + " with " + validationStrategy.getClass().getName());
                }

                try
                {
                    if(entry.getValue() instanceof Annotation)
                    {
                        if(!ExtValUtils.executeLocalBeforeValidationInterceptors(
                                facesContext, uiComponent, convertedObject,
                                PropertyInformation.class.getName(), propertyInformation,
                                entry.getValue(Annotation.class)))
                        {
                            continue;
                        }
                    }

                    /*
                     * validation
                     */
                    validationStrategy.validate(facesContext, uiComponent, entry, convertedObject);
                }
                finally
                {
                    if(entry.getValue() instanceof Annotation)
                    {
View Full Code Here


        if(logger.isTraceEnabled())
        {
            logger.trace("start to init component " + uiComponent.getClass().getName());
        }

        ValidationStrategy validationStrategy;
        MetaDataTransformer metaDataTransformer;

        MetaDataExtractor metaDataExtractor = ExtValUtils.getComponentMetaDataExtractor();

        Map<String, Object> metaData = new HashMap<String, Object>();
View Full Code Here

        if(logger.isTraceEnabled())
        {
            logger.trace("start validation");
        }

        ValidationStrategy validationStrategy;

        MetaDataExtractor metaDataExtractor = ExtValUtils.getComponentMetaDataExtractor();

        for (MetaDataEntry entry : metaDataExtractor.extract(facesContext, uiComponent).getMetaDataEntries())
        {
            validationStrategy = ExtValUtils.getValidationStrategyForMetaData(entry.getKey());

            if (validationStrategy != null)
            {
                if(skipValidation(facesContext, uiComponent, validationStrategy, entry))
                {
                    continue;
                }

                if(logger.isTraceEnabled())
                {
                    logger.trace("validate " + entry.getValue() + " with " +
                            validationStrategy.getClass().getName());
                }

                validationStrategy.validate(facesContext, uiComponent, entry, convertedObject);
            }
            else
            {
                if(logger.isTraceEnabled())
                {
View Full Code Here

    }

    public static Map<String, Object> getTransformedMetaDataWith(
            FacesContext facesContext, UIComponent uiComponent, Map<String, Object> properties)
    {
        ValidationStrategy validationStrategy;

        SkipValidationEvaluator skipValidationEvaluator = ExtValContext.getContext().getSkipValidationEvaluator();
        MetaDataExtractor metaDataExtractor = getComponentMetaDataExtractorWith(properties);

        Map<String, Object> metaData;
View Full Code Here

    public static Map<String, Object> getTransformedMetaDataWith(FacesContext facesContext,
                                                                 PropertyInformation propertyInformation,
                                                                 Map<String, Object> properties)
    {
        ValidationStrategy validationStrategy;

        // This is called as part of the MetaData extraction in the default process.
        // So we need to do it here also before the transformations are run.
        for (MetaDataExtractionInterceptor metaDataExtractionInterceptor :
                ExtValContext.getContext().getMetaDataExtractionInterceptorsWith(properties))
View Full Code Here

    protected void processFieldValidation(FacesContext facesContext,
                                          UIComponent uiComponent,
                                          Object convertedObject,
                                          PropertyInformation propertyInformation)
    {
        ValidationStrategy validationStrategy;
        SkipValidationEvaluator skipValidationEvaluator = ExtValContext.getContext().getSkipValidationEvaluator();
        for (MetaDataEntry entry : propertyInformation.getMetaDataEntries())
        {
            validationStrategy = ExtValUtils.getValidationStrategyForMetaData(entry.getKey());

            if (validationStrategy != null &&
                    isValidationStrategyCompatibleWithValue(validationStrategy, convertedObject, entry))
            {
                if(skipValidationEvaluator.skipValidation(facesContext, uiComponent, validationStrategy, entry))
                {
                    logger.finest("skip validation of " + entry.getValue() +
                            " with " + validationStrategy.getClass().getName());
                    //don't break maybe there are constraints which don't support the skip-mechanism
                    continue;
                }

                logger.finest("validate " + entry.getValue() + " with " + validationStrategy.getClass().getName());

                try
                {
                    if(entry.getValue() instanceof Annotation)
                    {
                        if(!ExtValUtils.executeLocalBeforeValidationInterceptors(
                                facesContext, uiComponent, convertedObject,
                                PropertyInformation.class.getName(), propertyInformation,
                                entry.getValue(Annotation.class)))
                        {
                            continue;
                        }
                    }

                    /*
                     * validation
                     */
                    validationStrategy.validate(facesContext, uiComponent, entry, convertedObject);
                }
                finally
                {
                    if(entry.getValue() instanceof Annotation)
                    {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.