/** * Performs validation. * * @param type the component type * @param context the context */ private void validate(SpringComponentType type, IntrospectionContext context, Location location) { Collection<ReferenceDefinition> references = type.getReferences().values(); for (ReferenceDefinition reference : references) { String defaultStr = ((SpringReferenceDefinition) reference).getDefaultValue(); if (defaultStr != null) { if (!type.getBeansById().containsKey(defaultStr) && !type.getBeansByName().containsKey(defaultStr)) { InvalidValue error = new InvalidValue("Default value '" + defaultStr + "' does not reference a valid bean", location, type); context.addError(error); } } } if (strictValidation) { // SCA spec validation if (type.getSpringServices().isEmpty()) { // if no services defined, check remotables for (BeanDefinition beanDefinition : type.getBeansByName().values()) { validateBean(type, beanDefinition, context, location); } for (BeanDefinition beanDefinition : type.getBeansById().values()) { validateBean(type, beanDefinition, context, location); } } } }
/** * Performs validation. * * @param type the component type * @param context the context */ private void validate(SpringComponentType type, IntrospectionContext context, Location location) { Collection<Reference<ComponentType>> references = type.getReferences().values(); for (Reference reference : references) { String defaultStr = ((SpringReference) reference).getDefaultValue(); if (defaultStr != null) { if (!type.getBeansById().containsKey(defaultStr) && !type.getBeansByName().containsKey(defaultStr)) { InvalidValue error = new InvalidValue("Default value '" + defaultStr + "' does not reference a valid bean", location, type); context.addError(error); } } } if (strictValidation) { // SCA spec validation if (type.getSpringServices().isEmpty()) { // if no services defined, check remotables for (BeanDefinition beanDefinition : type.getBeansByName().values()) { validateBean(type, beanDefinition, context, location); } for (BeanDefinition beanDefinition : type.getBeansById().values()) { validateBean(type, beanDefinition, context, location); } } } }
/** * Performs validation. * * @param type the component type * @param context the context */ private void validate(SpringComponentType type, IntrospectionContext context, Location location) { Collection<Reference<ComponentType>> references = type.getReferences().values(); for (Reference reference : references) { String defaultStr = ((SpringReference) reference).getDefaultValue(); if (defaultStr != null) { if (!type.getBeansById().containsKey(defaultStr) && !type.getBeansByName().containsKey(defaultStr)) { InvalidValue error = new InvalidValue("Default value '" + defaultStr + "' does not reference a valid bean", location, type); context.addError(error); } } } if (strictValidation) { // SCA spec validation if (type.getSpringServices().isEmpty()) { // if no services defined, check remotables for (BeanDefinition beanDefinition : type.getBeansByName().values()) { validateBean(type, beanDefinition, context, location); } for (BeanDefinition beanDefinition : type.getBeansById().values()) { validateBean(type, beanDefinition, context, location); } } } }