Package org.web3d.net.resolve
Class Web3DURNResolver
java.lang.Object
org.web3d.net.resolve.Web3DURNResolver
- All Implemented Interfaces:
org.ietf.uri.URIResolverService
,org.ietf.uri.URNResolverService
A URN resolver to allow the integration of URNs that use the
web3d
Namespace ID.
- Version:
- $Revision: 1.4 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from interface org.ietf.uri.URIResolverService
I2C, I2Cs, I2L, I2Ls, I2N, I2Ns, I2R, I2Rs, II
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canResolve
(String nid) Check to see what NIDs can be resolved by this service implementation.boolean
checkService
(int type) Check to see if the service type is one that we can resolve given the namespace ID.decode
(org.ietf.uri.URN urn, int service) Object[]
decodeList
(org.ietf.uri.URN urn, int service) void
init()
Initialise any internal information.void
registerPrefixLocation
(String prefix, String directory) Set the directory used to locate a particular subspace of the Web3D URN namespace ID.void
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.void
setResourceFactory
(org.ietf.uri.URIResourceFactory fac) Set the resource factory to be used to fetch streams for.
-
Constructor Details
-
Web3DURNResolver
public Web3DURNResolver()Create an instance of the resolver. This will not be able to resolve anything until the appropriate directories are set.
-
-
Method Details
-
canResolve
Check to see what NIDs can be resolved by this service implementation.- Specified by:
canResolve
in interfaceorg.ietf.uri.URNResolverService
- Parameters:
nid
- The NID to check- Returns:
- true if we can resolve it
-
decode
public Object decode(org.ietf.uri.URN urn, int service) throws org.ietf.uri.UnsupportedServiceException - Specified by:
decode
in interfaceorg.ietf.uri.URNResolverService
- Throws:
org.ietf.uri.UnsupportedServiceException
-
decodeList
public Object[] decodeList(org.ietf.uri.URN urn, int service) throws org.ietf.uri.UnsupportedServiceException - Specified by:
decodeList
in interfaceorg.ietf.uri.URNResolverService
- Throws:
org.ietf.uri.UnsupportedServiceException
-
checkService
public boolean checkService(int type) Check to see if the service type is one that we can resolve given the namespace ID.- Specified by:
checkService
in interfaceorg.ietf.uri.URIResolverService
- Parameters:
type
- The service type to check if it works- Returns:
- true if the service type is supported by this implementation
-
init
public void init()Initialise any internal information. Ignored in this implementation- Specified by:
init
in interfaceorg.ietf.uri.URIResolverService
-
setResourceFactory
public void setResourceFactory(org.ietf.uri.URIResourceFactory fac) Set the resource factory to be used to fetch streams for. Should never be called by end-user code. Is internal to the URI library.- Specified by:
setResourceFactory
in interfaceorg.ietf.uri.URIResolverService
- Parameters:
fac
- The factory to be used
-
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.- Parameters:
reporter
- The instance to use or null
-
registerPrefixLocation
Set the directory used to locate a particular subspace of the Web3D URN namespace ID. A check is made to make sure the passed string represents a valid directory. If it does not, an exception is thrown. If null is passed as the directory, it removes the current mapping.- Parameters:
prefix
- The subspace prefix to usedirectory
- The directory that GeoVRML is installed in- Throws:
IllegalArgumentException
- The directory is not valid
-