com.uwyn.rife.cmf
Class MimeType

java.lang.Object
  extended by com.uwyn.rife.datastructures.EnumClass<String>
      extended by com.uwyn.rife.cmf.MimeType

public abstract class MimeType
extends EnumClass<String>

This is a typed enumeration of all the mime types that the content management framework specifically knows about.

The types that are defined here can be validated and transformed.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Field Summary
static MimeType APPLICATION_XHTML
          The application/xhtml+xml mime type.
static MimeType IMAGE_GIF
          The image/gif mime type.
static MimeType IMAGE_JPEG
          The image/jpeg mime type.
static MimeType IMAGE_PNG
          The image/png mime type.
static MimeType RAW
          A generic mime type indicating that the content should be stored as raw data without any mime-type related processing.
static MimeType TEXT_PLAIN
          The text/plain mime type.
static MimeType TEXT_XML
          The text/plain mime type.
 
Fields inherited from class com.uwyn.rife.datastructures.EnumClass
mIdentifier
 
Method Summary
abstract  Formatter getFormatter()
          Returns an instance of the formatter for this mime type.
static MimeType getMimeType(String identifier)
          Returns the MimeType instance that corresponds to a given textual identifier.
abstract  CmfPropertyValidationRule getValidationRule(ConstrainedProperty constrainedProperty)
          Constructs and returns a CMF-specific validation rule that is able to validate data for this mime type.
 
Methods inherited from class com.uwyn.rife.datastructures.EnumClass
equals, getIdentifiers, getMember, getMembers, hashCode, registerType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

APPLICATION_XHTML

public static final MimeType APPLICATION_XHTML
The application/xhtml+xml mime type.


IMAGE_GIF

public static final MimeType IMAGE_GIF
The image/gif mime type.


IMAGE_JPEG

public static final MimeType IMAGE_JPEG
The image/jpeg mime type.


IMAGE_PNG

public static final MimeType IMAGE_PNG
The image/png mime type.


TEXT_PLAIN

public static final MimeType TEXT_PLAIN
The text/plain mime type.


TEXT_XML

public static final MimeType TEXT_XML
The text/plain mime type.


RAW

public static final MimeType RAW
A generic mime type indicating that the content should be stored as raw data without any mime-type related processing.

Method Detail

getValidationRule

public abstract CmfPropertyValidationRule getValidationRule(ConstrainedProperty constrainedProperty)
Constructs and returns a CMF-specific validation rule that is able to validate data for this mime type.

Parameters:
constrainedProperty - an instance of the property for which the validation rule has to be built
Returns:
an instance of the validation rule
Since:
1.0

getFormatter

public abstract Formatter getFormatter()
Returns an instance of the formatter for this mime type.

Returns:
an instance of the formatter
Since:
1.0

getMimeType

public static MimeType getMimeType(String identifier)
Returns the MimeType instance that corresponds to a given textual identifier.

Parameters:
identifier - the identifier of the mime type that has to be retrieved
Returns:
the requested MimeType; or

null if the MimeType is not supported

Since:
1.0


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.