org.displaytag.util
Class MediaUtil

java.lang.Object
  extended by org.displaytag.util.MediaUtil

public final class MediaUtil
extends java.lang.Object

This class provides services for configuring and determining the list of media types an instance of SupportsMedia supports. (Background: ColumnTag, FooterTag and CaptionTag can be configured to support a set of media types. This class factors the logic for setting and determining the media instances these objects support)

Version:
$Revision$ ($Author$)
Author:
Jorge L. Barroso

Nested Class Summary
static interface MediaUtil.SupportsMedia
          Defines a type of object that can support a list of media types.
 
Method Summary
static boolean availableForMedia(MediaUtil.SupportsMedia mediaSupporter, MediaTypeEnum mediaType)
          Is this media supporter configured for the media type? (Background: Factored from ColumnTag)
static void setMedia(MediaUtil.SupportsMedia mediaSupporter, java.lang.String media)
          Configures the media supported by an object that implements SupportsMedia.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setMedia

public static void setMedia(MediaUtil.SupportsMedia mediaSupporter,
                            java.lang.String media)
Configures the media supported by an object that implements SupportsMedia. (Background: factored from ColumnTag)

Parameters:
mediaSupporter - The SupportsMedia instance being configured to support a list of media.
media - The media being configured on the given SupportsMedia instance.

availableForMedia

public static boolean availableForMedia(MediaUtil.SupportsMedia mediaSupporter,
                                        MediaTypeEnum mediaType)
Is this media supporter configured for the media type? (Background: Factored from ColumnTag)

Parameters:
mediaSupporter - An object that supports various media.
mediaType - The currentMedia type
Returns:
true if the media supporter should be displayed for this request


Copyright © 2002-2007 the Displaytag team. All Rights Reserved.