001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.apisupport.project.universe;
043:
044: import java.io.File;
045: import java.util.Set;
046: import org.netbeans.modules.apisupport.project.ManifestManager;
047:
048: /**
049: * One known module.
050: * Falls into four categories:
051: * <ol>
052: * <li>Modules inside netbeans.org (with source).
053: * <li>Modules with source in an external suite.
054: * <li>Standalone external modules with source.
055: * <li>JARs from a NB binary. May or may not have an associated source dir.
056: * </ol>
057: */
058: public interface ModuleEntry extends Comparable {
059:
060: /**
061: * Get a relative source path inside netbeans.org sources.
062: * Note that if the entry is from netbeans.org yet was scanned as a
063: * side effect of loading an external module that defined netbeans.dest.dir,
064: * this will be null - such secondary entries are essentially based on the
065: * actual JAR, only adding in a non-null {@link #getSourceLocation}.
066: * @return e.g. java/project, or null for external modules
067: */
068: String getNetBeansOrgPath();
069:
070: /**
071: * Get the source location of this module, if there is one.
072: */
073: File getSourceLocation();
074:
075: /**
076: * Get a code name base.
077: * @return e.g. org.netbeans.modules.java.project
078: */
079: String getCodeNameBase();
080:
081: /**
082: * Get the directory to which the module is built.
083: * @return e.g. .../nbbuild/netbeans/ide6
084: */
085: File getClusterDirectory();
086:
087: /**
088: * Get the module JAR file.
089: * @return e.g. .../nbbuild/netbeans/ide6/modules/org-netbeans-modules-java-project.jar
090: */
091: File getJarLocation();
092:
093: /**
094: * Get any added class path entries, as a path suffix (may be empty).
095: */
096: String getClassPathExtensions();
097:
098: /**
099: * Path which resolves to the root of the NetBeans binary installation used for this module.
100: */
101: File getDestDir();
102:
103: /**
104: * Returns either the module release version or <code>null</code> if
105: * there isn't any.
106: */
107: String getReleaseVersion();
108:
109: /**
110: * Returns either the module specification version or <code>null</code>
111: * if there isn't any.
112: */
113: String getSpecificationVersion();
114:
115: /**
116: * Returns array of provided tokens by the module. Can be empty.
117: */
118: String[] getProvidedTokens();
119:
120: /**
121: * Get localized name of this module. Implementations should use
122: * lazy-loading from localizing bundle to keep performance up. If the
123: * localized name is not found <code>getCodeNameBase()</code> is
124: * returned.
125: */
126: String getLocalizedName();
127:
128: /**
129: * Get category of this module. Implementations should use lazy-loading
130: * from localizing bundle to keep performance up.
131: */
132: String getCategory();
133:
134: /**
135: * Get long description of this module. Implementations should use
136: * lazy-loading from localizing bundle to keep performance up.
137: */
138: String getLongDescription();
139:
140: /**
141: * Get short description of this module. Implementations should use
142: * lazy-loading from localizing bundle to keep performance up.
143: */
144: String getShortDescription();
145:
146: /**
147: * Get array of public packages exported by this module entry.
148: * @return array of public packages. May be empty but not <code>null</code>.
149: */
150: ManifestManager.PackageExport[] getPublicPackages();
151:
152: /**
153: * Get a set of names of all <em>nonempty</em> packages this module
154: * contains.
155: */
156: Set<String> getAllPackageNames();
157:
158: /**
159: * Get array of friends of this module.
160: */
161: boolean isDeclaredAsFriend(String cnb);
162:
163: /**
164: * Get a set of class names defined in this module's public packages.
165: */
166: Set<String> getPublicClassNames();
167:
168: /**
169: * Check whether this module is marked as deprecated.
170: */
171: boolean isDeprecated();
172:
173: /**
174: * Get a list of code name bases for modules which this module has (runtime) dependencies on.
175: */
176: String[] getRunDependencies();
177:
178: }
|