net.sourceforge.wurfl.core
Class DefaultDeviceProvider

java.lang.Object
  extended by net.sourceforge.wurfl.core.AbstractDeviceProvider
      extended by net.sourceforge.wurfl.core.DefaultDeviceProvider
All Implemented Interfaces:
DeviceProvider

public class DefaultDeviceProvider
extends AbstractDeviceProvider

DeviceProvider default implementation.

It create DefaultDevices using the CapabilitiesHolderFactory and MarkupResolver. By default it uses DefaultCapabilitiesHolderFactory and DefaultMarkupResolver. Several constructors permit to customize the building procedure.

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

Field Summary
 
Fields inherited from class net.sourceforge.wurfl.core.AbstractDeviceProvider
model
 
Constructor Summary
DefaultDeviceProvider(WURFLModel model)
          Create DefaultDeviceProvider by WURFLModel.
DefaultDeviceProvider(WURFLModel model, CapabilitiesHolderFactory capabilitiesHolderFactory)
          Create DefaultDeviceProvider by WURFLModel and MarkupResolver.
DefaultDeviceProvider(WURFLModel model, CapabilitiesHolderFactory capabilitiesHolderFactory, MarkupResolver markupResolver)
          Create DefaultDeviceProvider by WURFLModel, CapabilitiesHolderFactory and MarkupResolver.
DefaultDeviceProvider(WURFLModel model, MarkupResolver markupResolver)
          Create DefaultDeviceProvider by WURFLModel and MarkupResolver.
 
Method Summary
protected  CapabilitiesHolder createCapabilitiesHolder(ModelDevice modelDevice)
          Factory method to build CapabilityHolder instances.
 Device getDevice(String id)
          Returns the device identified by given id.
 
Methods inherited from class net.sourceforge.wurfl.core.AbstractDeviceProvider
getModelDevice
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDeviceProvider

public DefaultDeviceProvider(WURFLModel model,
                             CapabilitiesHolderFactory capabilitiesHolderFactory,
                             MarkupResolver markupResolver)
Create DefaultDeviceProvider by WURFLModel, CapabilitiesHolderFactory and MarkupResolver.

Parameters:
model - The WURFLModel used to obtain the root ModelDevice.
capabilitiesHolderFactory - The CapabilitiesHolderFactory used to create CapabilitiesHolder for the devices.
markupResolver - The MarkupResolver used to initialize new devices.

DefaultDeviceProvider

public DefaultDeviceProvider(WURFLModel model,
                             CapabilitiesHolderFactory capabilitiesHolderFactory)
Create DefaultDeviceProvider by WURFLModel and MarkupResolver.

It uses DefaultMarkupResolver as MarkupResolver implementation.

Parameters:
model - The WURFLModel used to obtain the root ModelDevice.
markupResolver - The MarkupResolver used to initialize new devices.

DefaultDeviceProvider

public DefaultDeviceProvider(WURFLModel model,
                             MarkupResolver markupResolver)
Create DefaultDeviceProvider by WURFLModel and MarkupResolver.

It uses DefaultCapabilitiesHolderFactory as CapabilitiesHolderFactory implementation.

Parameters:
model - The WURFLModel used to obtain the root ModelDevice.
markupResolver - The MarkupResolver used to initialize new devices.

DefaultDeviceProvider

public DefaultDeviceProvider(WURFLModel model)
Create DefaultDeviceProvider by WURFLModel.

It uses DefaultMarkupResolver as MarkupResolver implementation and DefaultCapabilitiesHolderFactory as CapabilitiesHolderFactory implementation.

Parameters:
model - The WURFLModel used to obtain the root ModelDevice.
Method Detail

getDevice

public Device getDevice(String id)
                 throws DeviceNotDefinedException
Returns the device identified by given id.

Parameters:
id - The identifier
Returns:
Device instance identified by id.
Throws:
DeviceNotDefinedException - if Device with given identifier is not defined in WURFL.

createCapabilitiesHolder

protected CapabilitiesHolder createCapabilitiesHolder(ModelDevice modelDevice)
Factory method to build CapabilityHolder instances.

Parameters:
modelDevice - The ModelDevices root of the creating device.


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