ccs.cpc.impl
Class MimeBindery

java.lang.Object
  extended by ccs.cpc.impl.MimeBindery

 class MimeBindery
extends java.lang.Object


Constructor Summary
MimeBindery()
          Creates an empty MIME bindery.
 
Method Summary
 MimeBinding bindingForType(java.lang.String mimetype)
           
 CodecBinding codecsForType(java.lang.String mimetype)
           
 CodecBinding[] getCodecBindings()
          Obtains the list of bindings.
 MimeBinding[] getMimeBindings()
          Obtains the list of bindings.
 void loadDefault(ViewerRegistry vreg)
          loads the default set of MIME bindings
 void marshalTo(java.io.DataOutputStream dest)
          Marshals the MIME bindery onto the supplied stream.
 void register(CodecBinding cb)
          Add a CodecBinding to the bindery.
 void register(MimeBinding mb)
          Add a MimeBinding to the bindery.
 void unmarshalFrom(java.io.DataInputStream src, int marshalver, ViewerRegistry vreg)
          Unmarshals the MIME registry from the supplied stream.
 void unregister(CodecBinding cb)
          remove a CodecBinding from the registry.
 void unregister(MimeBinding mb)
          remove a MimeBinding from the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeBindery

public MimeBindery()
Creates an empty MIME bindery.

Method Detail

bindingForType

public MimeBinding bindingForType(java.lang.String mimetype)

register

public void register(MimeBinding mb)
              throws java.lang.IllegalStateException
Add a MimeBinding to the bindery.

Throws:
java.lang.IllegalStateException - If the type is already registered.

unregister

public void unregister(MimeBinding mb)
                throws java.lang.IllegalStateException
remove a MimeBinding from the registry.

Throws:
java.lang.IllegalStateException - If the type is not registered here.

getMimeBindings

public MimeBinding[] getMimeBindings()
Obtains the list of bindings. The list is sorted.

Returns:
The sorted list.

codecsForType

public CodecBinding codecsForType(java.lang.String mimetype)

register

public void register(CodecBinding cb)
              throws ccs.LoseException
Add a CodecBinding to the bindery.

Throws:
ccs.LoseException - If the type is already registered.

unregister

public void unregister(CodecBinding cb)
                throws ccs.LoseException
remove a CodecBinding from the registry.

Throws:
ccs.LoseException - If the type is not registered here.

getCodecBindings

public CodecBinding[] getCodecBindings()
Obtains the list of bindings. The list is sorted.

Returns:
The sorted list.

marshalTo

public void marshalTo(java.io.DataOutputStream dest)
               throws java.io.IOException
Marshals the MIME bindery onto the supplied stream.

Parameters:
dest - The stream to marshal onto.
Throws:
java.io.IOException - If thrown by the stream.

unmarshalFrom

public void unmarshalFrom(java.io.DataInputStream src,
                          int marshalver,
                          ViewerRegistry vreg)
                   throws java.io.IOException
Unmarshals the MIME registry from the supplied stream.

Parameters:
src - The stream to unmarshal from.
Throws:
java.io.IOException - If thrown by the stream.

loadDefault

public void loadDefault(ViewerRegistry vreg)
                 throws ccs.LoseException,
                        java.io.IOException
loads the default set of MIME bindings

Throws:
ccs.LoseException - If there is a conflict with any pre-existing types.
java.io.IOException - If there is an I/O failure during the load.