Code example for ClassPathBeanDefinitionScanner

Methods: isCandidateComponent

0
		this.descriptor = descriptor;
	} 
 
	@Override 
	protected boolean isCandidateComponent(final MetadataReader metadataReader) throws IOException {
		return super.isCandidateComponent(metadataReader) && matchesAlfrescoVersion(metadataReader);
	} 
 
	private boolean matchesAlfrescoVersion(final MetadataReader metadataReader) {
		boolean matches = true;
		final AnnotationMetadata metadata = metadataReader.getAnnotationMetadata();
		if (metadata.isAnnotated(AlfrescoPlatform.class.getName())) {
			final Map<String, Object> alfrescoVersion = metadata.getAnnotationAttributes(AlfrescoPlatform.class
					.getName());
			final String minVersion = (String) alfrescoVersion.get("minVersion");
			final String maxVersion = (String) alfrescoVersion.get("maxVersion");
			final VersionNumber versionNumber = descriptor.getVersionNumber();
			if (StringUtils.hasText(minVersion) && versionNumber.compareTo(new VersionNumber(minVersion)) < 0) {
				matches = false;
			} else if (StringUtils.hasText(maxVersion) && versionNumber.compareTo(new VersionNumber(maxVersion)) > 0) {
Connect your IDE to all the code out there  Get Codota for Java