|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.brownell.xml.Resolver
Utility implementation of a SAX resolver, which can be used to improve network utilization of SAX based XML (especially XHTML) components.
Constructor Summary | |
Resolver(java.util.Dictionary dict)
Constructs a resolver which understands how to map PUBLIC identifiers to other URIs, typically for local copies of standard DTD components. |
Method Summary | |
static void |
addDirectoryMapping(java.util.Dictionary table,
java.lang.String[][] mappings,
java.io.File directory)
Updates a dictionary used to map PUBLIC identifiers to file names, so that it uses the mappings in a specified directory. |
static Resolver |
createXhtmlResolver(java.lang.String directoryPath)
Constructs a resolver that uses the specified local directory to cache the XHTML 1.0 DTD components. |
static java.lang.String |
fileNameToURL(java.lang.String filename)
Provides the URL for a named file, without relying on the JDK 1.2 File.toURL () utility method. |
static java.lang.String |
fileToURL(java.io.File f)
Provides the URL for a file, without relying on the JDK 1.2 File.toURL () utility method. |
static java.lang.String |
getEncoding(java.lang.String contentType)
This parses most MIME content type strings that have charset=... encoding declarations to and returns the specified encoding. |
static java.lang.String |
getURL(java.lang.String fileOrURL)
Returns a URL string. |
InputSource |
resolveEntity(java.lang.String pubid,
java.lang.String sysid)
Uses a local dictionary of public identifiers to resolve URIs, normally with the goal of minimizing network traffic or latencies. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Resolver(java.util.Dictionary dict)
dictionary
- maps PUBLIC identifiers to URIs. This is not
copied; subsequent modifications will be reported through the
resolution operations.Method Detail |
public static Resolver createXhtmlResolver(java.lang.String directoryPath) throws java.io.IOException
directoryPath
- pathname to a copy of those DTD componentspublic static void addDirectoryMapping(java.util.Dictionary table, java.lang.String[][] mappings, java.io.File directory) throws java.io.IOException
mappings
- Array of string pairs, where the first member
of each pair is a PUBLIC identifier and the second is the
name of a file, relative to the specified directory.directory
- File holding the specified files.public static java.lang.String fileNameToURL(java.lang.String filename) throws java.io.IOException
File.toURL
() utility method.filename
- the file name to convert. Relative file names
are resolved the way the JVM resolves them (current to the
process-global current working directory).public static java.lang.String fileToURL(java.io.File f) throws java.io.IOException
File.toURL
() utility method.f
- the file to convert. Relative file names
are resolved the way the JVM resolves them (current to the
process-global current working directory).public static java.lang.String getURL(java.lang.String fileOrURL)
fileOrURL
- If this is the name of a file which exists,
then its URL is returned. Otherwise the argument is returned.public static java.lang.String getEncoding(java.lang.String contentType)
contentType
- the MIME content type that will be parsed; must
not be null.public InputSource resolveEntity(java.lang.String pubid, java.lang.String sysid) throws java.io.IOException, SAXException
publicId
- The public identifier of the external entity
being referenced, or null if none was supplied.systemId
- The system identifier of the external entity
being referenced.InputSource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |