Java Code Examples for org.springframework.core.type.MethodMetadata#isAnnotated()

The following examples show how to use org.springframework.core.type.MethodMetadata#isAnnotated() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnnotationMetadataReadingVisitor.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public boolean hasAnnotatedMethods(String annotationName) {
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			return true;
		}
	}
	return false;
}
 
Example 2
Source File: AnnotationMetadataReadingVisitor.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public Set<MethodMetadata> getAnnotatedMethods(String annotationName) {
	Set<MethodMetadata> annotatedMethods = new LinkedHashSet<>(4);
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			annotatedMethods.add(methodMetadata);
		}
	}
	return annotatedMethods;
}
 
Example 3
Source File: AnnotationMetadataReadingVisitor.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public boolean hasAnnotatedMethods(String annotationName) {
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			return true;
		}
	}
	return false;
}
 
Example 4
Source File: AnnotationMetadataReadingVisitor.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public Set<MethodMetadata> getAnnotatedMethods(String annotationName) {
	Set<MethodMetadata> annotatedMethods = new LinkedHashSet<>(4);
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			annotatedMethods.add(methodMetadata);
		}
	}
	return annotatedMethods;
}
 
Example 5
Source File: AnnotationMetadataReadingVisitor.java    From thinking-in-spring-boot-samples with Apache License 2.0 5 votes vote down vote up
public boolean hasAnnotatedMethods(String annotationType) {
    for (MethodMetadata method : this.methodMetadataSet) {
        if (method.isAnnotated(annotationType)) {
            return true;
        }
    }
    return false;
}
 
Example 6
Source File: AnnotationMetadataReadingVisitor.java    From thinking-in-spring-boot-samples with Apache License 2.0 5 votes vote down vote up
public Set<MethodMetadata> getAnnotatedMethods(String annotationType) {
    Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>();
    for (MethodMetadata method : this.methodMetadataSet) {
        if (method.isAnnotated(annotationType)) {
            annotatedMethods.add(method);
        }
    }
    return annotatedMethods;
}
 
Example 7
Source File: AnnotationMetadataReadingVisitor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean hasAnnotatedMethods(String annotationName) {
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			return true;
		}
	}
	return false;
}
 
Example 8
Source File: AnnotationMetadataReadingVisitor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<MethodMetadata> getAnnotatedMethods(String annotationName) {
	Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>(4);
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			annotatedMethods.add(methodMetadata);
		}
	}
	return annotatedMethods;
}
 
Example 9
Source File: AnnotationMetadataReadingVisitor.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
public boolean hasAnnotatedMethods(String annotationName) {
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			return true;
		}
	}
	return false;
}
 
Example 10
Source File: AnnotationMetadataReadingVisitor.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
public Set<MethodMetadata> getAnnotatedMethods(String annotationName) {
	Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>(4);
	for (MethodMetadata methodMetadata : this.methodMetadataSet) {
		if (methodMetadata.isAnnotated(annotationName)) {
			annotatedMethods.add(methodMetadata);
		}
	}
	return annotatedMethods;
}
 
Example 11
Source File: CustomScopeAnnotationConfigurer.java    From joinfaces with Apache License 2.0 5 votes vote down vote up
protected String deduceScopeName(MethodMetadata factoryMethodMetadata) {
	if (getAnnotationToScopeMappings() == null) {
		return null;
	}

	for (AnnotationToScopeMapping annotationToScopeMapping : getAnnotationToScopeMappings()) {
		if (factoryMethodMetadata.isAnnotated(annotationToScopeMapping.getAnnotation().getName())) {
			return annotationToScopeMapping.getScope();
		}
	}

	return null;
}