KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > editor > completion > AnnotationUtils


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.editor.completion;
21
22 import java.util.Iterator JavaDoc;
23 import java.util.List JavaDoc;
24 // Retouche
25
//import org.netbeans.jmi.javamodel.Annotation;
26
//import org.netbeans.jmi.javamodel.AttributeValue;
27
//import org.netbeans.jmi.javamodel.InitialValue;
28
//import org.netbeans.jmi.javamodel.JavaClass;
29
//import org.netbeans.jmi.javamodel.StringLiteral;
30

31 /**
32  *
33  * @author Andrei Badea
34  */

35 public class AnnotationUtils {
36     
37     private AnnotationUtils() {
38         assert false;
39     }
40 // Retouche
41
// // XXX maybe just put this in JMIUtils
42
//
43
// public static Annotation getAnnotationByTypeName(JavaClass cls, String typeName) {
44
// assert cls != null;
45
// assert typeName != null;
46
//
47
// for (Iterator i = cls.getAnnotations().iterator(); i.hasNext();) {
48
// Annotation annotation = (Annotation)i.next();
49
// if (typeName.equals(annotation.getType().getName())) {
50
// return annotation;
51
// }
52
// }
53
//
54
// return null;
55
// }
56
//
57
// /**
58
// * Returns an annotation member value when this value is a string literal.
59
// */
60
// public static String getStringMemberValue(Annotation annotation, String memberName) {
61
// assert annotation != null;
62
// assert memberName != null;
63
//
64
// for (Iterator i = annotation.getAttributeValues().iterator(); i.hasNext();) {
65
// AttributeValue attr = (AttributeValue)i.next();
66
// if (memberName.equals(attr.getDefinition().getName())) {
67
// InitialValue value = attr.getValue();
68
// if (value instanceof StringLiteral) {
69
// return ((StringLiteral)value).getValue();
70
// }
71
// }
72
// }
73
//
74
// return null;
75
// }
76
//
77
// /**
78
// * Returns an annotation member value when this value is an array of annotations.
79
// */
80
// public static List/*<Annotation>*/ getAnnotationsMemberValue(Annotation annotation, String memberName) {
81
// throw new org.openide.util.NotImplementedException("Not implemented because of missing test data due to issue 70701"); // NOI18N
82

83 // assert annotation != null;
84
// assert memberName != null;
85
//
86
// List result = new ArrayList();
87
//
88
// for (Iterator i = annotation.getAttributeValues().iterator(); i.hasNext();) {
89
// AttributeValue attr = (AttributeValue)i.next();
90
// if (memberName.equals(attr.getDefinition().getName())) {
91
//
92
// }
93
// }
94
//
95
// return Collections.EMPTY_LIST;
96
// }
97
}
98
Popular Tags