org.apache.jetspeed.capability
Class BaseCapabilityMap

java.lang.Object
  extended byorg.apache.jetspeed.capability.BaseCapabilityMap
All Implemented Interfaces:
CapabilityMap

public class BaseCapabilityMap
extends java.lang.Object
implements CapabilityMap

Read only wrapper around a ClientEntry registry entry that implements the CapabilityMap interface

Version:
$Id: BaseCapabilityMap.java,v 1.9 2005/03/21 18:21:35 sgala Exp $
Author:
Raphaël Luta

Field Summary
 
Fields inherited from interface org.apache.jetspeed.capability.CapabilityMap
HTML_ACTIVEX, HTML_CSS1, HTML_CSS2, HTML_CSSP, HTML_DOM, HTML_FORM, HTML_FRAME, HTML_IMAGE, HTML_JAVA, HTML_JAVA1_0, HTML_JAVA1_1, HTML_JAVA1_2, HTML_JSCRIPT, HTML_JSCRIPT1_0, HTML_JSCRIPT1_1, HTML_JSCRIPT1_2, HTML_TABLE, HTML_XML, HTML_XSL
 
Constructor Summary
protected BaseCapabilityMap(java.lang.String agent, ClientEntry entry)
           
 
Method Summary
 java.lang.String getAgent()
          Returns the user-agent string
 MimeType[] getMimeTypes()
          Get the mime types that this CapabilityMap supports.
 java.lang.String getPreferredMediaType()
          Returns the preferred media type for the current user-agent
 MimeType getPreferredType()
          Returns the preferred MIME type for the current user-agent
 boolean hasCapability(int cap)
          Checks to see if the current agent has the specified capability
 boolean hasCapability(java.lang.String capability)
          Checks to see if the current agent has the specified capability
 java.util.Iterator listMediaTypes()
          Returns an ordered list of supported media-types, from most preferred to least preferred
 boolean supportsMediaType(java.lang.String media)
          Return true if this CapabilityMap supports the given media type
 boolean supportsMimeType(MimeType mimeType)
          Return true if this CapabilityMap supports the given MimeType
 java.lang.String toString()
          Create a map string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseCapabilityMap

protected BaseCapabilityMap(java.lang.String agent,
                            ClientEntry entry)
Method Detail

getPreferredType

public MimeType getPreferredType()
Description copied from interface: CapabilityMap
Returns the preferred MIME type for the current user-agent

Specified by:
getPreferredType in interface CapabilityMap
See Also:
CapabilityMap.getPreferredType()

getPreferredMediaType

public java.lang.String getPreferredMediaType()
Returns the preferred media type for the current user-agent

Specified by:
getPreferredMediaType in interface CapabilityMap

listMediaTypes

public java.util.Iterator listMediaTypes()
Returns an ordered list of supported media-types, from most preferred to least preferred

Specified by:
listMediaTypes in interface CapabilityMap

getAgent

public java.lang.String getAgent()
Description copied from interface: CapabilityMap
Returns the user-agent string

Specified by:
getAgent in interface CapabilityMap
See Also:
CapabilityMap.getAgent()

hasCapability

public boolean hasCapability(int cap)
Description copied from interface: CapabilityMap
Checks to see if the current agent has the specified capability

Specified by:
hasCapability in interface CapabilityMap
See Also:
CapabilityMap.hasCapability(int)

hasCapability

public boolean hasCapability(java.lang.String capability)
Description copied from interface: CapabilityMap
Checks to see if the current agent has the specified capability

Specified by:
hasCapability in interface CapabilityMap
See Also:
CapabilityMap.hasCapability(int)

getMimeTypes

public MimeType[] getMimeTypes()
Description copied from interface: CapabilityMap
Get the mime types that this CapabilityMap supports.

Specified by:
getMimeTypes in interface CapabilityMap
See Also:
CapabilityMap.getMimeTypes()

supportsMimeType

public boolean supportsMimeType(MimeType mimeType)
Description copied from interface: CapabilityMap
Return true if this CapabilityMap supports the given MimeType

Specified by:
supportsMimeType in interface CapabilityMap
See Also:
CapabilityMap.supportsMimeType(org.apache.jetspeed.util.MimeType)

supportsMediaType

public boolean supportsMediaType(java.lang.String media)
Description copied from interface: CapabilityMap
Return true if this CapabilityMap supports the given media type

Specified by:
supportsMediaType in interface CapabilityMap
Parameters:
media - the name of a media type registered in the MediaType regsitry
Returns:
true is the capabilities of this agent at least match those required by the media type
See Also:
CapabilityMap.supportsMimeType(org.apache.jetspeed.util.MimeType)

toString

public java.lang.String toString()
Create a map string representation

Specified by:
toString in interface CapabilityMap


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.