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
 java.lang.String getAgent()
           
 Client getClient()
          Returns the Client for the CapabilityMap
 java.util.Iterator getMimeTypes()
          Get the mime types that this CapabilityMap supports.
 MediaType getPreferredMediaType()
           
 MimeType getPreferredType()
           
 boolean hasCapability(int cap)
           
 boolean hasCapability(java.lang.String capability)
           
 java.util.Iterator listMediaTypes()
          Returns an ordered list of supported media-types, from most preferred to least preferred
 void setAgent(java.lang.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(java.lang.String media)
          Return true if this CapabilityMap supports the given media type
 boolean supportsMimeType(MimeType mimeType)
           
 java.lang.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

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


getAgent

java.lang.String getAgent()
Returns:
Returns the user-agent string

setAgent

void setAgent(java.lang.String userAgent)

hasCapability

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

hasCapability

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

getMimeTypes

java.util.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(java.lang.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

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


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.