|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.resolver.Catalog com.sun.resolver.Resolver
An extension to OASIS Open Catalog files, this class supports suffix-based matching and an external RFC2483 resolver.
Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved. This software is the proprietary information of Sun Microsystems, Inc. Use is subject to license terms.
Catalog
Field Summary | |
static int |
RESOLVER
The RESOLVER Catalog Entry type. |
static int |
SYSTEMREVERSE
The SYSTEMREVERSE Catalog Entry type. |
static int |
SYSTEMSUFFIX
The SYSTEMSUFFIX Catalog Entry type. |
static int |
URISUFFIX
The URISUFFIX Catalog Entry type. |
Fields inherited from class com.sun.resolver.Catalog |
base, BASE, CATALOG, catalogCwd, catalogEntries, catalogFiles, catalogs, default_override, DELEGATE_PUBLIC, DELEGATE_SYSTEM, DELEGATE_URI, DOCTYPE, DOCUMENT, DTDDECL, ENTITY, LINKTYPE, localCatalogFiles, localDelegate, NOTATION, OVERRIDE, PUBLIC, readerArr, readerMap, REWRITE_SYSTEM, REWRITE_URI, SGMLDECL, SYSTEM, URI |
Constructor Summary | |
Resolver()
|
Method Summary | |
void |
addEntry(CatalogEntry entry)
Cleanup and process a Catalog entry. |
protected Resolver |
queryResolver(java.lang.String resolver,
java.lang.String command,
java.lang.String arg1,
java.lang.String arg2)
Query an external RFC2483 resolver. |
java.util.Vector |
resolveAllSystem(java.lang.String systemId)
Return the applicable SYSTEM system identifiers If one or more SYSTEM entries exists in the Catalog for the system ID specified, return the mapped values. |
java.util.Vector |
resolveAllSystemReverse(java.lang.String systemId)
Find the URNs for a given system identifier in all catalogs. |
protected java.lang.String |
resolveExternalPublic(java.lang.String publicId,
java.lang.String resolver)
Query an external RFC2483 resolver for a public identifier. |
protected java.lang.String |
resolveExternalSystem(java.lang.String systemId,
java.lang.String resolver)
Query an external RFC2483 resolver for a system identifier. |
java.lang.String |
resolvePublic(java.lang.String publicId,
java.lang.String systemId)
Return the applicable PUBLIC or SYSTEM identifier, resorting to external resolvers if necessary. |
java.lang.String |
resolveSystem(java.lang.String systemId)
Return the applicable SYSTEM system identifier, resorting to external RESOLVERs if necessary. |
java.lang.String |
resolveSystemReverse(java.lang.String systemId)
Find the URN for a given system identifier. |
java.lang.String |
resolveURI(java.lang.String uri)
Return the applicable URI If a URI entry exists in the Catalog for the URI specified, return the mapped value. |
void |
setupReaders()
Setup readers. |
Methods inherited from class com.sun.resolver.Catalog |
addDelegate, addReader, copyReaders, encodedByte, fixSlashes, getCurrentBase, getDefaultOverride, loadSystemCatalogs, makeAbsolute, newCatalog, normalizeURI, parseAllCatalogs, parseCatalog, parseCatalog, parseCatalog, parseCatalogFile, parsePendingCatalogs, resolveDoctype, resolveDocument, resolveEntity, resolveLocalPublic, resolveLocalSystem, resolveLocalURI, resolveNotation, resolveSubordinateCatalogs, unknownEntry |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int URISUFFIX
The URISUFFIX Catalog Entry type.
URI suffix entries match URIs that end in a specified suffix.
public static final int SYSTEMSUFFIX
The SYSTEMSUFFIX Catalog Entry type.
System suffix entries match system identifiers that end in a specified suffix.
public static final int RESOLVER
The RESOLVER Catalog Entry type.
A hook for providing support for web-based backup resolvers.
public static final int SYSTEMREVERSE
The SYSTEMREVERSE Catalog Entry type.
This is a bit of a hack. There's no actual SYSTEMREVERSE entry, but this entry type is used to indicate that a reverse lookup is being performed. (This allows the Resolver to implement RFC2483 I2N and I2NS.)
Constructor Detail |
public Resolver()
Method Detail |
public void setupReaders()
Setup readers.
setupReaders
in class Catalog
public void addEntry(CatalogEntry entry)
Cleanup and process a Catalog entry.
This method processes each Catalog entry, changing mapped relative system identifiers into absolute ones (based on the current base URI), and maintaining other information about the current catalog.
addEntry
in class Catalog
entry
- The CatalogEntry to process.public java.lang.String resolveURI(java.lang.String uri) throws java.net.MalformedURLException, java.io.IOException
Return the applicable URI
If a URI entry exists in the Catalog for the URI specified, return the mapped value.
In the Resolver (as opposed to the Catalog) class, if the URI isn't found by the usual algorithm, URISUFFIX entries are considered.
URI comparison is case sensitive.
resolveURI
in class Catalog
uri
- The URI to locate in the catalog.
java.net.MalformedURLException
- The system identifier of a
subordinate catalog cannot be turned into a valid URL.
java.io.IOException
- Error reading subordinate catalog file.public java.lang.String resolveSystem(java.lang.String systemId) throws java.net.MalformedURLException, java.io.IOException
Return the applicable SYSTEM system identifier, resorting to external RESOLVERs if necessary.
If a SYSTEM entry exists in the Catalog for the system ID specified, return the mapped value.
In the Resolver (as opposed to the Catalog) class, if the URI isn't found by the usual algorithm, SYSTEMSUFFIX entries are considered.
On Windows-based operating systems, the comparison between the system identifier provided and the SYSTEM entries in the Catalog is case-insensitive.
resolveSystem
in class Catalog
systemId
- The system ID to locate in the catalog.
java.net.MalformedURLException
- The formal system identifier of a
subordinate catalog cannot be turned into a valid URL.
java.io.IOException
- Error reading subordinate catalog file.public java.lang.String resolvePublic(java.lang.String publicId, java.lang.String systemId) throws java.net.MalformedURLException, java.io.IOException
Return the applicable PUBLIC or SYSTEM identifier, resorting to external resolvers if necessary.
This method searches the Catalog and returns the system identifier specified for the given system or public identifiers. If no appropriate PUBLIC or SYSTEM entry is found in the Catalog, null is returned.
Note that a system or public identifier in the current catalog (or subordinate catalogs) will be used in preference to an external resolver. Further, if a systemId is present, the external resolver(s) will be queried for that before the publicId.
resolvePublic
in class Catalog
publicId
- The public identifier to locate in the catalog.
Public identifiers are normalized before comparison.systemId
- The nominal system identifier for the entity
in question (as provided in the source document).
java.net.MalformedURLException
- The formal system identifier of a
subordinate catalog cannot be turned into a valid URL.
java.io.IOException
- Error reading subordinate catalog file.protected java.lang.String resolveExternalSystem(java.lang.String systemId, java.lang.String resolver) throws java.net.MalformedURLException, java.io.IOException
Query an external RFC2483 resolver for a system identifier.
systemId
- The system ID to locate.resolver
- The name of the resolver to use.
java.net.MalformedURLException
java.io.IOException
protected java.lang.String resolveExternalPublic(java.lang.String publicId, java.lang.String resolver) throws java.net.MalformedURLException, java.io.IOException
Query an external RFC2483 resolver for a public identifier.
publicId
- The system ID to locate.resolver
- The name of the resolver to use.
java.net.MalformedURLException
java.io.IOException
protected Resolver queryResolver(java.lang.String resolver, java.lang.String command, java.lang.String arg1, java.lang.String arg2)
Query an external RFC2483 resolver.
resolver
- The URL of the RFC2483 resolver.command
- The command to send the resolver.arg1
- The first argument to the resolver.arg2
- The second argument to the resolver, usually null.
public java.util.Vector resolveAllSystemReverse(java.lang.String systemId) throws java.net.MalformedURLException, java.io.IOException
Find the URNs for a given system identifier in all catalogs.
systemId
- The system ID to locate.
java.net.MalformedURLException
java.io.IOException
public java.lang.String resolveSystemReverse(java.lang.String systemId) throws java.net.MalformedURLException, java.io.IOException
Find the URN for a given system identifier.
systemId
- The system ID to locate.
java.net.MalformedURLException
java.io.IOException
public java.util.Vector resolveAllSystem(java.lang.String systemId) throws java.net.MalformedURLException, java.io.IOException
Return the applicable SYSTEM system identifiers
If one or more SYSTEM entries exists in the Catalog for the system ID specified, return the mapped values.
The caller is responsible for doing any necessary normalization of the system identifier before calling this method. For example, a relative system identifier in a document might be converted to an absolute system identifier before attempting to resolve it.
Note that this function will force all subordinate catalogs to be loaded.
On Windows-based operating systems, the comparison between the system identifier provided and the SYSTEM entries in the Catalog is case-insensitive.
systemId
- The system ID to locate in the catalog.
java.net.MalformedURLException
- The formal system identifier of a
subordinate catalog cannot be turned into a valid URL.
java.io.IOException
- Error reading subordinate catalog file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |