XML Entity Catalog SPI
Maintainer: Petr Kuzel
Updated on: 31st June 2001
SPI Overview
The SPI is very simple, there is only one mandatory interface
to be implemented. Then the implementation must be integrated
with IDE.
SPI Implementator Guide
Every SPI implementation must implement interface
{@link org.netbeans.modules.xml.catalog.spi.CatalogReader CatalogReader}
allowing quering catalog for entries, refreshing its content and optionaly
listening on its content.
An SPI implementation should implement following interfaces:
- {@link org.netbeans.modules.xml.catalog.spi.CatalogDescriptor CatalogDescriptor} describing catalog instance
- {@link org.netbeans.modules.xml.catalog.spi.CatalogWriter CatalogWriter} allowing to modify catalog entries
- SAX's org.xml.sax.EntityResolver if it can resolve more complicated cases than public => system ID mappings
NetBeans IDE Platform Integration
An SPI implementation can register its availability using NetBeans Lookup.
A module providing a new SPI implementation registers its avaiability using
{@link org.netbeans.modules.xml.catalog.spi.CatalogProvider CatalogProvider}
instance (declared at its XML Layer):
<folder name="Services">
<folder name="Hidden">
<file name="my-company-netbeans-catalog-impl-MyProvider.instance" />
</filder>
</folder>
Where my.company.netbeans.catalog.impl.MyProvider public no-arg constructor
class implements the CatalogProvider interface.
Using CatalogProvider just provides a kind of factory, so that the user can add one or more
instances of the catalog at will. You may instead register a CatalogReader instance directly in
your layer in the folder Plugins/XML/UserCatalogs/ ; such catalogs will be preinstalled and not
deletable.
Forte for Java 3.0 Specifics Feature
If a catalog implements Serializable interface then
its mounting point is persistent among IDE restarts. In such case it is
highly recommended to explicitly declare serialVersionUID field.
|