Xj3D VRML/X3D Code API

org.web3d.net.content
Class VRMLContentHandlerFactory

java.lang.Object
  extended byorg.web3d.net.content.VRMLContentHandlerFactory
All Implemented Interfaces:
org.ietf.uri.ContentHandlerFactory

public class VRMLContentHandlerFactory
extends java.lang.Object
implements org.ietf.uri.ContentHandlerFactory

A Factory implementation for VRML content handlers that produces VRML output.

The factory implementation only handles UTF8 encoded files currently. We have not yet built a handler for XML encoded files.

This factory is not automatically registered with the system. If you want or need to load inlines, then you must create and instance of this factory and register it as a content handler factory with the URI system. For example

     BrowserCore core = ....
     WorldLoaderManager loader = ....

     ContentHandlerFactory c_fac = URI.getContentHandlerFactory();
     if(!(c_fac instanceof VRMLContentHandlerFactory)) {
         c_fac = new VRMLContentHandlerFactory(core, loader, c_fac);
         URI.setContentHandlerFactory(c_fac);
     }
 
If a previous content handler was registered and it was not one of this class it will be chained to this class. If we can't find the content then we can ask the chained factory.

Version:
$Revision: 1.12 $
Author:
Justin Couch

Constructor Summary
VRMLContentHandlerFactory(BrowserCore browser, WorldLoaderManager wlm)
          Create a default content handler factory that does not chain to any further packages.
VRMLContentHandlerFactory(BrowserCore browser, WorldLoaderManager wlm, org.ietf.uri.ContentHandlerFactory fac)
          Create a content handler factory that may delegate to another factory if this one cannot support the content types requested.
 
Method Summary
 org.ietf.uri.ContentHandler createContentHandler(java.lang.String contentType)
          Create a content handler for the given mime type.
 org.ietf.uri.ContentHandlerFactory getWrappedFactory()
          Get the chained content handler factory if it has been set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VRMLContentHandlerFactory

public VRMLContentHandlerFactory(BrowserCore browser,
                                 WorldLoaderManager wlm)
Create a default content handler factory that does not chain to any further packages. This is the same as calling VRMLContentHandlerFactory(factory, clk, null).

Parameters:
browser - The core representation of the browser
wlm - Loader manager for doing async calls

VRMLContentHandlerFactory

public VRMLContentHandlerFactory(BrowserCore browser,
                                 WorldLoaderManager wlm,
                                 org.ietf.uri.ContentHandlerFactory fac)
Create a content handler factory that may delegate to another factory if this one cannot support the content types requested. If the reference is null, then there is no chained factory.

Parameters:
browser - The core representation of the browser
fac - The factory to delegate to if we fail
wlm - Loader manager for doing async calls
Method Detail

createContentHandler

public org.ietf.uri.ContentHandler createContentHandler(java.lang.String contentType)
Create a content handler for the given mime type. If the factory cannot create a handler then it shall return null to allow other methods to be used.

Specified by:
createContentHandler in interface org.ietf.uri.ContentHandlerFactory
Parameters:
contentType - The MIME type of the handler needed
Returns:
A valid content handler for the type or null

getWrappedFactory

public org.ietf.uri.ContentHandlerFactory getWrappedFactory()
Get the chained content handler factory if it has been set. If none has been set, this will return null.

Returns:
The wrapped content handler factory or null

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium