|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.free2be.dimensions.device.DeviceFactory
public abstract class DeviceFactory
A device factory is used to determine a calling device. There are various levels of confidence that each factory may have in determining it's ability to produce a quality device description. The factories are registered in order of preference to improve performance (some factories simply detect a predermined device so parsing descriptions and headers would not be necesary).
Nested Class Summary | |
---|---|
static class |
DeviceFactory.ConfidenceLevel
Confidence Levels are indicators that are used to determine how confident a factory is in providing an appropriate device. |
Field Summary | |
---|---|
protected static DeviceFactory.ConfidenceLevel |
CONTENT
Indicates the type of content is known, but very little about the calling device is know such as the screen size. |
protected static DeviceFactory.ConfidenceLevel |
DEFAULT
Practically as good as no confidence, but regardless returns a device that represents the default for the system. |
protected static DeviceFactory.ConfidenceLevel |
DEVICE
Indicates the content type(s) are known and some information about the device is known, but not described in a disciplined or standard way. |
protected static java.lang.Integer |
MINIMUM_LEVEL_FOR_FINAL
This level represents the minimul confidence level that is needed for the factory dispatcher to give up looking. |
protected static DeviceFactory.ConfidenceLevel |
MODEL
Indicates the model of the device is known, but only from non-standard methods such as CC/PP. |
protected static DeviceFactory.ConfidenceLevel |
NONE
Simply doesn't offer any clues about the type of device. |
protected static DeviceFactory.ConfidenceLevel |
OVERRIDE
An indicator used to override whatever the calling device is...sometimes used for simulation. |
protected static DeviceFactory.ConfidenceLevel |
PRE_DETERMINED
Predetermined means the factory has found a persistant device for a caller. |
protected static DeviceFactory.ConfidenceLevel |
STANDARD
CC/PP is the W3C standard that describes almost every detail of a device and is the preferred method of device description. |
Constructor Summary | |
---|---|
DeviceFactory()
|
Method Summary | |
---|---|
void |
clearPersistantDevice(java.lang.Object informationSource)
Sometimes a persistant device needs to be removed from persistance to "reset" the factory so to speak. |
abstract DeviceFactory.ConfidenceLevel |
getConfidenceLevel()
Retrieves the confidence level this factory has in fulfilling the request based on the information provided during intialization. |
abstract Device |
getDevice()
Retrieves a device to represent the calling client's device. |
static DeviceFactory |
getDeviceFactory(java.lang.Object informationSource)
|
protected static java.util.TreeSet |
getFactories()
Gets all the factories. |
abstract DeviceFactory.ConfidenceLevel |
getHighestConfidenceLevel()
Returns the highest confidence level the implementing device factory can provide. |
protected static java.util.LinkedList |
getPersistentFactories()
This returns a list of persistant factories. |
protected abstract void |
initialize(java.lang.Object informationSource)
initalizes a factory after default construction giving some object as the source of information to determine confidence and build devices. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final DeviceFactory.ConfidenceLevel NONE
protected static final DeviceFactory.ConfidenceLevel DEFAULT
protected static final DeviceFactory.ConfidenceLevel CONTENT
protected static final DeviceFactory.ConfidenceLevel DEVICE
protected static final DeviceFactory.ConfidenceLevel MODEL
protected static final DeviceFactory.ConfidenceLevel STANDARD
protected static final DeviceFactory.ConfidenceLevel PRE_DETERMINED
protected static final DeviceFactory.ConfidenceLevel OVERRIDE
protected static final java.lang.Integer MINIMUM_LEVEL_FOR_FINAL
Constructor Detail |
---|
public DeviceFactory()
Method Detail |
---|
public abstract Device getDevice()
public abstract DeviceFactory.ConfidenceLevel getConfidenceLevel()
public abstract DeviceFactory.ConfidenceLevel getHighestConfidenceLevel()
protected abstract void initialize(java.lang.Object informationSource)
informationSource
- any object that a factory may use to determine device (usually javax.servlet.HttpServletRequest).protected static java.util.TreeSet getFactories()
protected static java.util.LinkedList getPersistentFactories()
public static DeviceFactory getDeviceFactory(java.lang.Object informationSource)
informationSource
- ... any object that a factory may use for detection....Usually HttpServletRequest. See
factory implementations for other possible instances.
public void clearPersistantDevice(java.lang.Object informationSource)
PersistentDeviceFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |