org.apache.avalon.excalibur.catalog
Class CatalogEntry

java.lang.Object
  |
  +--org.apache.avalon.excalibur.catalog.CatalogEntry

public class CatalogEntry
extends java.lang.Object

Represents an OASIS Open Catalog entry.

Instances of this class represent individual entries from an OASIS Open Catalog file.

While this could have been implemented as a base class with a separate subclass for each type of catalog entry, it didn't seem to be worth the extra overhead.

Version:
1.0
Author:
Arbortext, Inc., Norman Walsh
See Also:
Catalog

Field Summary
static int BASE
          The entry type for a BASE entry
static int CATALOG
          The entry type for a CATALOG entry
static int DELEGATE
          The entry type for a DELEGATE entry
static int DOCTYPE
          The entry type for a DOCTYPE entry
static int DOCUMENT
          The entry type for a DOCUMENT entry
static int DTDDECL
          The entry type for a DTDDECL entry
static int ENTITY
          The entry type for a ENTITY entry
static int LINKTYPE
          The entry type for a LINKTYPE entry
static int NOTATION
          The entry type for a NOTATION entry
static int OVERRIDE
          The entry type for a OVERRIDE entry
static int PUBLIC
          The entry type for a PUBLIC entry
static int SGMLDECL
          The entry type for a SGMLDECL entry
static int SYSTEM
          The entry type for a SYSTEM entry
 
Constructor Summary
CatalogEntry(int type, java.lang.String spec)
           Construct a catalog entry of the specified type.
CatalogEntry(int type, java.lang.String spec, java.lang.String fsispec)
           Construct a catalog entry of the specified type.
 
Method Summary
 java.lang.String entityName()
           The entity name
 int entryType()
           The entry type
 java.lang.String formalSystemIdentifier()
           The formal system identifier of the entry, if appropriate
 java.lang.String partialPublicId()
           The partial public identifier of a DELEGATE entry.
 java.lang.String publicId()
           The public identifier
 java.lang.String systemId()
           The system identifier
 void updateFormalSystemIdentifier(java.lang.String newspec)
           Update the formal system identifier
 java.lang.String yes_or_no()
           The argument, YES or NO, of an OVERRIDE entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE

public static final int BASE
The entry type for a BASE entry

CATALOG

public static final int CATALOG
The entry type for a CATALOG entry

DOCUMENT

public static final int DOCUMENT
The entry type for a DOCUMENT entry

OVERRIDE

public static final int OVERRIDE
The entry type for a OVERRIDE entry

SGMLDECL

public static final int SGMLDECL
The entry type for a SGMLDECL entry

DELEGATE

public static final int DELEGATE
The entry type for a DELEGATE entry

DOCTYPE

public static final int DOCTYPE
The entry type for a DOCTYPE entry

DTDDECL

public static final int DTDDECL
The entry type for a DTDDECL entry

ENTITY

public static final int ENTITY
The entry type for a ENTITY entry

LINKTYPE

public static final int LINKTYPE
The entry type for a LINKTYPE entry

NOTATION

public static final int NOTATION
The entry type for a NOTATION entry

PUBLIC

public static final int PUBLIC
The entry type for a PUBLIC entry

SYSTEM

public static final int SYSTEM
The entry type for a SYSTEM entry
Constructor Detail

CatalogEntry

public CatalogEntry(int type,
                    java.lang.String spec)
             throws InvalidCatalogEntryTypeException,
                    InvalidCatalogEntryException

Construct a catalog entry of the specified type. The two-argument form of the constructor can be used for BASE, CATALOG, DOCUMENT, OVERRIDE, and SGMLDECL entries.

Parameters:
type - The entry type.
spec - The argument to the entry, a formal system identifier in all cases except OVERRIDE when it must be either "yes" or "no".
Throws:
InvalidCatalogEntryTypeException - DOC: Insert Description of Exception
InvalidCatalogEntryException - DOC: Insert Description of Exception

CatalogEntry

public CatalogEntry(int type,
                    java.lang.String spec,
                    java.lang.String fsispec)
             throws InvalidCatalogEntryTypeException,
                    InvalidCatalogEntryException

Construct a catalog entry of the specified type. The three-argument form of the constructor can be used for DELEGATE, DOCTYPE, DTDDECL, ENTITY, LINKTYPE, NOTATION, PUBLIC, and SYSTEM entries.

Parameters:
type - The entry type.
spec - DOC: Insert Description of Parameter
fsispec - DOC: Insert Description of Parameter
Throws:
InvalidCatalogEntryTypeException - DOC: Insert Description of Exception
InvalidCatalogEntryException - DOC: Insert Description of Exception
Method Detail

entryType

public int entryType()

The entry type

Returns:
The entry type

formalSystemIdentifier

public java.lang.String formalSystemIdentifier()

The formal system identifier of the entry, if appropriate

Returns:
The FSI for the entry, or null if it has no FSI.

yes_or_no

public java.lang.String yes_or_no()

The argument, YES or NO, of an OVERRIDE entry.

Returns:
The YES or NO setting of an OVERRIDE entry, null otherwise.

partialPublicId

public java.lang.String partialPublicId()

The partial public identifier of a DELEGATE entry.

Returns:
The partial public identifier of a DELEGATE entry, null otherwise.

entityName

public java.lang.String entityName()

The entity name

Returns:
The entity name of a DOCTYPE, ENTITY, LINKTYPE, or NOTATION entry, null otherwise.

publicId

public java.lang.String publicId()

The public identifier

Returns:
The public identifier of a DTDDECL or PUBLIC entry, null otherwise.

systemId

public java.lang.String systemId()

The system identifier

Returns:
The system identifier of a SYSTEM entry, null otherwise.

updateFormalSystemIdentifier

public void updateFormalSystemIdentifier(java.lang.String newspec)

Update the formal system identifier

The FSI initial specified in an entry may be relative (to the location of the catalog file or as modified by a BASE entry). A system processing catalog files (e.g. com.arbortext.catalog.Catalog), must be able to update the FSI in order to change it from a relative location to an absolute one.

Parameters:
newspec - The new FSI


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.