Examples of ProcessedInformationStorageEntry


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

    public static ProcessedInformationStorageEntry resolveValidationTargetEntry(
            ProcessedInformationStorage processedInformationStorage,
            String targetKey, CrossValidationStorageEntry crossValidationStorageEntry)
    {
        ProcessedInformationStorageEntry processedInformationEntry =
            processedInformationStorage.getEntry(targetKey);

        //value not submitted at this request - use model value (validation against the model)
        if(processedInformationEntry == null)
        {
            return null;
        }

        //simple case
        if (processedInformationEntry.getFurtherEntries() == null)
        {
            return processedInformationEntry;
        }

        PropertyDetails propertyDetails = crossValidationStorageEntry.getMetaDataEntry()
                .getProperty(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);

        Object targetBean = propertyDetails.getBaseObject();

        //process complex component entries (e.g. a table)
        //supported: cross-component but no cross-entity validation (= locale validation)
        if (processedInformationEntry.getBean().equals(targetBean))
        {
            return processedInformationEntry;
        }

        for (ProcessedInformationStorageEntry entry : processedInformationEntry.getFurtherEntries())
        {
            if (entry.getBean().equals(targetBean))
            {
                return entry;
            }
View Full Code Here

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

        //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 =
View Full Code Here

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

        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

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

            targetKey = targetKey.substring(targetKey.lastIndexOf(".") + 1, targetKey.length());
        }

        Object targetValue = getValueOfProperty(newBase, targetKey);

        ProcessedInformationStorageEntry targetEntry = new ProcessedInformationStorageEntry();
        targetEntry.setBean(newBase);
        targetEntry.setConvertedValue(targetValue);

        CrossValidationHelper
                .crossValidateCompareStrategy(
                        compareStrategy, crossValidationStorageEntry, targetEntry, true);
    }
View Full Code Here

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

            CrossValidationStorageEntry crossValidationStorageEntry,
            ValueBindingExpression validationTarget,
            CrossValidationStorage crossValidationStorage,
            AbstractCompareStrategy compareStrategy)
    {
        ProcessedInformationStorageEntry validationTargetEntry =
                resolveTargetForCrossComponentValidation(crossValidationStorageEntry, validationTarget);

        if(validationTargetEntry != null)
        {
            processCrossComponentValidation(compareStrategy, crossValidationStorageEntry, validationTargetEntry);
View Full Code Here

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

            ValueBindingExpression validationTarget)
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Object targetValue = ExtValUtils.getELHelper().getValueOfExpression(facesContext, validationTarget);

        ProcessedInformationStorageEntry targetEntry = new ProcessedInformationStorageEntry();
        targetEntry.setBean(
                ExtValUtils.getELHelper().getValueOfExpression(facesContext, validationTarget.getBaseExpression()));
        targetEntry.setConvertedValue(targetValue);

        CrossValidationHelper
                .crossValidateCompareStrategy(compareStrategy, crossValidationStorageEntry, targetEntry, true);
    }
View Full Code Here

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

        String targetProperty = targetKey;

        String sourceKey = resolveSourceKey(crossValidationStorageEntry);
        targetKey = sourceKey.substring(0, sourceKey.lastIndexOf(".") + 1) + targetKey;

        ProcessedInformationStorageEntry validationTargetEntry = CrossValidationUtils.resolveValidationTargetEntry(
                processedInformationStorage, targetKey, crossValidationStorageEntry);

        if (validationTargetEntry != null && validationTargetEntry.getComponent() != null && !isModelAwareValidation)
        {
            processCrossComponentValidation(compareStrategy, crossValidationStorageEntry, validationTargetEntry);
        }
        //no target - because there is no target component - value was validated against the model
        else if(isModelAwareValidation)
View Full Code Here

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

    private void processModelAwareCrossValidation(
            AbstractCompareStrategy compareStrategy,
            CrossValidationStorageEntry crossValidationStorageEntry,
            String targetProperty)
    {
        ProcessedInformationStorageEntry targetEntry = new ProcessedInformationStorageEntry();

        targetEntry.setBean(
                crossValidationStorageEntry.getMetaDataEntry()
                        .getProperty(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class).getBaseObject());
        targetEntry
                .setConvertedValue(getValueOfProperty(targetEntry.getBean(), targetProperty));

        CrossValidationHelper
                .crossValidateCompareStrategy(compareStrategy, crossValidationStorageEntry, targetEntry, true);
    }
View Full Code Here

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

            CrossValidationStorageEntry crossValidationStorageEntry,
            ValueBindingExpression validationTarget,
            CrossValidationStorage crossValidationStorage,
            AbstractCompareStrategy compareStrategy)
    {
        ProcessedInformationStorageEntry validationTargetEntry =
                resolveTargetForCrossComponentValidation(crossValidationStorageEntry, validationTarget);

        if(validationTargetEntry != null)
        {
            processCrossComponentValidation(compareStrategy, crossValidationStorageEntry, validationTargetEntry);
View Full Code Here

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

            ValueBindingExpression validationTarget)
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Object targetValue = ExtValUtils.getELHelper().getValueOfExpression(facesContext, validationTarget);

        ProcessedInformationStorageEntry targetEntry = new ProcessedInformationStorageEntry();
        targetEntry.setBean(
                ExtValUtils.getELHelper().getValueOfExpression(facesContext, validationTarget.getBaseExpression()));
        targetEntry.setConvertedValue(targetValue);

        CrossValidationHelper
                .crossValidateCompareStrategy(compareStrategy, crossValidationStorageEntry, targetEntry, true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.