public static ProcessedInformationStorageEntry resolveValidationTargetEntry()

in validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/util/CrossValidationUtils.java [60:100]


    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;
            }
        }

        return null;
    }