fi.hut.tml.xsmiles.content
Class ContentHandlerFactory

java.lang.Object
  extended byfi.hut.tml.xsmiles.content.ContentHandlerFactory
Direct Known Subclasses:
JMFContentHandlerFactory

public class ContentHandlerFactory
extends java.lang.Object

ContentHandlerFactory creates content handlers based on the content-type and possibly the URI This instance is created by the UI, and usually extended with UI specific handler mappings

Author:
Mikko Honkala

Field Summary
protected  BrowserWindow browserWindow
           
protected  java.util.Hashtable endingHandlers
           
static java.lang.String HTMLHANDLER
           
protected  java.util.Hashtable typeHandlers
           
static java.lang.String XMLHANDLER
           
 
Constructor Summary
ContentHandlerFactory(BrowserWindow bw)
           
 
Method Summary
protected  XSmilesContentHandler createContentHandler(java.lang.Class a_class, java.lang.String contentType, XLink url)
           
protected  XSmilesContentHandler createContentHandler(java.lang.Object instance)
           
 XSmilesContentHandler createContentHandler(java.lang.String cType, XLink url)
           
 void createEndingMapping(java.lang.String ending, java.lang.Class aClass)
           
protected  void createMappings()
           
 void createMIMEMapping(java.lang.String mime, java.lang.Class aClass)
           
protected  void createTextMappings()
           
protected  java.lang.String getBareContentType(java.lang.String contentType)
          This returns just the bare content type.
protected static java.lang.String getSuffix(java.net.URL url)
          Checks if given URL end with the given suffix String.
protected  java.lang.String getWildBareContentType(java.lang.String contentType)
          This returns just the bare content type, replacing the subpart with '*'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLHANDLER

public static final java.lang.String XMLHANDLER
See Also:
Constant Field Values

HTMLHANDLER

public static final java.lang.String HTMLHANDLER
See Also:
Constant Field Values

typeHandlers

protected java.util.Hashtable typeHandlers

endingHandlers

protected java.util.Hashtable endingHandlers

browserWindow

protected BrowserWindow browserWindow
Constructor Detail

ContentHandlerFactory

public ContentHandlerFactory(BrowserWindow bw)
Method Detail

createMIMEMapping

public void createMIMEMapping(java.lang.String mime,
                              java.lang.Class aClass)

createEndingMapping

public void createEndingMapping(java.lang.String ending,
                                java.lang.Class aClass)

createMappings

protected void createMappings()

createTextMappings

protected void createTextMappings()

getBareContentType

protected java.lang.String getBareContentType(java.lang.String contentType)
This returns just the bare content type. e.g. for "text/html; charset = xxx", it would return "text/html"


getWildBareContentType

protected java.lang.String getWildBareContentType(java.lang.String contentType)
This returns just the bare content type, replacing the subpart with '*'. e.g. for "text/html; charset = xxx", it would return "text/*"


createContentHandler

public XSmilesContentHandler createContentHandler(java.lang.String cType,
                                                  XLink url)

getSuffix

protected static java.lang.String getSuffix(java.net.URL url)
Checks if given URL end with the given suffix String.


createContentHandler

protected XSmilesContentHandler createContentHandler(java.lang.Object instance)
                                              throws java.lang.IllegalAccessException
Throws:
java.lang.IllegalAccessException

createContentHandler

protected XSmilesContentHandler createContentHandler(java.lang.Class a_class,
                                                     java.lang.String contentType,
                                                     XLink url)
                                              throws java.lang.InstantiationException,
                                                     java.lang.IllegalAccessException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException


X-Smiles 1.2