RichFaces Photoalbum 4.3.5.Final

org.richfaces.photoalbum.model
Enum MediaType

java.lang.Object
  extended by java.lang.Enum<MediaType>
      extended by org.richfaces.photoalbum.model.MediaType
All Implemented Interfaces:
Serializable, Comparable<MediaType>

public enum MediaType
extends Enum<MediaType>

The MediaType describes the types of media this application can handle and render.

The media type is a closed set - as each different type of media requires support coded into the view layers, it cannot be expanded upon without rebuilding the application. It is therefore represented by an enumeration. When used, you should instruct JPA to store the enum value using it's String representation, so that we can later reorder the enum members, without changing the data. Of course, this does mean we can't change the names of media items once the app is put into production. To do this add @Enumerated(STRING) to the field declaration.

The MediaType also describes whether this type of media can be cached locally, and used when there is no internet connection. For example images and or an mpeg video file can be cached, whilst a video streamed across the internet cannot.

Author:
Pete Muir

Enum Constant Summary
IMAGE
          The types of media the application can currently handle.
 
Method Summary
 String getDescription()
           
 boolean isCacheable()
           
static MediaType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MediaType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

IMAGE

public static final MediaType IMAGE
The types of media the application can currently handle. Right now, it can only handle images. We plan to add support for streamed videos in the next development round.

Method Detail

values

public static MediaType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MediaType c : MediaType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MediaType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getDescription

public String getDescription()

isCacheable

public boolean isCacheable()

RichFaces Photoalbum 4.3.5.Final

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.