org.apache.jetspeed.capabilities.impl
Class CapabilityMapImpl

java.lang.Object
  extended by org.apache.jetspeed.capabilities.impl.CapabilityMapImpl
All Implemented Interfaces:
org.apache.jetspeed.capabilities.CapabilityMap

 class CapabilityMapImpl
extends Object
implements org.apache.jetspeed.capabilities.CapabilityMap

Implementation for capabilityMap interface

Version:
$Id: CapabilityMapImpl.java 553014 2007-07-03 23:10:53Z ate $
Author:
Roger Ruttimann

Field Summary
private  Map capabilityMap
           
private  org.apache.jetspeed.capabilities.Client client
           
private static org.apache.commons.logging.Log log
           
private  Map mediaTypeMap
           
private  Map mimeTypeMap
           
private  org.apache.jetspeed.capabilities.MediaType preferredMediaType
           
private  String useragent
           
 
Constructor Summary
CapabilityMapImpl()
           
 
Method Summary
 void addCapability(org.apache.jetspeed.capabilities.Capability capability)
          Add capability to the CapabilityMap
 void addMediaType(org.apache.jetspeed.capabilities.MediaType mediatype)
          Add MediaType to the MediaTypeMap
 void addMimetype(org.apache.jetspeed.capabilities.MimeType mimetype)
          Add Mimetype to the MimetypeMap
 String getAgent()
          Returns the user-agent string
 org.apache.jetspeed.capabilities.Client getClient()
          Returns the Client for the CapabilityMap
 Iterator getMimeTypes()
          Get the mime types that this CapabilityMap supports.
 org.apache.jetspeed.capabilities.MediaType getPreferredMediaType()
          Returns the preferred media type for the current user-agent
 org.apache.jetspeed.capabilities.MimeType getPreferredType()
          Returns the preferred MIME type for the current user-agent
 boolean hasCapability(int capability)
          Checks to see if the current agent has the specified capability
 boolean hasCapability(String capability)
          Checks to see if the current agent has the specified capability
 Iterator listMediaTypes()
          Returns an ordered list of supported media-types, from most preferred to least preferred
 void setAgent(String userAgent)
          set userAgent
 void setClient(org.apache.jetspeed.capabilities.Client client)
          Sets the client for the CapabilityMap
 void setPreferredMediaType(org.apache.jetspeed.capabilities.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(org.apache.jetspeed.capabilities.MimeType mimeType)
          Return true if this CapabilityMap supports the given MimeType
 String toString()
          Create a map -> string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

useragent

private String useragent

mimeTypeMap

private Map mimeTypeMap

capabilityMap

private Map capabilityMap

mediaTypeMap

private Map mediaTypeMap

client

private org.apache.jetspeed.capabilities.Client client

preferredMediaType

private org.apache.jetspeed.capabilities.MediaType preferredMediaType
Constructor Detail

CapabilityMapImpl

CapabilityMapImpl()
Method Detail

setClient

public void setClient(org.apache.jetspeed.capabilities.Client client)
Sets the client for the CapabilityMap

Specified by:
setClient in interface org.apache.jetspeed.capabilities.CapabilityMap

getClient

public org.apache.jetspeed.capabilities.Client getClient()
Returns the Client for the CapabilityMap

Specified by:
getClient in interface org.apache.jetspeed.capabilities.CapabilityMap

addCapability

public void addCapability(org.apache.jetspeed.capabilities.Capability capability)
Add capability to the CapabilityMap

Specified by:
addCapability in interface org.apache.jetspeed.capabilities.CapabilityMap

addMimetype

public void addMimetype(org.apache.jetspeed.capabilities.MimeType mimetype)
Add Mimetype to the MimetypeMap

Specified by:
addMimetype in interface org.apache.jetspeed.capabilities.CapabilityMap

addMediaType

public void addMediaType(org.apache.jetspeed.capabilities.MediaType mediatype)
Add MediaType to the MediaTypeMap

Specified by:
addMediaType in interface org.apache.jetspeed.capabilities.CapabilityMap

getPreferredType

public org.apache.jetspeed.capabilities.MimeType getPreferredType()
Returns the preferred MIME type for the current user-agent

Specified by:
getPreferredType in interface org.apache.jetspeed.capabilities.CapabilityMap

setPreferredMediaType

public void setPreferredMediaType(org.apache.jetspeed.capabilities.MediaType type)
Sets the preferred MediaType for this CapabilityMap

Specified by:
setPreferredMediaType in interface org.apache.jetspeed.capabilities.CapabilityMap
Parameters:
MediaTypeEntry -

getPreferredMediaType

public org.apache.jetspeed.capabilities.MediaType getPreferredMediaType()
Returns the preferred media type for the current user-agent

Specified by:
getPreferredMediaType in interface org.apache.jetspeed.capabilities.CapabilityMap

listMediaTypes

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

Specified by:
listMediaTypes in interface org.apache.jetspeed.capabilities.CapabilityMap

getAgent

public String getAgent()
Returns the user-agent string

Specified by:
getAgent in interface org.apache.jetspeed.capabilities.CapabilityMap

setAgent

public void setAgent(String userAgent)
set userAgent

Specified by:
setAgent in interface org.apache.jetspeed.capabilities.CapabilityMap

hasCapability

public boolean hasCapability(int capability)
Checks to see if the current agent has the specified capability

Specified by:
hasCapability in interface org.apache.jetspeed.capabilities.CapabilityMap

hasCapability

public boolean hasCapability(String capability)
Checks to see if the current agent has the specified capability

Specified by:
hasCapability in interface org.apache.jetspeed.capabilities.CapabilityMap

getMimeTypes

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

Specified by:
getMimeTypes in interface org.apache.jetspeed.capabilities.CapabilityMap

supportsMimeType

public boolean supportsMimeType(org.apache.jetspeed.capabilities.MimeType mimeType)
Return true if this CapabilityMap supports the given MimeType

Specified by:
supportsMimeType in interface org.apache.jetspeed.capabilities.CapabilityMap

supportsMediaType

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

Specified by:
supportsMediaType in interface org.apache.jetspeed.capabilities.CapabilityMap
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

public String toString()
Create a map -> string representation

Specified by:
toString in interface org.apache.jetspeed.capabilities.CapabilityMap
Overrides:
toString in class Object


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