|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.x3d.jaxp.X3DEntityResolver
public class X3DEntityResolver
An entity resolver for both DOM and SAX models of the X3D document.
The entity resolver only handles queries for the DTD. It will find
any URI that ends in *.dtd and return an InputSource.
As the X3D specification does not yet define what the system resource ID is, we'll take a guess. The current resolution scheme only strips the name of the DTD from the URI and attempts to find that in the classpath.
To determine the DTD name it will search from the end of the string until it finds a '/' character. The resulting string is treated as a filename to search for and has the directory DTD/ prepended to the name. This filename is then found in the CLASSPATH used by the application using the standard Java resolution rules. Note that we do not need to implement any more intelligent behaviour than this because if the System or PublicID returned are files or URLs, the standard parser mechanisms will load them. The only more intelligent behaviour that we may wish to add in the future will be to resolve a full URN if we are given it.
The current implementation ignores the publicId information.
| Constructor Summary | |
|---|---|
X3DEntityResolver()
|
|
| Method Summary | |
|---|---|
java.io.InputStream |
resolveDTDFromPublic(java.lang.String id)
Resolve the DTD uri and return an InputStream used by this. |
java.io.InputStream |
resolveDTDFromSystem(java.lang.String uri)
Resolve the DTD uri and return an InputStream used by this. |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolve the combination of system and public identifiers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public X3DEntityResolver()
| Method Detail |
|---|
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
throws java.io.IOException
resolveEntity in interface org.xml.sax.EntityResolverpublicId - The public identifier to use (if set)systemId - The system identifier to resolve
java.io.IOException - An error reading the stream
public java.io.InputStream resolveDTDFromSystem(java.lang.String uri)
throws java.io.IOException
uri - The DTD uri to resolve
java.io.IOException - An error reading the stream
public java.io.InputStream resolveDTDFromPublic(java.lang.String id)
throws java.io.IOException
id - The DTD uri to resolve
java.io.IOException - An error reading the stream
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||