Package org.apache.myfaces.extensions.validator.core.property

Examples of org.apache.myfaces.extensions.validator.core.property.PropertyDetails


            return null;
        }

        String newProperty = findMappedProperty(propertyStorage, originalClass, newClass, originalProperty);

        PropertyDetails result = new PropertyDetails(originalKey, newClass, newProperty);

        tryToCacheMappedConstraintSourceMetaData(
                mappedConstraintSourceStorage, originalClass, originalProperty, result);

        return result;
View Full Code Here


        {
            ValueBindingExpression vbe = new ValueBindingExpression(targetExpression);

            String expression = vbe.getExpressionString();
            baseObject = getELHelper().getValueOfExpression(FacesContext.getCurrentInstance(), vbe.getBaseExpression());
            return new PropertyDetails(
                    expression.substring(2, expression.length() - 1), baseObject, vbe.getProperty());
        }

        PropertyDetails original = metaDataEntry.getProperty(
                PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);

        String newBaseKey = original.getKey().substring(0, original.getKey().lastIndexOf(".") + 1);
        String newKey = newBaseKey + targetExpression;

        baseObject = ReflectionUtils.getBaseOfPropertyChain(original.getBaseObject(), targetExpression);
        return new PropertyDetails(
                newKey, baseObject, targetExpression.substring(targetExpression.lastIndexOf(".") + 1,
                        targetExpression.length()));
    }
View Full Code Here

    private void processModelAwareCrossValidation(
            AbstractCompareStrategy compareStrategy,
            CrossValidationStorageEntry crossValidationStorageEntry, String targetKey)
    {
        PropertyDetails propertyDetails = crossValidationStorageEntry.getMetaDataEntry()
            .getProperty(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);

        Object newBase = ReflectionUtils
            .getBaseOfPropertyChain(propertyDetails.getBaseObject(), targetKey);

        if(targetKey.contains("."))
        {
            //find the last property
            targetKey = targetKey.substring(targetKey.lastIndexOf(".") + 1, targetKey.length());
View Full Code Here

        }
    }

    private MetaDataEntry[] extractDynamicMetaData(MetaDataEntry metaDataEntry, String target)
    {
        PropertyDetails propertyDetails = ExtValUtils.createPropertyDetailsForNewTarget(metaDataEntry, target);

        Class targetClass = ProxyUtils.getUnproxiedClass(propertyDetails.getBaseObject().getClass());
        return new StaticSyntaxMetaDataExtractor().extract(
                targetClass, propertyDetails.getProperty()).getMetaDataEntries();
    }
View Full Code Here

        extends PropertyValidationModuleValidationInterceptor
{
    @Override
    protected Map<String, Object> getTransformedMetaDataFor(FacesContext facesContext, UIComponent uiComponent)
    {
        PropertyDetails originalPropertyDetail = getELHelper().getPropertyDetailsOfValueBinding(uiComponent);

        PropertyInformation propertyInformation = extractFromMappedConstraintSource(originalPropertyDetail);

        if (propertyInformation == null)
        {
View Full Code Here

    protected void processFieldValidation(FacesContext facesContext,
                                          UIComponent uiComponent,
                                          Object convertedObject,
                                          PropertyInformation propertyInformation)
    {
        PropertyDetails originalPropertyDetail = ExtValUtils.getPropertyDetails(propertyInformation);

        propertyInformation = extractFromMappedConstraintSource(originalPropertyDetail);

        if (propertyInformation != null)
        {
View Full Code Here

        }
    }

    private PropertyInformation extractFromMappedConstraintSource(PropertyDetails originalPropertyDetail)
    {
        PropertyDetails constraintSourcePropertyDetails =
                resolveMappedConstraintSourceFor(originalPropertyDetail.getKey(),
                                                 originalPropertyDetail.getBaseObject().getClass(),
                                                 originalPropertyDetail.getProperty());

        if (constraintSourcePropertyDetails == null)
        {
            return null;
        }

        return ExtValAnnotationUtils.extractAnnotations(
                (Class) constraintSourcePropertyDetails.getBaseObject(), constraintSourcePropertyDetails);
    }
View Full Code Here

        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))
        {
View Full Code Here

        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()))
View Full Code Here

    protected boolean tryToValidateLocally(CrossValidationStorageEntry crossValidationStorageEntry,
                                           CrossValidationStorage crossValidationStorage,
                                           String targetKey,
                                           AbstractCompareStrategy compareStrategy)
    {
        PropertyDetails propertyDetails = crossValidationStorageEntry.getMetaDataEntry()
            .getProperty(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);

        Object newBase = ReflectionUtils
            .getBaseOfPropertyChain(propertyDetails.getBaseObject(), targetKey);

        if(targetKey.contains("."))
        {
            //find the last property
            targetKey = targetKey.substring(targetKey.lastIndexOf(".") + 1, targetKey.length());
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.validator.core.property.PropertyDetails

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.