public static void checkReferences()

in src/java/org/apache/fulcrum/intake/validator/FieldReference.java [193:236]


    public static <T> void checkReferences(List<FieldReference> fieldReferences, CompareCallback<T> compareCallback,
            T value, Group group)
        throws ValidationException
    {
        for (FieldReference ref : fieldReferences)
        {
            boolean comp_true = true;

            try
            {
                @SuppressWarnings("unchecked")
                Field<T> refField = (Field<T>) group.get(ref.getFieldName());

                if (refField.isSet())
                {
                    /*
                     * Fields are processed in sequence so that our
                     * reference field might have been set but not
                     * yet validated. We check this here.
                     */
                    if (!refField.isValidated())
                    {
                        refField.validate();
                    }

                    if (refField.isValid())
                    {
                        comp_true = compareCallback.compareValues(ref.getComparison(),
                                value,
                                refField.getValue());
                    }
                }
            }
            catch (IntakeException e)
            {
                throw new ValidationException(ref.getMessage());
            }

            if (comp_true == false)
            {
                throw new ValidationException(ref.getMessage());
            }
        }
    }