net.sourceforge.wurfl.core
Class DefaultCapabilitiesHolder

java.lang.Object
  extended by net.sourceforge.wurfl.core.DefaultCapabilitiesHolder
All Implemented Interfaces:
Serializable, CapabilitiesHolder

public class DefaultCapabilitiesHolder
extends Object
implements CapabilitiesHolder, Serializable

CapabilitiesHolder default implementation.

This is the default implementation of CapabilitiesHolder, it use a Map to store capabilities and a CapabilitiesLoader implementation to lazily load capabilities values.

It is very efficient if you need getting more then one capability, and if you want getting capability from JSTL, because you can't use getCapability("name") from there but you can grab capability by doing ${device.capabilities.name}.

Version:
$Id: DefaultCapabilitiesHolder.java 432 2010-05-06 12:12:53Z filippo.deluca $
Author:
Fantayeneh Asres Gizaw, Filippo De Luca
See Also:
Serialized Form

Constructor Summary
DefaultCapabilitiesHolder(CapabilitiesLoader capabilitiesLoader)
           
 
Method Summary
 Map getAllCapabilities()
          Returns all the capabilities for a single device.
 String getCapabilityValue(String capabilityName)
          Return the capability value by capability name for single Device instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCapabilitiesHolder

public DefaultCapabilitiesHolder(CapabilitiesLoader capabilitiesLoader)
Method Detail

getCapabilityValue

public String getCapabilityValue(String capabilityName)
                          throws CapabilityNotDefinedException
Description copied from interface: CapabilitiesHolder
Return the capability value by capability name for single Device instance.

Specified by:
getCapabilityValue in interface CapabilitiesHolder
Parameters:
capabilityName - The name of capability to get value.
Returns:
The value of capability capabilityName
Throws:
CapabilityNotDefinedException - If the capability capabilityName is not defined in WURFL.

getAllCapabilities

public Map getAllCapabilities()
Description copied from interface: CapabilitiesHolder
Returns all the capabilities for a single device.

Specified by:
getAllCapabilities in interface CapabilitiesHolder
Returns:
Map containing couple name-value of single Device.


Copyright © 2008-2010 WURFL-Pro srl. All Rights Reserved.