javax.media.protocol
Class ContentDescriptor

java.lang.Object
  |
  +--javax.media.Format
        |
        +--javax.media.protocol.ContentDescriptor
Direct Known Subclasses:
FileTypeDescriptor

public class ContentDescriptor
extends Format

A ContentDescriptor identifies media data containers.

Since:
JMF 1.0, extends Format in JMF 2.0
See Also:
SourceStream, Format, Serialized Form

Field Summary
static java.lang.String CONTENT_UNKNOWN
          Unknown content type
static java.lang.String MIXED
          Mixed content type.
static java.lang.String RAW
          RAW content type.
static java.lang.String RAW_RTP
          RAW RTP content type.
 
Fields inherited from class javax.media.Format
byteArray, clz, dataType, encoding, FALSE, formatArray, intArray, NOT_SPECIFIED, shortArray, TRUE
 
Constructor Summary
ContentDescriptor(java.lang.String cdName)
          Create a content descriptor with the specified name.
 
Method Summary
 java.lang.String getContentType()
          Obtain a string that represents the content-name for this descriptor.
static java.lang.String mimeTypeToPackageName(java.lang.String mimeType)
          Map a MIME content-type to an equivalent string of class-name components.
 java.lang.String toString()
          Returns a string which describes the format parameters.
 
Methods inherited from class javax.media.Format
clone, copy, equals, getDataType, getEncoding, intersects, matches, relax
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RAW

public static final java.lang.String RAW
RAW content type. This signifies content that's contained in individual buffers of type Buffer and carries any format of media as specified by the format attribute of the buffer.
See Also:
Buffer, Format, PullBufferDataSource, PushBufferDataSource

RAW_RTP

public static final java.lang.String RAW_RTP
RAW RTP content type. This is similar to the RAW content type but only carries buffers that contain packetized data formats supported by RTP.

MIXED

public static final java.lang.String MIXED
Mixed content type. This signifies content that contains other elementary content types. e.g., when more than one DataSources is merged to formed one DataSource, the resulting DataSource may contain mixed contents.

CONTENT_UNKNOWN

public static final java.lang.String CONTENT_UNKNOWN
Unknown content type
Constructor Detail

ContentDescriptor

public ContentDescriptor(java.lang.String cdName)
Create a content descriptor with the specified name.

To create a ContentDescriptor from a MIME type, use the mimeTypeToPackageName static member.

Parameters:
cdName - The name of the content-type.
Method Detail

getContentType

public java.lang.String getContentType()
Obtain a string that represents the content-name for this descriptor.
Returns:
The content-type name.

toString

public java.lang.String toString()
Returns a string which describes the format parameters.
Overrides:
toString in class Format
Returns:
a string which describes the format parameters.

mimeTypeToPackageName

public static final java.lang.String mimeTypeToPackageName(java.lang.String mimeType)
Map a MIME content-type to an equivalent string of class-name components.

The MIME type is mapped to a string by:

  1. Replacing all slashes with a period.
  2. Converting all alphabetic characters to lower case.
  3. Converting all non-alpha-numeric characters other than periods to underscores (_).

For example, "text/html" would be converted to "text.html"

Parameters:
mimeType - The MIME type to map to a string.


Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.