// TODO use reference.name()?
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);
                    }
                }
            }
        }
    }
if (reference != null) {
if (reference.required()) {
// TODO use reference.name()?
String propertyName = descriptor.getName();
MutablePropertyValues propertyValues = definition.getPropertyValues();
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) {
// 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);
}
}
}
}
}