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

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


    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 String resolveSourceKey(CrossValidationStorageEntry crossValidationStorageEntry)
    {
        PropertyDetails propertyDetails = crossValidationStorageEntry.getMetaDataEntry()
                .getProperty(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);

        String sourceKey = propertyDetails.getKey();

        if(!sourceKey.contains("."))
        {
            throw new IllegalStateException("source path: " + sourceKey + " invalid");
        }
View Full Code Here

    private PropertyInformation createPropertyInformation(
            ModelValidationEntry modelValidationEntry, Object validationTarget, ELHelper elHelper)
    {
        PropertyInformation propertyInformation;
        PropertyDetails propertyDetails;
        propertyInformation = new DefaultPropertyInformation();
        if (modelValidationEntry.getComponent() != null)
        {
            propertyDetails = elHelper.getPropertyDetailsOfValueBinding(modelValidationEntry.getComponent());
        }
        else
        {
            propertyDetails = new PropertyDetails(null, validationTarget, null);
        }
        propertyInformation.setInformation(PropertyInformationKeys.PROPERTY_DETAILS, propertyDetails);
        return propertyInformation;
    }
View Full Code Here

        if (!(object instanceof PropertyDetails))
        {
            throw new IllegalStateException(object.getClass() + " is not a " + PropertyDetails.class.getName());
        }

        PropertyDetails propertyDetails = (PropertyDetails)object;

        Class entityClass = ProxyUtils.getUnproxiedClass(propertyDetails.getBaseObject().getClass());

        return extractAnnotations(entityClass, propertyDetails);
    }
View Full Code Here

        else if (foundGroups.length == 0)
        {
            foundGroups = new Class[]{Default.class};
        }

        PropertyDetails constraintSourcePropertyDetails = resolveMappedConstraintSourceFor(
                propertyDetails.getKey(), propertyDetails.getBaseObject().getClass(), propertyDetails.getProperty());

        if(constraintSourcePropertyDetails == null)
        {
            return;
        }

        ElementDescriptor elementDescriptor =
                BeanValidationUtils.getElementDescriptor((Class) constraintSourcePropertyDetails.getBaseObject(),
                        constraintSourcePropertyDetails.getProperty());

        if (elementDescriptor == null)
        {
            return;
        }
View Full Code Here

    {
        Class baseBeanClass = this.bviUtils.getBaseClassType(propertyInformation);
        String propertyName = this.bviUtils.getPropertyToValidate(propertyInformation);
        String originalKey = getKey(propertyInformation);

        PropertyDetails constraintSourcePropertyDetails =
                resolveMappedConstraintSourceFor(originalKey, baseBeanClass, propertyName);

        if(constraintSourcePropertyDetails == null)
        {
            return Collections.emptySet();
        }

        baseBeanClass = (Class) constraintSourcePropertyDetails.getBaseObject();
        propertyName = constraintSourcePropertyDetails.getProperty();

        Class[] groups = this.bviUtils.resolveGroups(facesContext, uiComponent);

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

    }

    @Override
    protected boolean hasBeanValidationConstraints(PropertyInformation propertyInformation)
    {
        PropertyDetails propertyDetails = propertyInformation.getInformation(
                PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);

        return this.csaBviUtils.resolveMappedConstraintSourceFor(propertyDetails.getKey(),
                                                              propertyDetails.getBaseObject().getClass(),
                                                              propertyDetails.getProperty()) != null;
    }
View Full Code Here

    }

    PropertyDetails extractPropertyDetails(
            FacesContext facesContext, UIComponent uiComponent, Map<String, Object> propertiesForExtraction)
    {
        PropertyDetails result = getComponentMetaDataExtractor(propertiesForExtraction)
                .extract(facesContext, uiComponent)
                .getInformation(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);

        if (result.getBaseObject() == null)
        {
            this.logger.warning("no base object at " + result.getKey() +
                    " component-id: " + uiComponent.getClientId(facesContext));
        }

        return result.getBaseObject() != null ? result : null;
    }
View Full Code Here

        return result;
    }

    boolean hasBeanValidationConstraints(PropertyInformation propertyInformation)
    {
        PropertyDetails propertyDetails = ExtValUtils.getPropertyDetails(propertyInformation);

        Class targetClass = ProxyUtils.getUnproxiedClass(propertyDetails.getBaseObject().getClass());

        return BeanValidationUtils.getElementDescriptor(targetClass, propertyDetails.getProperty()) != null;
    }
View Full Code Here

    protected void initComponent(FacesContext facesContext, UIComponent uiComponent)
    {
        logger.finest("start to init component " + uiComponent.getClass().getName());

        PropertyDetails propertyDetails = bviUtils.extractPropertyDetails(
                facesContext, uiComponent, getPropertiesForComponentMetaDataExtractor(uiComponent));

        if (propertyDetails != null)
        {
            initComponentWithPropertyDetails(facesContext, uiComponent, propertyDetails);
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.