Package eu.bandm.tools.doctypes
Class DocTypes
java.lang.Object
eu.bandm.tools.doctypes.DocTypes
- All Implemented Interfaces:
URIResolver
,EntityResolver
Used as the carrying class for the java "resource" mechanism,
and as an uri and resource resolver.
In detail it implements both,
URIResolver.resolve(String,String)
and
EntityResolver.resolveEntity(String,String)
A public id (iff present) is matched against this FPI,
If not successful, the system id is matched against the URL
as given in URI_BANDM_DOCTYPES
and URI_HTTP_BANDM_DOCTYPES
.
The text which follows these prefices is interpreted as a file position relative to this class file's containing directory, using the JAVA built-in "Resource" mechanism.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntityResolver
emptyDtds
(@Opt EntityResolver base) Suppresses the loading of any DTD by supplying an empty document for any request with the file extension "dtd".static Location<XMLDocumentIdentifier>
currently only the "system" part is analysed and replaced by the www access.static XMLDocumentIdentifier
currently only the "system" part is analysed and replaced by the www access.Resolve a request for a resource by matching it against the bandm resource URLs.resolve_to_stream
(URI href) FIXME DOC FIXME RAUS use resolve(null,href).getCharacterStream() instead!resolveEntity
(@Opt String publicId, String systemId) Matches something likeprotected @Opt InputSource
protected @Opt InputStream
Iff the href begins with the prefix, then return an input stream, else null.protected @Opt InputSource
-
Field Details
-
URI_BANDM_DOCTYPES
- See Also:
-
URI_HTTP_BANDM_DOCTYPES
- See Also:
-
URI_HTTPS_BANDM_DOCTYPES
- See Also:
-
bandmDoctypes_local
- See Also:
-
meta_module_ns_uri
- See Also:
-
meta_module_name
- See Also:
-
meta_module_tag_nonstructured_target
- See Also:
-
meta_module_tag_inline
- See Also:
-
-
Constructor Details
-
DocTypes
public DocTypes()
-
-
Method Details
-
resolve
Resolve a request for a resource by matching it against the bandm resource URLs. Defined in javax.xml.transform.URIResolver. Only absolute URIs given as href are resolved. The base is ignored.- Specified by:
resolve
in interfaceURIResolver
-
resolve_to_stream
FIXME DOC FIXME RAUS use resolve(null,href).getCharacterStream() instead! -
test_uri
Iff the href begins with the prefix, then return an input stream, else null. The input stream is from the resource with the name of the rest of the href, relative to this class. -
resolveEntity
Matches something likePUBLIC "+//IDN bandm.eu//DTD a/b/c/d.dtd//en//1.0" "" or PUBLIC "+//IDN bandm.eu//DTD a/b/c/d.dtd//en" "" or SYSTEM "http://bandm.eu/doctypes/a/b/c/d.dtd"
and maps it to the resource[classtree]/tools/doctypes/Doctypes.getResource(a/b/c/d.dtd)
Defined in org.xml.sax.EntityResolver Please note that only TEXT documents can be retrieved, and their encoding is fixed to "JAVA UTF_8", which is indeed "CESU-8".- Specified by:
resolveEntity
in interfaceEntityResolver
- Parameters:
publicId
- if != null it will be decoded as described, and the result must match a resource in the class treesystemId
- is only considered if publicId==null, and the result must match a resource in the class tree- Returns:
- null if no bandm-owned resource is meant. In this case the built-in resolver of the parser/caller will make its usual resolution.
- Throws:
IllegalArgumentException
- if the identifier have the prefix of bandm-owned resource ids, but the file ("descriptor") part does not correspond to a reachable resource.
-
xtest_uri
-
test_fpi
-
local2www
currently only the "system" part is analysed and replaced by the www access. (could be stored in the "public" part ?) -
local2www
currently only the "system" part is analysed and replaced by the www access. (could be stored in the "public" part ?) -
emptyDtds
Suppresses the loading of any DTD by supplying an empty document for any request with the file extension "dtd".- Parameters:
base
- the Entity resolver to use for all other requests.
-