001: /*****************************************************************************
002: * Java Plug-in Framework (JPF)
003: * Copyright (C) 2004-2007 Dmitry Olshansky
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *****************************************************************************/package org.java.plugin.registry;
019:
020: import java.net.URL;
021: import java.util.Collection;
022:
023: /**
024: * Main interface to get access to all meta-information for particular
025: * plug-in, described in plug-in manifest file.
026: * <p>
027: * Plug-in UID is a combination of plug-in ID and version identifier that is
028: * unique within whole set of registered plug-ins.
029: * </p>
030: * @see <a href="{@docRoot}/../plugin_1_0.dtd">plug-in DTD for standard
031: * registry implementation</a>
032: * @see org.java.plugin.registry.PluginRegistry
033: * @version $Id$
034: */
035: public interface PluginDescriptor extends UniqueIdentity,
036: Documentable<PluginDescriptor> {
037: /**
038: * @return vendor as specified in manifest file or empty string
039: */
040: String getVendor();
041:
042: /**
043: * @return plug-in version identifier as specified in manifest file
044: */
045: Version getVersion();
046:
047: /**
048: * Returns collection of all top level attributes defined in manifest.
049: * @return collection of {@link PluginAttribute} objects
050: */
051: Collection<PluginAttribute> getAttributes();
052:
053: /**
054: * @param id ID of attribute to look for
055: * @return top level attribute with given ID
056: */
057: PluginAttribute getAttribute(String id);
058:
059: /**
060: * @param id ID of attribute to look for
061: * @return collection of all top level attributes with given ID
062: */
063: Collection<PluginAttribute> getAttributes(String id);
064:
065: /**
066: * Returns collection of all prerequisites defined in manifest.
067: * @return collection of {@link PluginPrerequisite} objects
068: */
069: Collection<PluginPrerequisite> getPrerequisites();
070:
071: /**
072: * @param id prerequisite ID
073: * @return plug-in prerequisite object instance or <code>null</code>
074: */
075: PluginPrerequisite getPrerequisite(String id);
076:
077: /**
078: * Returns collection of all extension points defined in manifest.
079: * @return collection of {@link ExtensionPoint} objects
080: */
081: Collection<ExtensionPoint> getExtensionPoints();
082:
083: /**
084: * @param id extension point ID
085: * @return extension point object or <code>null</code>
086: */
087: ExtensionPoint getExtensionPoint(String id);
088:
089: /**
090: * Returns collection of all extensions defined in manifest.
091: * @return collection of {@link Extension} objects
092: */
093: Collection<Extension> getExtensions();
094:
095: /**
096: * @param id extension ID
097: * @return extension object or <code>null</code>
098: */
099: Extension getExtension(String id);
100:
101: /**
102: * Returns collection of all libraries defined in manifest.
103: * @return collection of {@link Library} objects
104: */
105: Collection<Library> getLibraries();
106:
107: /**
108: * @param id library ID
109: * @return library object or <code>null</code>
110: */
111: Library getLibrary(String id);
112:
113: /**
114: * @return plug-ins registry
115: */
116: PluginRegistry getRegistry();
117:
118: /**
119: * @return plug-in class name as specified in manifest file or
120: * <code>null</code>
121: */
122: String getPluginClassName();
123:
124: /**
125: * Returns collection of plug-in fragments which contributes to this
126: * plug-in. One plug-in fragment may contribute to several versions of the
127: * same plug-in, according to it's manifest.
128: * @return collection of {@link PluginFragment} objects
129: */
130: Collection<PluginFragment> getFragments();
131:
132: /**
133: * @return location from which this plug-in was registered
134: */
135: URL getLocation();
136: }
|