|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.emb.MediaFormatRegistry
This singleton class manages the different header types and allows the generic selection of a format bean suitable for a given media. The selection criterion is the file extension associated with the media, and a media format can be registered multiple times if many file extensions are typically associated with it.
The class has a private default constructor to prevent direct
construction of instances in applications. Instead, the SINGLETON
constant provides the one and only instance of this class. Implementations
are free to initialize the registry with mappings of their choice. However,
the design allows applications to plug in additional mappings.
Field Summary | |
static MediaFormatRegistry (src) |
SINGLETON
|
Method Summary | |
void |
bind(java.lang.String fileExtension,
MediaFormat (src) mediaFormat)
This operation associates the given file extension with the given media format instance. |
java.util.Iterator |
getFileExtensions()
This operation returns the file extensions for which bindings exist in the registry. |
MediaFormat (src) |
lookup(java.lang.String fileExtension)
Returns the media format instance registered under the given file extension. |
void |
rebind(java.lang.String fileExtension,
MediaFormat (src) mediaFormat)
This operation associates the given file extension with the given media format instance. |
void |
unbind(java.lang.String fileExtension)
This method removes the mapping defined by the given file extension. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final MediaFormatRegistry (src) SINGLETON
Method Detail |
public void bind(java.lang.String fileExtension, MediaFormat (src) mediaFormat) throws FormatAlreadyBoundException (src)
fileExtension
- a file extension identifying the format. Note that
such extensions should not start with a leading dot.mediaFormat
- the media format instance to be registered.
javax.embFormatAlreadyBoundException
- if a mapping already exists
for the given file extension.
java.lang.NullPointerException
- if one of the values passed is
null
.
FormatAlreadyBoundException (src)
public java.util.Iterator getFileExtensions()
public MediaFormat (src) lookup(java.lang.String fileExtension) throws FormatNotFoundException (src)
fileExtension
- a file extension identifying the format. Note that
such extensions should not start with a leading dot.
java.lang.NullPointerException
- if the value passed is null
.
FormatNotFoundException (src)
public void rebind(java.lang.String fileExtension, MediaFormat (src) mediaFormat)
fileExtension
- a file extension identifying the format. Note that
such extensions should not start with a leading dot.mediaFormat
- the media format instance to be registered.
java.lang.NullPointerException
- if one of the values passed is
null
.public void unbind(java.lang.String fileExtension) throws FormatNotFoundException (src)
fileExtension
- a file extension identifying the format. Note that
such extensions should not start with a leading dot.
FormatNotFoundException (src)
- if there is no mapping for the
given file extension.
java.lang.NullPointerException
- if the value passed is null
.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |