org.apache.jetspeed.capabilities
Interface CapabilityMap


public interface CapabilityMap

This interface provides lookup features on the capabilities supported by a client user agent.

Version:
$Id: CapabilityMap.java 516448 2007-03-09 16:25:47Z ate $
Author:
Raphaël Luta, Kevin A. Burton

Method Summary
 void addCapability(Capability capability)
          Add capability to the CapabilityMap
 void addMediaType(MediaType mediatype)
          Add MediaType to the MediaTypeMap
 void addMimetype(MimeType mimetype)
          Add Mimetype to the MimetypeMap
 String getAgent()
           
 Client getClient()
          Returns the Client for the CapabilityMap
 Iterator getMimeTypes()
          Get the mime types that this CapabilityMap supports.
 MediaType getPreferredMediaType()
           
 MimeType getPreferredType()
           
 boolean hasCapability(int cap)
           
 boolean hasCapability(String capability)
           
 Iterator listMediaTypes()
          Returns an ordered list of supported media-types, from most preferred to least preferred
 void setAgent(String userAgent)
           
 void setClient(Client client)
          Sets the client for the CapabilityMap
 void setPreferredMediaType(MediaType type)
          Sets the preferred MediaType for this CapabilityMap
 boolean supportsMediaType(String media)
          Return true if this CapabilityMap supports the given media type
 boolean supportsMimeType(MimeType mimeType)
           
 String toString()
           
 

Method Detail

setClient

void setClient(Client client)
Sets the client for the CapabilityMap

Parameters:
client - The client associated with this map

getClient

Client getClient()
Returns the Client for the CapabilityMap

Returns:
The client associated with this map

addCapability

void addCapability(Capability capability)
Add capability to the CapabilityMap

Parameters:
capability -

addMimetype

void addMimetype(MimeType mimetype)
Add Mimetype to the MimetypeMap

Parameters:
mimetype -

addMediaType

void addMediaType(MediaType mediatype)
Add MediaType to the MediaTypeMap

Parameters:
Mediatype - to add

getPreferredType

MimeType getPreferredType()
Returns:
Returns the preferred MIME type for the current user-agent

getPreferredMediaType

MediaType getPreferredMediaType()
Returns:
Returns the preferred media type for the current user-agent

setPreferredMediaType

void setPreferredMediaType(MediaType type)
Sets the preferred MediaType for this CapabilityMap

Parameters:
MediaTypeEntry -

listMediaTypes

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


getAgent

String getAgent()
Returns:
Returns the user-agent string

setAgent

void setAgent(String userAgent)

hasCapability

boolean hasCapability(int cap)
Parameters:
CApabilityID -
Returns:
Returns true if the current agent has the specified capabilityID

hasCapability

boolean hasCapability(String capability)
Parameters:
Capability -
Returns:
returns true if the current agent has the specified capability

getMimeTypes

Iterator getMimeTypes()
Get the mime types that this CapabilityMap supports.

Returns:
Returns an Iterator over the MimeType map

supportsMimeType

boolean supportsMimeType(MimeType mimeType)
Parameters:
MimeType -
Returns:
Return true if this CapabilityMap supports the given MimeType

supportsMediaType

boolean supportsMediaType(String media)
Return true if this CapabilityMap supports the given media type

Parameters:
media - the name of a media type registered in the MediaType registry
Returns:
true is the capabilities of this agent at least match those required by the media type

toString

String toString()
Overrides:
toString in class Object
Returns:
Create a map -> string representation


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.