Package org.richfaces.cdk.apt.SourceUtils

Examples of org.richfaces.cdk.apt.SourceUtils.BeanProperty


                || attribute.getName().contains(" ")) {
            log.error("Invalid attribute name [" + attribute.getName() + "]");
            return;
        }
        // Check type
        BeanProperty beanProperty = findBeanProperty(attribute, component);
        if (null == attribute.getType()) {
            log.warn("Unknown type of attribute [" + attribute.getName() + "]");
            attribute.setType(beanProperty.getType());
        }
        if (attribute.getType().isPrimitive() && null == attribute.getDefaultValue()) {
            // Set default value for primitive
            attribute.setDefaultValue(attribute.getType().getDefaultValue());
        }
        // Check binding properties.
        if ("javax.faces.el.MethodBinding".equals(attribute.getType().getName())) {
            attribute.setBinding(true);
            attribute.setBindingAttribute(true);
        } else if ("javax.el.MethodExpression".equals(attribute.getType().getName())) {
            attribute.setBindingAttribute(true);
        }
        // if(attribute.isBindingAttribute() && attribute.getSignature().isEmpty() && !attribute.isHidden()) {
        // log.error("Signature for method expression attribute "+attribute.getName()+" has not been set");
        // }
        // Check "generate" flag.
        if (Boolean.TRUE.equals(component.getGenerate())) {
            // TODO Attribute should be only generated if it does not exist or abstract in the base class.
            // Step one - check base class
            if (SPECIAL_PROPERTIES.contains(attribute.getName())) {
                attribute.setGenerate(false);
            } else if (null == attribute.getGenerate()) {
                attribute.setGenerate(!beanProperty.isExists());
            }
        } else {
            attribute.setGenerate(false);
        }
        verifyDescription(attribute);
View Full Code Here


        verifyDescription(attribute);
    }

    private BeanProperty findBeanProperty(PropertyBase attribute, GeneratedFacesComponent component) {
        SourceUtils sourceUtils = sourceUtilsProvider.get();
        BeanProperty beanProperty = sourceUtils.getBeanProperty(component.getBaseClass(), attribute.getName());
        if (beanProperty instanceof DummyPropertyImpl && component instanceof ComponentModel) {
            ComponentModel model = (ComponentModel) component;
            if (null != model.getParent()) {
                beanProperty = findBeanProperty(attribute, model.getParent());
            }
View Full Code Here

TOP

Related Classes of org.richfaces.cdk.apt.SourceUtils.BeanProperty

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.