org.eclipse.xtext.common.types.JvmAnnotationTarget Java Examples

The following examples show how to use org.eclipse.xtext.common.types.JvmAnnotationTarget. 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: XtendValidator.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void checkDeprecated(XImportDeclaration decl) {
	XtendFile file = EcoreUtil2.getContainerOfType(decl, XtendFile.class);
	if (file != null) {
		for (XtendTypeDeclaration t : file.getXtendTypes()) {
			
			for (EObject e : jvmModelAssociations.getJvmElements(t)) {
				if  (e instanceof JvmAnnotationTarget) {
					if (DeprecationUtil.isDeprecated((JvmAnnotationTarget) e)) {
						return;
					}
				}
			}
			
			if (hasAnnotation(t, Deprecated.class)) {
				return;
			}
		}
	}
	super.checkDeprecated(decl);
}
 
Example #2
Source File: JavaInlineExpressionCompiler.java    From sarl with Apache License 2.0 6 votes vote down vote up
@Override
public void appendInlineAnnotation(JvmAnnotationTarget target, XtendExecutable source) {
	final ImportManager imports = new ImportManager();
	final InlineAnnotationTreeAppendable result = newAppendable(imports);
	generate(source.getExpression(), null, source, result);

	final String content = result.getContent();
	if (!Strings.isEmpty(content)) {
		final List<String> importedTypes = imports.getImports();
		final JvmTypeReference[] importArray = new JvmTypeReference[importedTypes.size()];
		for (int i = 0; i < importArray.length; ++i) {
			importArray[i] = this.typeReferences.getTypeForName(importedTypes.get(i), source);
		}
		appendInlineAnnotation(target, source.eResource().getResourceSet(), content,
				result.isConstant(), result.isStatement(), importArray);
	}
}
 
Example #3
Source File: AbstractTypeProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public JvmAnnotationValue getConstructorParameterAnnotationValue(String name, boolean defaultValue) {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(0);
	JvmAnnotationValue result = getDefaultOrExplicitAnnotationValue(name, target);
	if (defaultValue) {
		if (isDefaultValueSupported()) {
			assertTrue(result.eContainer() instanceof JvmOperation);
		} else {
			assertFalse(result.eContainer() instanceof JvmOperation);
		}
	} else {
		assertFalse(result.eContainer() instanceof JvmOperation);
	}
	return result;
}
 
Example #4
Source File: SARLJvmModelInferrer.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Add annotation safely.
 *
 * <p>This function creates an annotation reference. If the type for the annotation is not found;
 * no annotation is added.
 *
 * @param target the receiver of the annotation.
 * @param annotationType the type of the annotation.
 * @param value the annotations value.
 * @return the annotation reference or {@code null} if the annotation cannot be added.
 */
private JvmAnnotationReference addAnnotationSafe(JvmAnnotationTarget target, Class<?> annotationType, int value) {
	assert target != null;
	assert annotationType != null;
	try {
		final JvmAnnotationReference result = this.typesFactory.createJvmAnnotationReference();
		final JvmType jvmType = this.typeReferences.findDeclaredType(annotationType, target);
		if (jvmType == null) {
			return null;
		}
		if (!(jvmType instanceof JvmAnnotationType)) {
			return null;
		}
		result.setAnnotation((JvmAnnotationType) jvmType);
		final JvmIntAnnotationValue annotationValue = this.typesFactory.createJvmIntAnnotationValue();
		annotationValue.getValues().add(value);
		result.getExplicitValues().add(annotationValue);
		if (target.getAnnotations().add(result)) {
			return result;
		}
	} catch (IllegalArgumentException exception) {
		// Ignore
	}
	return null;
}
 
Example #5
Source File: AbstractTypeProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public JvmAnnotationValue getMethodParameterAnnotationValue(String name, boolean defaultValue) {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmOperation method = getMethodFromType(type, TestAnnotation.Annotated.class,
			"method(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = method.getParameters().get(0);
	JvmAnnotationValue result = getDefaultOrExplicitAnnotationValue(name, target);
	if (defaultValue) {
		if (isDefaultValueSupported()) {
			assertTrue(result.eContainer() instanceof JvmOperation);
		} else {
			assertFalse(result.eContainer() instanceof JvmOperation);
		}
	} else {
		assertFalse(result.eContainer() instanceof JvmOperation);
	}
	return result;
}
 
Example #6
Source File: SARLJvmModelInferrer.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Add annotation safely.
 *
 * <p>This function creates an annotation reference. If the type for the annotation is not found;
 * no annotation is added.
 *
 * @param target the receiver of the annotation.
 * @param annotationType the type of the annotation.
 * @param values the annotations values.
 * @return the annotation reference or {@code null} if the annotation cannot be added.
 */
private JvmAnnotationReference addAnnotationSafe(JvmAnnotationTarget target, Class<?> annotationType, String... values) {
	assert target != null;
	assert annotationType != null;
	try {
		final JvmAnnotationReference annotationRef = this._annotationTypesBuilder.annotationRef(annotationType, values);
		if (annotationRef != null) {
			if (target.getAnnotations().add(annotationRef)) {
				return annotationRef;
			}
		}
	} catch (IllegalArgumentException exception) {
		// Ignore
	}
	return null;
}
 
Example #7
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
public JvmAnnotationValue getMethodParameterAnnotationValue(String name, boolean defaultValue) {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmOperation method = getMethodFromType(type, TestAnnotation.Annotated.class,
			"method(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = method.getParameters().get(0);
	JvmAnnotationValue result = getDefaultOrExplicitAnnotationValue(name, target);
	if (defaultValue) {
		if (isDefaultValueSupported()) {
			assertTrue(result.eContainer() instanceof JvmOperation);
		} else {
			assertFalse(result.eContainer() instanceof JvmOperation);
		}
	} else {
		assertFalse(result.eContainer() instanceof JvmOperation);
	}
	return result;
}
 
Example #8
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
public JvmAnnotationValue getConstructorParameterAnnotationValue(String name, boolean defaultValue) {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(0);
	JvmAnnotationValue result = getDefaultOrExplicitAnnotationValue(name, target);
	if (defaultValue) {
		if (isDefaultValueSupported()) {
			assertTrue(result.eContainer() instanceof JvmOperation);
		} else {
			assertFalse(result.eContainer() instanceof JvmOperation);
		}
	} else {
		assertFalse(result.eContainer() instanceof JvmOperation);
	}
	return result;
}
 
Example #9
Source File: XbaseHoverDocumentationProvider.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
protected void addAnnotations(EObject object) {
	List<JvmAnnotationReference> annotations = Lists.newArrayList();
	if(object instanceof JvmAnnotationTarget) {
		annotations.addAll(((JvmAnnotationTarget) object).getAnnotations());
	} else {
		Set<EObject> jvmElements = associations.getJvmElements(object);
		if (jvmElements.size() > 0) {
			EObject associatedElement = Lists.newArrayList(jvmElements).get(0);
			if (associatedElement instanceof JvmAnnotationTarget) {
				annotations.addAll(((JvmAnnotationTarget) associatedElement).getAnnotations());
			}
		}
	}
	for (JvmAnnotationReference annotationReference : annotations) {
		if (!typeExtensions.isSynthetic(annotationReference)) {
			buffer.append(annotationValuePrinter.toHtmlString(annotationReference));
			buffer.append("<br>");
		}
	}

}
 
Example #10
Source File: SARLTypeComputer.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Replies if ambiguity could be removed for the given feature.
 *
 * @param candidate the candidate.
 * @return {@code true} if ambiguity could be removed.
 */
@SuppressWarnings({"checkstyle:npathcomplexity", "checkstyle:cyclomaticcomplexity"})
protected boolean isIgnorableCallToFeature(ILinkingCandidate candidate) {
	final JvmIdentifiableElement feature = candidate.getFeature();
	//
	// @Deprecated
	//
	if (feature instanceof JvmOperation) {
		JvmAnnotationTarget target = (JvmOperation) feature;
		JvmAnnotationReference reference = this.annotationLookup.findAnnotation(target, Deprecated.class);
		if (reference == null) {
			do {
				target = EcoreUtil2.getContainerOfType(target.eContainer(), JvmAnnotationTarget.class);
				if (target != null) {
					reference = this.annotationLookup.findAnnotation(target, Deprecated.class);
				}
			} while (reference == null && target != null);
		}
		if (reference != null) {
			return true;
		}
	}
	return false;
}
 
Example #11
Source File: SARLJvmModelInferrer.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Copy the annotations, except the ones given as parameters.
 *
 * @param annotations the annotations to copy.
 * @param target the target.
 * @param exceptions the annotations to skip.
 */
@SuppressWarnings("static-method")
protected void translateAnnotationsTo(List<JvmAnnotationReference> annotations, JvmAnnotationTarget target,
		Class<?>... exceptions) {
	final Set<String> excepts = new HashSet<>();
	for (final Class<?> type : exceptions) {
		excepts.add(type.getName());
	}
	final List<JvmAnnotationReference> addition = new ArrayList<>();
	for (final JvmAnnotationReference annotation : Iterables.filter(annotations, an -> {
		if (!ANNOTATION_TRANSLATION_FILTER.apply(an)) {
			return false;
		}
		return !excepts.contains(an.getAnnotation().getIdentifier());
	})) {
		addition.add(annotation);
	}
	target.getAnnotations().addAll(addition);
}
 
Example #12
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
public JvmAnnotationValue getConstructorParameterAnnotationValue(String name, boolean defaultValue) {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(0);
	JvmAnnotationValue result = getDefaultOrExplicitAnnotationValue(name, target);
	if (defaultValue) {
		if (isDefaultValueSupported()) {
			assertTrue(result.eContainer() instanceof JvmOperation);
		} else {
			assertFalse(result.eContainer() instanceof JvmOperation);
		}
	} else {
		assertFalse(result.eContainer() instanceof JvmOperation);
	}
	return result;
}
 
Example #13
Source File: XtendHighlightingCalculator.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void highlightAnnotation(XAnnotation annotation, IHighlightedPositionAcceptor acceptor) {
	JvmType annotationType = annotation.getAnnotationType();
	if (annotationType instanceof JvmAnnotationTarget) {
		for(JvmAnnotationReference annotationReference: ((JvmAnnotationTarget) annotationType).getAnnotations()) {
			JvmAnnotationType otherAnnotation = annotationReference.getAnnotation();
			if (otherAnnotation != null && !otherAnnotation.eIsProxy() && Active.class.getName().equals(otherAnnotation.getIdentifier())) {
				highlightAnnotation(annotation, acceptor, ACTIVE_ANNOTATION);
				return;
			}
		}
	}
	super.highlightAnnotation(annotation, acceptor);
}
 
Example #14
Source File: SARLAnnotationUtil.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Find an annotation.
 *
 * @param annotationTarget the annotation target.
 * @param lookupType the name of the type to look for.
 * @return the annotation or {@code null}.
 * @see AnnotationLookup#findAnnotation(JvmAnnotationTarget, Class)
 */
@SuppressWarnings("static-method")
public JvmAnnotationReference findAnnotation(JvmAnnotationTarget annotationTarget, String lookupType) {
	// avoid creating an empty list for all given targets but check for #eIsSet first
	if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) {
		for (final JvmAnnotationReference annotation: annotationTarget.getAnnotations()) {
			final JvmAnnotationType annotationType = annotation.getAnnotation();
			if (annotationType != null && Objects.equals(lookupType, annotationType.getQualifiedName())) {
				return annotation;
			}
		}
	}
	return null;
}
 
Example #15
Source File: AbstractTypeProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testAnnotatedParameter_03() throws Exception {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmAnnotationType annotationType = (JvmAnnotationType) getTypeProvider()
			.findTypeByName(TestAnnotation.NestedAnnotation.class.getName());
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(2);
	assertEquals(1, target.getAnnotations().size());
	JvmAnnotationReference annotationReference = target.getAnnotations().get(0);
	assertSame(annotationType, annotationReference.getAnnotation());
}
 
Example #16
Source File: AbstractTypeProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testAnnotatedParameter_02() throws Exception {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(1);
	assertEquals(0, target.getAnnotations().size());
}
 
Example #17
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationValue getConstructorParameterAnnotationValue(String name) {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(0);
	return getExplicitAnnotationValue(name, target);
}
 
Example #18
Source File: AbstractTypeProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationValue getExplicitAnnotationValue(String name, JvmAnnotationTarget target) {
	JvmAnnotationReference annotationReference = target.getAnnotations().get(0);
	for (JvmAnnotationValue value : annotationReference.getExplicitValues()) {
		if (name.equals(value.getValueName()))
			return value;
	}
	fail("Cannot find annotationValue " + name);
	return null;
}
 
Example #19
Source File: SARLAnnotationUtil.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Extract the string values of the given annotation, if they exist.
 *
 * @param op the annotated element.
 * @param annotationType the type of the annotation to consider
 * @return the values of the annotation, never {@code null}.
 */
public List<String> findStringValues(JvmAnnotationTarget op, Class<? extends Annotation> annotationType) {
	final JvmAnnotationReference reference = this.lookup.findAnnotation(op, annotationType);
	if (reference != null) {
		return findStringValues(reference);
	}
	return null;
}
 
Example #20
Source File: AnnotationLookup.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationReference removeAnnotation(/* @NonNull */ JvmAnnotationTarget annotationTarget, /* @NonNull */ Class<? extends Annotation> type) {
	JvmAnnotationReference result = findAnnotation(annotationTarget, type);
	if (result != null) {
		annotationTarget.getAnnotations().remove(result);
		return result;
	}
	return null;
}
 
Example #21
Source File: AbstractTypeProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationValue getDefaultOrExplicitAnnotationValue(String name, JvmAnnotationTarget target) {
	JvmAnnotationReference annotationReference = target.getAnnotations().get(0);
	for (JvmAnnotationValue value : annotationReference.getValues()) {
		if (name.equals(value.getValueName()))
			return value;
	}
	fail("Cannot find annotationValue " + name);
	return null;
}
 
Example #22
Source File: AnnotationLookup.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationReference findAnnotation(/* @NonNull */ JvmAnnotationTarget annotationTarget, /* @NonNull */ String lookupType) {
	// avoid creating an empty list for all given targets but check for #eIsSet first
	if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) {
		for(JvmAnnotationReference annotation: annotationTarget.getAnnotations()) {
			JvmAnnotationType annotationType = annotation.getAnnotation();
			if (annotationType != null && lookupType.equals(annotationType.getQualifiedName())) {
				return annotation;
			}
		}
	}
	return null;
}
 
Example #23
Source File: DeprecationUtil.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.13
 */
public static boolean isTransitivelyDeprecated(JvmAnnotationTarget jvmAnnotationTarget) {
	if (jvmAnnotationTarget instanceof JvmMember) {
		return isTransitivelyDeprecatedMember((JvmMember) jvmAnnotationTarget);
	}
	return false;
}
 
Example #24
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testAnnotatedParameter_06() throws Exception {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmAnnotationType annotationType = (JvmAnnotationType) getTypeProvider()
			.findTypeByName(TestAnnotation.NestedAnnotation.class.getName());
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmOperation method = getMethodFromType(type, TestAnnotation.Annotated.class,
			"method(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = method.getParameters().get(2);
	assertEquals(1, target.getAnnotations().size());
	JvmAnnotationReference annotationReference = target.getAnnotations().get(0);
	assertSame(annotationType, annotationReference.getAnnotation());
}
 
Example #25
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testAnnotatedParameter_05() throws Exception {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmOperation method = getMethodFromType(type, TestAnnotation.Annotated.class,
			"method(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = method.getParameters().get(1);
	assertEquals(0, target.getAnnotations().size());
}
 
Example #26
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testAnnotatedParameter_03() throws Exception {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmAnnotationType annotationType = (JvmAnnotationType) getTypeProvider()
			.findTypeByName(TestAnnotation.NestedAnnotation.class.getName());
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(2);
	assertEquals(1, target.getAnnotations().size());
	JvmAnnotationReference annotationReference = target.getAnnotations().get(0);
	assertSame(annotationType, annotationReference.getAnnotation());
}
 
Example #27
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testAnnotatedParameter_02() throws Exception {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmConstructor constructor = getConstructorFromType(type, TestAnnotation.Annotated.class,
			"Annotated(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = constructor.getParameters().get(1);
	assertEquals(0, target.getAnnotations().size());
}
 
Example #28
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationValue getExplicitAnnotationValue(String name, JvmAnnotationTarget target) {
	JvmAnnotationReference annotationReference = target.getAnnotations().get(0);
	for (JvmAnnotationValue value : annotationReference.getExplicitValues()) {
		if (name.equals(value.getValueName()))
			return value;
	}
	fail("Cannot find annotationValue " + name);
	return null;
}
 
Example #29
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationValue getDefaultOrExplicitAnnotationValue(String name, JvmAnnotationTarget target) {
	JvmAnnotationReference annotationReference = target.getAnnotations().get(0);
	for (JvmAnnotationValue value : annotationReference.getValues()) {
		if (name.equals(value.getValueName()))
			return value;
	}
	fail("Cannot find annotationValue " + name);
	return null;
}
 
Example #30
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public JvmAnnotationValue getMethodParameterAnnotationValue(String name) {
	String typeName = TestAnnotation.Annotated.class.getName();
	JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName(typeName);
	JvmOperation method = getMethodFromType(type, TestAnnotation.Annotated.class,
			"method(java.lang.String,java.lang.String,java.lang.String)");
	JvmAnnotationTarget target = method.getParameters().get(0);
	return getExplicitAnnotationValue(name, target);
}