Package org.apache.http.impl.cookie
Class AbstractCookieSpec
- java.lang.Object
-
- org.apache.http.impl.cookie.AbstractCookieSpec
-
- All Implemented Interfaces:
CookieSpec
- Direct Known Subclasses:
CookieSpecBase
@Contract(threading=SAFE) public abstract class AbstractCookieSpec extends java.lang.Object implements CookieSpec
Abstract cookie specification which can delegate the job of parsing, validation or matching cookie attributes to a number of arbitraryCookieAttributeHandlers.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,CookieAttributeHandler>attribHandlerMapStores attribute name -> attribute handler mappings
-
Constructor Summary
Constructors Modifier Constructor Description AbstractCookieSpec()Default constructorprotectedAbstractCookieSpec(java.util.HashMap<java.lang.String,CookieAttributeHandler> map)protectedAbstractCookieSpec(CommonCookieAttributeHandler... handlers)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected CookieAttributeHandlerfindAttribHandler(java.lang.String name)Finds an attribute handlerCookieAttributeHandlerfor the given attribute.protected CookieAttributeHandlergetAttribHandler(java.lang.String name)Gets attribute handlerCookieAttributeHandlerfor the given attribute.protected java.util.Collection<CookieAttributeHandler>getAttribHandlers()voidregisterAttribHandler(java.lang.String name, CookieAttributeHandler handler)Deprecated.(4.4) useAbstractCookieSpec(java.util.HashMap)orAbstractCookieSpec(org.apache.http.cookie.CommonCookieAttributeHandler...)constructors instead.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.http.cookie.CookieSpec
formatCookies, getVersion, getVersionHeader, match, parse, validate
-
-
-
-
Field Detail
-
attribHandlerMap
private final java.util.Map<java.lang.String,CookieAttributeHandler> attribHandlerMap
Stores attribute name -> attribute handler mappings
-
-
Constructor Detail
-
AbstractCookieSpec
public AbstractCookieSpec()
Default constructor
-
AbstractCookieSpec
protected AbstractCookieSpec(java.util.HashMap<java.lang.String,CookieAttributeHandler> map)
- Since:
- 4.4
-
AbstractCookieSpec
protected AbstractCookieSpec(CommonCookieAttributeHandler... handlers)
- Since:
- 4.4
-
-
Method Detail
-
registerAttribHandler
@Deprecated public void registerAttribHandler(java.lang.String name, CookieAttributeHandler handler)Deprecated.(4.4) useAbstractCookieSpec(java.util.HashMap)orAbstractCookieSpec(org.apache.http.cookie.CommonCookieAttributeHandler...)constructors instead.
-
findAttribHandler
protected CookieAttributeHandler findAttribHandler(java.lang.String name)
Finds an attribute handlerCookieAttributeHandlerfor the given attribute. Returnsnullif no attribute handler is found for the specified attribute.- Parameters:
name- attribute name. e.g. Domain, Path, etc.- Returns:
- an attribute handler or
null
-
getAttribHandler
protected CookieAttributeHandler getAttribHandler(java.lang.String name)
Gets attribute handlerCookieAttributeHandlerfor the given attribute.- Parameters:
name- attribute name. e.g. Domain, Path, etc.- Throws:
java.lang.IllegalStateException- if handler not found for the specified attribute.
-
getAttribHandlers
protected java.util.Collection<CookieAttributeHandler> getAttribHandlers()
-
-