KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > jmi > javamodel > Resource


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.jmi.javamodel;
21
22 /**
23  * Resource object instance interface.
24  * Class representing a metadata source (source or class file).
25  *
26  * <p><em><strong>Note:</strong> This type should not be subclassed or implemented
27  * by clients. It is generated from a MOF metamodel and automatically implemented
28  * by MDR (see <a HREF="http://mdr.netbeans.org/">mdr.netbeans.org</a>).</em></p>
29  */

30 public interface Resource extends org.netbeans.jmi.javamodel.NamedElement {
31     /**
32      * @return
33      */

34     public java.lang.String JavaDoc getSourceText();
35     /**
36      * @param identifier
37      * @return
38      */

39     public boolean containsIdentifier(java.lang.String JavaDoc identifier);
40     /**
41      * @return
42      */

43     public int getStatus();
44     /**
45      * @return
46      */

47     public java.util.List JavaDoc getErrors();
48     /**
49      * Returns element at a given offset in the source file.
50      * @param offset
51      * @return Returns element at a given offset in the source file.
52      */

53     public org.netbeans.jmi.javamodel.Element getElementByOffset(int offset);
54     /**
55      * Returns list of all classes that contain main method - i.e. are runnable.
56      * The primary class (class with the same name as the resource) is the first
57      * one in the list (if applicable).
58      * @return Returns list of all classes that contain main method - i.e. are
59      * runnable. The primary class (class with the same name as the resource)
60      * is the first one in the list (if applicable).
61      */

62     public java.util.List JavaDoc getMain();
63     /**
64      * Adds a new {@link Import} into this resource. This method ensures that
65      * the imports are sorted correctly and that an import is not present twice
66      * in the resource. The method may also convert class import to package import
67      * and do other import optimizations.
68      * The method returns true if the set of imports in the resource was chang
69      * ed as a result of this operation. Otherwise (if the import was already pr
70      * esent) it returns false.
71      * @param importToAdd Import to be added to resource.
72      * @return Adds a new {@link Import} into this resource. This method ensures
73      * that the imports are sorted correctly and that an import is not present
74      * twice in the resource. The method may also convert class import to package
75      * import and do other import optimizations.
76      * The method returns true if the set of imports in the resource was changed
77      * as a result of this operation. Otherwise (if the import was already pres
78      * ent) it returns false.
79      */

80     public boolean addImport(org.netbeans.jmi.javamodel.Import importToAdd);
81     /**
82      * Returns the value of attribute timestamp.
83      * Timestamp of the resource.
84      * @return Value of attribute timestamp.
85      */

86     public long getTimestamp();
87     /**
88      * Sets the value of timestamp attribute. See {@link #getTimestamp} for description
89      * on the attribute.
90      * @param newValue New value to be set.
91      */

92     public void setTimestamp(long newValue);
93     /**
94      * Returns the value of attribute classifiers.
95      * List of classifiers defined in this resource.
96      * @return Value of classifiers attribute. Element type: {@link org.netbeans.jmi.javamodel.JavaClass}
97      */

98     public java.util.List JavaDoc/*<org.netbeans.jmi.javamodel.JavaClass>*/ getClassifiers();
99     /**
100      * Returns the value of attribute imports.
101      * List of imports declared in this resource.
102      * @return Value of imports attribute. Element type: {@link org.netbeans.jmi.javamodel.Import}
103      */

104     public java.util.List JavaDoc/*<org.netbeans.jmi.javamodel.Import>*/ getImports();
105     /**
106      * Returns the value of attribute packageName.
107      * Package associated with this resource (using package keyword).
108      * @return Value of attribute packageName.
109      */

110     public java.lang.String JavaDoc getPackageName();
111     /**
112      * Sets the value of packageName attribute. See {@link #getPackageName} for
113      * description on the attribute.
114      * @param newValue New value to be set.
115      */

116     public void setPackageName(java.lang.String JavaDoc newValue);
117     /**
118      * Returns the value of attribute packageIdentifier.
119      * @return Value of attribute packageIdentifier.
120      */

121     public org.netbeans.jmi.javamodel.MultipartId getPackageIdentifier();
122     /**
123      * Sets the value of packageIdentifier attribute. See {@link #getPackageIdentifier}
124      * for description on the attribute.
125      * @param newValue New value to be set.
126      */

127     public void setPackageIdentifier(org.netbeans.jmi.javamodel.MultipartId newValue);
128     /**
129      * Returns the value of attribute packageAnnotations.
130      * @return Value of packageAnnotations attribute. Element type: {@link org.netbeans.jmi.javamodel.Annotation}
131      */

132     public java.util.List JavaDoc/*<org.netbeans.jmi.javamodel.Annotation>*/ getPackageAnnotations();
133 }
134
Popular Tags