Examples of PropertyInformation


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

            addPropertyAccessAnnotations(targetClass, targetProperty, propertyInformation);
            addFieldAccessAnnotations(targetClass, targetProperty, propertyInformation);

            return propertyInformation;
View Full Code Here

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

    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.
        assertNull(propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
    }
View Full Code Here

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

    public void testCustomComponentMetaDataExtractorClassNameWebXml()
    {
        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
        MetaDataExtractor extractor = factory.create();
        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
        assertEquals(WEB_XML, propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
    }
View Full Code Here

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

    public void testCustomComponentMetaDataExtractorClassNameCustomConfig()
    {
        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
        MetaDataExtractor extractor = factory.create();
        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
        assertEquals(CUSTOM_CONFIG, propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
    }
View Full Code Here

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

    public static class CustomMetaDataExtractor implements MetaDataExtractor
    {

        public PropertyInformation extract(FacesContext facesContext, Object object)
        {
            PropertyInformation result = new DefaultPropertyInformation();
            result.setInformation(PropertyInformationKeys.CUSTOM_PROPERTIES, WEB_XML);
            return result;
        }
View Full Code Here

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

    public static class CustomMetaDataExtractor2 implements MetaDataExtractor
    {

        public PropertyInformation extract(FacesContext facesContext, Object object)
        {
            PropertyInformation result = new DefaultPropertyInformation();
            result.setInformation(PropertyInformationKeys.CUSTOM_PROPERTIES, CUSTOM_CONFIG);
            return result;
        }
View Full Code Here

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

                                            List<ModelValidationEntry> modelValidationEntryList,
                                            List<Class> restrictedGroupsForModelValidation,
                                            boolean processModelValidation,
                                            boolean isLastProperty)
    {
        PropertyInformation propertyInformation = new DefaultGroupControllerScanningExtractor()
                .extract(FacesContext.getCurrentInstance(), new PropertyDetails(key, base, property));

        for (MetaDataEntry metaDataEntry : propertyInformation.getMetaDataEntries())
        {
            if (metaDataEntry.getValue() instanceof BeanValidation)
            {
                tryToProcessMetaData((BeanValidation) metaDataEntry.getValue(),
                        tryToCreateNewTarget(base, property, isLastProperty),
View Full Code Here

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

        PropertyDetails propertyDetails = (PropertyDetails)object;

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

        PropertyInformation propertyInformation = new DefaultPropertyInformation();
        propertyInformation.setInformation(PropertyInformationKeys.PROPERTY_DETAILS, propertyDetails);

        extractAnnotations(propertyInformation, propertyDetails, entityClass);

        return propertyInformation;
    }
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
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.