org.openide.util 8.15.1

org.openide.xml
Class EntityCatalog

java.lang.Object
  extended by org.openide.xml.EntityCatalog
All Implemented Interfaces:
EntityResolver

public abstract class EntityCatalog
extends Object
implements EntityResolver

Entity resolver resolving all entities registered by modules. Use getDefault() to get the master instance in system. Any parser working with unknown XML documents should use it to avoid unnecessary Internet connections.

You can register your own instances via lookup to add to the resolver pool, but for reasons of performance and predictability during startup it is best to provide the entity (e.g. some DTD you define) as the contents of a file in the system filesystem, in the /xml/entities/ folder, where the file path beneath this folder is based on the public ID as follows:

  1. US-ASCII alphanumeric characters and '_' are left as is.
  2. Spaces and various punctuation are converted to '_' (one per character).
  3. Initial '-//' is dropped.
  4. Final '//EN' is dropped.
  5. Exactly two forward slashes in a row are converted to one.
Thus for example the public ID -//NetBeans//Entity Mapping Registration 1.0//EN would be looked for in the file /xml/entities/NetBeans/Entity_Mapping_Registration_1_0. Naturally this only works if you are defining a fixed number of entities.

It is recommended that the entity file in /xml/entities/ also be given a file attribute named hint.originalPublicID with a string value giving the public ID. This permits org.netbeans.modules.xml.catalog to display the entry properly.


Field Summary
static String PUBLIC_ID
          Deprecated. Better to register entities individually by layer as described in class documentation.
 
Constructor Summary
protected EntityCatalog()
          Default constructor for subclasses (generally discouraged).
 
Method Summary
static EntityCatalog getDefault()
          Get a master entity catalog which can delegate to any others that have been registered via lookup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.EntityResolver
resolveEntity
 

Field Detail

PUBLIC_ID

@Deprecated
public static final String PUBLIC_ID
Deprecated. Better to register entities individually by layer as described in class documentation.
DOCTYPE public ID defining grammar used for entity registrations. XML files matching this ID produce an instance of EntityCatalog, so could be registered under Services.

See Also:
Constant Field Values
Constructor Detail

EntityCatalog

protected EntityCatalog()
Default constructor for subclasses (generally discouraged).

Method Detail

getDefault

public static EntityCatalog getDefault()
Get a master entity catalog which can delegate to any others that have been registered via lookup.


org.openide.util 8.15.1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.