protected void processProperty(String beanName, BeanDefinition definition, PropertyDescriptor descriptor) throws BeansException {
        Method method = descriptor.getWriteMethod();
        if (method != null) {
            // TODO should we handle the property.name() attribute?
            // maybe add this to XBean code generator...
            Property property = method.getAnnotation(Property.class);
            if (property != null) {
                if (property.required()) {
                    // TODO use property.name()?
                    String propertyName = descriptor.getName();
                    MutablePropertyValues propertyValues = definition.getPropertyValues();
                    if (!propertyValues.contains(propertyName)) {
                        throw new BeanInitializationException("Mandatory property: " + propertyName + " not specified on bean: " + beanName);
                    }
                }
            }
            Reference reference = method.getAnnotation(Reference.class);
            if (reference != null) {
                if (reference.required()) {
                    // TODO use reference.name()?
                    String propertyName = descriptor.getName();
                    MutablePropertyValues propertyValues = definition.getPropertyValues();
                    if (!propertyValues.contains(propertyName)) {
                        throw new BeanInitializationException("Mandatory reference: " + propertyName + " not specified on bean: " + beanName);
                    }
                }
            }
        }
    }
protected void processProperty(String beanName, BeanDefinition definition, PropertyDescriptor descriptor) throws BeansException {
        Method method = descriptor.getWriteMethod();
        if (method != null) {
           
           
            Property property = method.getAnnotation(Property.class);
            if (property != null) {
                if (property.required()) {
                   
                    String propertyName = descriptor.getName();
                    MutablePropertyValues propertyValues = definition.getPropertyValues();
                    if (!propertyValues.contains(propertyName)) {
                        throw new BeanInitializationException("Mandatory property: " + propertyName + " not specified on bean: " + beanName);
                    }
                }
            }
            Reference reference = method.getAnnotation(Reference.class);
            if (reference != null) {
                if (reference.required()) {
                   
                    String propertyName = descriptor.getName();
                    MutablePropertyValues propertyValues = definition.getPropertyValues();
                    if (!propertyValues.contains(propertyName)) {
                        throw new BeanInitializationException("Mandatory reference: " + propertyName + " not specified on bean: " + beanName);
                    }
                }
            }
        }
    }
protected void processproperty(string beanname, beandefinition definition, propertydescriptor descriptor) throws beansexception { method method = descriptor.getwritemethod(); if (method != null) { property property = method.getannotation(property.class); if (property != null) { if (property.required()) { string propertyname = descriptor.getname(); mutablepropertyvalues propertyvalues = definition.getpropertyvalues(); if (!propertyvalues.contains(propertyname)) { throw new beaninitializationexception("mandatory property: " + propertyname + " not specified on bean: " + beanname); } } } reference reference = method.getannotation(reference.class); if (reference != null) { if (reference.required()) { string propertyname = descriptor.getname(); mutablepropertyvalues propertyvalues = definition.getpropertyvalues(); if (!propertyvalues.contains(propertyname)) { throw new beaninitializationexception("mandatory reference: " + propertyname + " not specified on bean: " + beanname); } } } } }