KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > refactoring > EntityAnnotationReference


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.j2ee.refactoring;
21
22 import org.netbeans.jmi.javamodel.Annotation;
23 import org.netbeans.jmi.javamodel.AttributeValue;
24 import org.netbeans.jmi.javamodel.Feature;
25 import org.netbeans.jmi.javamodel.JavaClass;
26
27 /**
28  * This class represents an annotation reference to an entity.
29  *
30  * @author Erno Mononen
31  */

32 public class EntityAnnotationReference {
33     
34     /**
35      * The attribute value that references other entity.
36      */

37     private AttributeValue attributeValue;
38     /**
39      * Referencing annotation.
40      */

41     private Annotation annotation;
42     /**
43      * The entity that has the feature with referencing annotation.
44      */

45     private JavaClass referring;
46     /**
47      * The entity that is referenced.
48      */

49     private JavaClass referenced;
50     
51     /**
52      * The feature (field or method) that has the referencing annotation.
53      */

54     private Feature referringProperty;
55     /**
56      * Creates a new instance of EntityAssociation
57      * @param referenced the entity that is referenced.
58      * @param referring the entity that has the property with referencing annotation.
59      * @param property the property that hat the referencing annotation.
60      * @param annotation the referencing annotation
61      * @param attributeValue the attribute value of the annotation that references other entity
62      */

63     public EntityAnnotationReference(JavaClass referenced, JavaClass referring, Feature property,
64             Annotation annotation, AttributeValue attributeValue) {
65         this.referenced = referenced;
66         this.referring = referring;
67         this.referringProperty = property;
68         this.annotation = annotation;
69         this.attributeValue = attributeValue;
70     }
71     
72     /**
73      * @see #attributeValue
74      */

75     public AttributeValue getAttributeValue() {
76         return attributeValue;
77     }
78     
79     /**
80      * @see #annotation
81      */

82     public Annotation getAnnotation() {
83         return annotation;
84     }
85
86     /**
87      * @see #referringProperty
88      */

89     public Feature getReferringProperty() {
90         return referringProperty;
91     }
92
93
94     /**
95      * @see #referring
96      */

97     public JavaClass getReferring() {
98         return referring;
99     }
100     
101     /**
102      * @see #referenced
103      */

104     public JavaClass getReferenced(){
105         return referenced;
106     }
107 }
108
Popular Tags