org.jboss.portal.portlet.container.info
Class ContentTypes

java.lang.Object
  extended byorg.jboss.portal.portlet.container.info.ContentTypes

public class ContentTypes
extends java.lang.Object

This object holds the content type and mode capabilities.

Todo : use the media type object ?


Field Summary
protected  java.util.Set allModes
           
protected  java.util.Map allTypeToPortletModes
          Maps MIME Type (String) -> Modes (Set), including multiple MIME Types ("*", "* / *", "type / *").
protected  boolean isStarted
           
protected  ContentTypesMetaData metadata
           
protected  java.util.Map singleTypeToPortletModes
          Maps MIME Type (String) -> Modes (Set), excluding multiple MIME Types ("*", "* / *", "type / *").
 
Constructor Summary
ContentTypes()
           
 
Method Summary
 java.util.Collection getAllContentTypes()
          Return all content types.
 java.util.Collection getAllModes()
          Return all modes.
 ContentTypesMetaData getMetadata()
           
 java.util.Set getSupportedModes(java.lang.String contentType)
          Return all the supported modes for this content type.
 boolean isContentTypeSupported(java.lang.String contentType)
          Return true if the content type is supported.
 boolean isModeSupported(Mode mode)
          Return true if the mode is supported
 boolean isSupported(Mode mode, java.lang.String contentType)
          Return true if the given content type is supported for the given mode.
 void setMetadata(ContentTypesMetaData metadata)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleTypeToPortletModes

protected final java.util.Map singleTypeToPortletModes
Maps MIME Type (String) -> Modes (Set), excluding multiple MIME Types ("*", "* / *", "type / *").


allTypeToPortletModes

protected final java.util.Map allTypeToPortletModes
Maps MIME Type (String) -> Modes (Set), including multiple MIME Types ("*", "* / *", "type / *").


allModes

protected final java.util.Set allModes

metadata

protected ContentTypesMetaData metadata

isStarted

protected boolean isStarted
Constructor Detail

ContentTypes

public ContentTypes()
Method Detail

getMetadata

public ContentTypesMetaData getMetadata()

setMetadata

public void setMetadata(ContentTypesMetaData metadata)

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop()

getAllModes

public java.util.Collection getAllModes()
Return all modes.


getAllContentTypes

public java.util.Collection getAllContentTypes()
Return all content types.


isModeSupported

public boolean isModeSupported(Mode mode)
Return true if the mode is supported

Throws:
java.lang.IllegalArgumentException - if the mode is null

getSupportedModes

public java.util.Set getSupportedModes(java.lang.String contentType)
Return all the supported modes for this content type.

Throws:
java.lang.IllegalArgumentException - if the content type is null

isContentTypeSupported

public boolean isContentTypeSupported(java.lang.String contentType)
Return true if the content type is supported.

Throws:
java.lang.IllegalArgumentException - if the content type is null

isSupported

public boolean isSupported(Mode mode,
                           java.lang.String contentType)
Return true if the given content type is supported for the given mode.

Throws:
java.lang.IllegalArgumentException - if the content type or the mode is null