Package org.apache.myfaces.extensions.validator.crossval.storage

Examples of org.apache.myfaces.extensions.validator.crossval.storage.ProcessedInformationStorage


        {
            return;
        }

        //to support local cross-validation (within the same entity)
        ProcessedInformationStorage processedInformationStorage = CrossValidationUtils
            .getOrInitProcessedInformationStorage();

        ProcessedInformationStorageEntry entry;

        PropertyDetails propertyDetails = getELHelper().getPropertyDetailsOfValueBinding(uiComponent);

        if(propertyDetails == null)
        {
            return;
        }
       
        entry = new ProcessedInformationStorageEntry();
        entry.setBean(propertyDetails.getBaseObject());
        entry.setConvertedValue(value);
        entry.setComponent(uiComponent);
        entry.setClientId(uiComponent.getClientId(FacesContext.getCurrentInstance()));

        String key = propertyDetails.getKey();

        //for local cross-validation
        if (processedInformationStorage.containsEntry(key) &&
            processedInformationStorage.getEntry(key).getBean() != null &&
            !processedInformationStorage.getEntry(key).getBean().equals(entry.getBean()))
        {
            //for the validation within a complex component e.g. a table
            //don't override existing expression (style: #{entry.property}) - make a special mapping

            List<ProcessedInformationStorageEntry> furtherEntries =
                processedInformationStorage.getEntry(key).getFurtherEntries();

            if (furtherEntries == null)
            {
                furtherEntries = new ArrayList<ProcessedInformationStorageEntry>();

                processedInformationStorage.getEntry(key).setFurtherEntries(furtherEntries);
            }

            furtherEntries.add(entry);
        }
        else
        {
            //for normal validation
            processedInformationStorage.setEntry(key, entry);
        }
    }
View Full Code Here


    protected boolean tryToValidateLocally(CrossValidationStorageEntry crossValidationStorageEntry,
                                           CrossValidationStorage crossValidationStorage,
                                           String targetKey,
                                           AbstractCompareStrategy compareStrategy)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        String newKey = createTargetKey(crossValidationStorageEntry, targetKey);

        if (processedInformationStorage.containsEntry(newKey))
        {
            ProcessedInformationStorageEntry validationTargetEntry = processedInformationStorage.getEntry(newKey);

            processCrossComponentValidation(compareStrategy, crossValidationStorageEntry, validationTargetEntry);
        }
        //no target - because there is no target component - value was validated against the model
        else
View Full Code Here

    private ProcessedInformationStorageEntry resolveTargetForCrossComponentValidation(
            CrossValidationStorageEntry crossValidationStorageEntry,
            ValueBindingExpression validationTarget)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        return CrossValidationUtils.resolveValidationTargetEntry(
                processedInformationStorage,
                CrossValidationUtils.convertValueBindingExpressionToProcessedInformationKey(validationTarget),
View Full Code Here

            CrossValidationStorageEntry crossValidationStorageEntry,
            CrossValidationStorage crossValidationStorage,
            String targetKey,
            AbstractCompareStrategy compareStrategy)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        boolean isModelAwareValidation =
                isModelAwareCrossValidation(crossValidationStorageEntry, processedInformationStorage, targetKey);
View Full Code Here

    private ProcessedInformationStorageEntry resolveTargetForCrossComponentValidation(
            CrossValidationStorageEntry crossValidationStorageEntry,
            ValueBindingExpression validationTarget)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        return CrossValidationUtils.resolveValidationTargetEntry(
                processedInformationStorage,
                CrossValidationUtils.convertValueBindingExpressionToProcessedInformationKey(validationTarget),
View Full Code Here

            CrossValidationStorageEntry crossValidationStorageEntry,
            CrossValidationStorage crossValidationStorage,
            String targetKey,
            AbstractCompareStrategy compareStrategy)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        boolean isModelAwareValidation =
                isModelAwareCrossValidation(crossValidationStorageEntry, processedInformationStorage, targetKey);
View Full Code Here

    protected boolean tryToValidateLocally(CrossValidationStorageEntry crossValidationStorageEntry,
                                           CrossValidationStorage crossValidationStorage,
                                           String targetKey,
                                           AbstractCompareStrategy compareStrategy)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        String newKey = createTargetKey(crossValidationStorageEntry, targetKey);

        if (processedInformationStorage.containsEntry(newKey))
        {
            ProcessedInformationStorageEntry validationTargetEntry = processedInformationStorage.getEntry(newKey);

            processCrossComponentValidation(compareStrategy, crossValidationStorageEntry, validationTargetEntry);
        }
        //no target - because there is no target component - value was validated against the model
        else
View Full Code Here

        {
            return;
        }

        //to support local cross-validation (within the same entity)
        ProcessedInformationStorage processedInformationStorage = CrossValidationUtils
            .getOrInitProcessedInformationStorage();

        ProcessedInformationStorageEntry entry;

        PropertyDetails propertyDetails = getELHelper().getPropertyDetailsOfValueBinding(uiComponent);

        if(propertyDetails == null)
        {
            return;
        }
       
        entry = new ProcessedInformationStorageEntry();
        entry.setBean(propertyDetails.getBaseObject());
        entry.setConvertedValue(value);
        entry.setComponent(uiComponent);
        entry.setClientId(uiComponent.getClientId(FacesContext.getCurrentInstance()));

        String key = propertyDetails.getKey();

        //for local cross-validation
        if (processedInformationStorage.containsEntry(key) &&
            processedInformationStorage.getEntry(key).getBean() != null &&
            !processedInformationStorage.getEntry(key).getBean().equals(entry.getBean()))
        {
            //for the validation within a complex component e.g. a table
            //don't override existing expression (style: #{entry.property}) - make a special mapping

            List<ProcessedInformationStorageEntry> furtherEntries =
                processedInformationStorage.getEntry(key).getFurtherEntries();

            if (furtherEntries == null)
            {
                furtherEntries = new ArrayList<ProcessedInformationStorageEntry>();

                processedInformationStorage.getEntry(key).setFurtherEntries(furtherEntries);
            }

            furtherEntries.add(entry);
        }
        else
        {
            //for normal validation
            processedInformationStorage.setEntry(key, entry);
        }
    }
View Full Code Here

    private ProcessedInformationStorageEntry resolveTargetForCrossComponentValidation(
            CrossValidationStorageEntry crossValidationStorageEntry,
            ValueBindingExpression validationTarget)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        return CrossValidationUtils.resolveValidationTargetEntry(
                processedInformationStorage,
                CrossValidationUtils.convertValueBindingExpressionToProcessedInformationKey(validationTarget),
View Full Code Here

            CrossValidationStorageEntry crossValidationStorageEntry,
            CrossValidationStorage crossValidationStorage,
            String targetKey,
            AbstractCompareStrategy compareStrategy)
    {
        ProcessedInformationStorage processedInformationStorage =
                CrossValidationUtils.getOrInitProcessedInformationStorage();

        boolean isModelAwareValidation =
                isModelAwareCrossValidation(crossValidationStorageEntry, processedInformationStorage, targetKey);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.validator.crossval.storage.ProcessedInformationStorage

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.