com.guiseframework.platform.web
Class DefaultWebUserAgentProduct
java.lang.Object
com.guiseframework.platform.AbstractProduct
com.guiseframework.platform.AbstractBrandedProduct<WebUserAgentProduct.Brand>
com.guiseframework.platform.web.DefaultWebUserAgentProduct
- All Implemented Interfaces:
- BrandedProduct<WebUserAgentProduct.Brand>, ClientProduct, Product, WebUserAgentProduct
public class DefaultWebUserAgentProduct
- extends AbstractBrandedProduct<WebUserAgentProduct.Brand>
- implements WebUserAgentProduct
The default implementation of the identification of the user agent client, such as a browser, accessing Guise on the web platform.
- Author:
- Garret Wilson
|
Constructor Summary |
DefaultWebUserAgentProduct(java.lang.String id,
WebUserAgentProduct.Brand brand,
java.lang.String name,
java.lang.String version,
double versionNumber,
int[] versionNumbers,
java.lang.Iterable<com.globalmentor.net.ContentType> acceptedContentTypes,
java.lang.Iterable<java.util.Locale> acceptedLanguages)
ID, brand, name, and version constructor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultWebUserAgentProduct
public DefaultWebUserAgentProduct(java.lang.String id,
WebUserAgentProduct.Brand brand,
java.lang.String name,
java.lang.String version,
double versionNumber,
int[] versionNumbers,
java.lang.Iterable<com.globalmentor.net.ContentType> acceptedContentTypes,
java.lang.Iterable<java.util.Locale> acceptedLanguages)
- ID, brand, name, and version constructor.
- Parameters:
id - The identifying string of the product, or null if the ID is not known.brand - The brand of the product, or null if the brand is not known.name - The canonical name of the product, or null if the name is not known.version - The version string provided by the product, or null if there is no string version of the product.versionNumber - The version number provided by the product, or Double.NaN if there is no version number of the product.versionNumbers - The version number components provided by the product, or null if there are no version number components of the product.acceptedContentTypes - The content types accepted by the client.acceptedLanguages - The languages accepted by the client.
- Throws:
java.lang.NullPointerException - if the given ID, name, accepted content types, and/or accepted languages is null.
getAcceptedContentTypes
public java.lang.Iterable<com.globalmentor.net.ContentType> getAcceptedContentTypes()
- Specified by:
getAcceptedContentTypes in interface ClientProduct
- Returns:
- The content types accepted by the client.
isAcceptedContentType
public boolean isAcceptedContentType(com.globalmentor.net.ContentType contentType)
- Determines if the client accepts the given content type.
Wildcard content types are correctly matched.
- Specified by:
isAcceptedContentType in interface ClientProduct
- Parameters:
contentType - The content type to check.
- Returns:
true if the client accepts the given content type.
isAcceptedContentType
public boolean isAcceptedContentType(com.globalmentor.net.ContentType contentType,
boolean matchWildcards)
- Determines if the client accepts the given content type.
- Specified by:
isAcceptedContentType in interface ClientProduct
- Parameters:
contentType - The content type to check.matchWildcards - true if the content type should be matched against wildcard sequences, as is normal.
- Returns:
true if the client accepts the given content type.
getClientAcceptedLanguages
public java.lang.Iterable<java.util.Locale> getClientAcceptedLanguages()
- Specified by:
getClientAcceptedLanguages in interface ClientProduct
- Returns:
- The languages accepted by the client.
Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.