Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to use IAnnotation.getMemberValuePairs()?
How to use IAnnotation.getMemberValuePairs()? [message #257991] Thu, 08 January 2009 12:10 Go to next message
Eclipse UserFriend
I'm trying to analyze an annotation in a source file, I retrieve the
annotation using IType.getAnnotation then I try
annotation.getMemberValuePairs() and blam:
Java Model Exception: Java Model Status [@org.testng.annotations.Test
[in Tester [in [Working copy] Tester.java [in nrc.test [in src [in
TestJavaProject]]]]] does not exist]
at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentExcep tion(JavaElement.java:491)
at
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(Jav aElement.java:525)
at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(Jav aElement.java:251)
at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(Jav aElement.java:237)
at
org.eclipse.jdt.internal.core.Annotation.getMemberValuePairs (Annotation.java:54)
at
org.testng.eclipse.launch.components.InternalAnnotationVisit or.analyzeAnnotation(InternalAnnotationVisitor.java:33)

This doesn't make any sense to me because the annotation is contained in
a jar that belongs to the referenced libraries.
Re: How to use IAnnotation.getMemberValuePairs()? [message #258025 is a reply to message #257991] Fri, 09 January 2009 16:54 Go to previous message
Eclipse UserFriend
Figured this one out, getAnnotation(name) creates an empty annotation.
IType.getAnnotations returns the annotations found by the parser.

Erik.

Erik Putrycz wrote:
> I'm trying to analyze an annotation in a source file, I retrieve the
> annotation using IType.getAnnotation then I try
> annotation.getMemberValuePairs() and blam:
> Java Model Exception: Java Model Status [@org.testng.annotations.Test
> [in Tester [in [Working copy] Tester.java [in nrc.test [in src [in
> TestJavaProject]]]]] does not exist]
> at
> org.eclipse.jdt.internal.core.JavaElement.newNotPresentExcep tion(JavaElement.java:491)
>
> at
> org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(Jav aElement.java:525)
>
> at
> org.eclipse.jdt.internal.core.JavaElement.getElementInfo(Jav aElement.java:251)
>
> at
> org.eclipse.jdt.internal.core.JavaElement.getElementInfo(Jav aElement.java:237)
>
> at
> org.eclipse.jdt.internal.core.Annotation.getMemberValuePairs (Annotation.java:54)
>
> at
> org.testng.eclipse.launch.components.InternalAnnotationVisit or.analyzeAnnotation(InternalAnnotationVisitor.java:33)
>
>
> This doesn't make any sense to me because the annotation is contained in
> a jar that belongs to the referenced libraries.
Previous Topic:Finding packages with same name in different source folders
Next Topic:Duplicate conflicting class definitions in different files gives confusing error messages in client
Goto Forum:
  


Current Time: Sun Apr 20 03:56:20 EDT 2025

Powered by FUDForum. Page generated in 0.03328 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top