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 Object
implements CookieSpec
Abstract cookie specification which can delegate the job of parsing,
validation or matching cookie attributes to a number of arbitrary
CookieAttributeHandlers.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String,CookieAttributeHandler> Stores attribute name -> attribute handler mappings -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault constructorprotectedprotectedAbstractCookieSpec(CommonCookieAttributeHandler... handlers) -
Method Summary
Modifier and TypeMethodDescriptionprotected CookieAttributeHandlerfindAttribHandler(String name) Finds an attribute handlerCookieAttributeHandlerfor the given attribute.protected CookieAttributeHandlergetAttribHandler(String name) Gets attribute handlerCookieAttributeHandlerfor the given attribute.protected Collection<CookieAttributeHandler>voidregisterAttribHandler(String name, CookieAttributeHandler handler) Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.http.cookie.CookieSpec
formatCookies, getVersion, getVersionHeader, match, parse, validate
-
Field Details
-
attribHandlerMap
Stores attribute name -> attribute handler mappings
-
-
Constructor Details
-
AbstractCookieSpec
public AbstractCookieSpec()Default constructor -
AbstractCookieSpec
- Since:
- 4.4
-
AbstractCookieSpec
- Since:
- 4.4
-
-
Method Details
-
registerAttribHandler
Deprecated.(4.4) useAbstractCookieSpec(java.util.HashMap)orAbstractCookieSpec(org.apache.http.cookie.CommonCookieAttributeHandler...)constructors instead. -
findAttribHandler
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
Gets attribute handlerCookieAttributeHandlerfor the given attribute.- Parameters:
name- attribute name. e.g. Domain, Path, etc.- Throws:
IllegalStateException- if handler not found for the specified attribute.
-
getAttribHandlers
-
AbstractCookieSpec(java.util.HashMap)orAbstractCookieSpec(org.apache.http.cookie.CommonCookieAttributeHandler...)constructors instead.