Class 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 arbitrary CookieAttributeHandlers.
    Since:
    4.0
    • 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
    • Method Detail

      • findAttribHandler

        protected CookieAttributeHandler findAttribHandler​(java.lang.String name)
        Finds an attribute handler CookieAttributeHandler for the given attribute. Returns null if 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 handler CookieAttributeHandler for the given attribute.
        Parameters:
        name - attribute name. e.g. Domain, Path, etc.
        Throws:
        java.lang.IllegalStateException - if handler not found for the specified attribute.