Examples of PropertyInformation


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

        /*
         * get bean class and property name
         */
        Class entityClass = ProxyUtils.getUnproxiedClass(propertyDetails.getBaseObject().getClass());

        PropertyInformation propertyInformation = getPropertyInformation(entityClass, propertyDetails);

        logger.finest("extract finished");

        return propertyInformation;
    }
View Full Code Here

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

    protected PropertyInformation getPropertyInformation(Class entityClass, PropertyDetails propertyDetails)
    {
        MetaDataStorage storage = getMetaDataStorage();

        PropertyInformation propertyInformation = new DefaultPropertyInformation();

        if (isCached(storage, entityClass, propertyDetails.getProperty()))
        {
            //create
            propertyInformation.setInformation(PropertyInformationKeys.PROPERTY_DETAILS, propertyDetails);

            for (MetaDataEntry metaDataEntry : getCachedMetaData(storage, entityClass, propertyDetails.getProperty()))
            {
                propertyInformation.addMetaDataEntry(metaDataEntry);
            }
        }
        else
        {
            propertyInformation = ExtValAnnotationUtils.extractAnnotations(entityClass, propertyDetails);
View Full Code Here

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

     * @return a datastructure which contains all information about the target-property
     */
    @ToDo(value = Priority.HIGH, description = "add cache")
    public static PropertyInformation extractAnnotations(Class entityClass, PropertyDetails propertyDetails)
    {
        PropertyInformation propertyInformation = new DefaultPropertyInformation();
        propertyInformation.setInformation(PropertyInformationKeys.PROPERTY_DETAILS, propertyDetails);

        PropertyStorage storage = ReflectionUtils.getPropertyStorage();

        while (!Object.class.getName().equals(entityClass.getName()))
        {
View Full Code Here

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

    protected void processValidation(FacesContext facesContext, UIComponent uiComponent, Object convertedObject)
    {
        MetaDataExtractor metaDataExtractor = ExtValUtils
                .getComponentMetaDataExtractorWith(getPropertiesForComponentMetaDataExtractor(uiComponent));

        PropertyInformation propertyInformation = metaDataExtractor.extract(facesContext, uiComponent);

        try
        {
            logger.finest("start validation");
View Full Code Here

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

    @Override
    @ToDo(Priority.MEDIUM)
    public PropertyInformation extract(FacesContext facesContext, Object object)
    {
        PropertyInformation propertyInformation = new DefaultPropertyInformation();

        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());

        //TODO test with complex components
        propertyInformation.setInformation(
            PropertyInformationKeys.PROPERTY_DETAILS, propertyDetails);

        /*
         * find and add annotations
         */
 
View Full Code Here

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

    {
        return new MetaDataExtractor()
        {
            public PropertyInformation extract(FacesContext facesContext, Object object)
            {
                PropertyInformation result = metaDataExtractor.extract(facesContext, object);

                addProperties(result, properties);
                invokeMetaDataExtractionInterceptors(result, properties);

                return result;
View Full Code Here

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

    private class StaticSyntaxMetaDataExtractor extends DefaultComponentMetaDataExtractor
    {
        public PropertyInformation extract(Class targetClass, String targetProperty)
        {
            PropertyInformation propertyInformation = new DefaultPropertyInformation();

            PropertyStorage storage = ReflectionUtils.getPropertyStorage();
            addPropertyAccessAnnotations(storage, targetClass, targetProperty, propertyInformation);
            addFieldAccessAnnotations(storage, targetClass, targetProperty, propertyInformation);
View Full Code Here

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

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

        PropertyInformation propertyInformation = extractFromMappedConstraintSource(originalPropertyDetail);

        if (propertyInformation == null)
        {
            // No @ConstraintSource or alike so nothing to do.
            return Collections.emptyMap();
View Full Code Here

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

    @Test
    public void testCustomComponentMetaDataExtractorClassNameDefault()
    {
        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
        MetaDataExtractor extractor = factory.create();
        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
        // Object isn't allowed so we get an empty propertyInformation object
        // back.
        // The web.xml and custom config sets an extractor that enters something
        // here.
        Assert.assertNull(propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
    }
View Full Code Here

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

    @Test
    public void testCustomComponentMetaDataExtractorClassNameWebXml()
    {
        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
        MetaDataExtractor extractor = factory.create();
        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
        Assert.assertEquals(WEB_XML, propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
    }
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.