    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.www.http.HttpBag

    java.lang.Object
       |
       +----org.w3c.www.http.BasicValue
               |
               +----org.w3c.www.http.HttpBag

public class HttpBag
extends BasicValue

Internal representation of protocol headers conforming to the bag spec. The bag specification is part of the Protocol Extension Protocol defined by w3c, it can be found

##

addBag(HttpBag)
  Add a named bag into this bag.
addItem(HttpBag)
  Add a sub-bag to this bag.
addItem(String)
  Add an item into this bag.
getBag(String)
  Get a named sub-bag from this bag.
getName()
  Get this bag names
getValue()
  HeaderValue implemenntation - Get this header value.
hasBag(String)
  Does this bag have a named sub-bag of the given name ?
hasItem(String)
  Does this bag contains the given item, being a bag or a simple word.
isToplevelBag()
  Is that a top level bag or not ?
keys()
  Get all named items from this bag.
parse()
  parse.
parseBag(ParseState)
  parse bag.
removeItem(String)
  Remove an item from that bag.
updateByteValue()
  Update the RFC822 compatible header value for this object.

##

updateByteValue

     protected final void updateByteValue()

  Update the RFC822 compatible header value for this object.

  Overrides:
    updateByteValue in class BasicValue

parseBag

     protected HttpBag parseBag(ParseState ps) throws HttpParserException

  parse bag.

  Throws: HttpParserException
    if parsing failed.

parse

     protected final void parse() throws HttpParserException

  parse.

  Throws: HttpParserException
    if parsing failed.
  Overrides:
    parse in class BasicValue

getValue

     public Object getValue()

  HeaderValue implemenntation - Get this header value.

  Overrides:
    getValue in class BasicValue

getName

     public String getName()

  Get this bag names

  Returns:
    The name of this bag.

addBag

     public void addBag(HttpBag subbag)

  Add a named bag into this bag.

  Parameters:
    bag - The bag to add (in case item is a bag).

hasBag

     public boolean hasBag(String name)

  Does this bag have a named sub-bag of the given name ?

  Parameters:
    name - The name of the sub-bag to be tested for.
  Returns:
    true if this sub-bag exists.

getBag

     public HttpBag getBag(String name)

  Get a named sub-bag from this bag.

  Parameters:
    name - The name of the sub-bag to get.
  Returns:
    A bag instance, or null if none was found.

addItem

     public void addItem(String name)

  Add an item into this bag.

  Parameters:
    name - The new item name.

addItem

     public void addItem(HttpBag subbag)

  Add a sub-bag to this bag.

  Parameters:
    subbag - The sub-bag to add.

hasItem

     public boolean hasItem(String name)

  Does this bag contains the given item, being a bag or a simple word.

  Parameters:
    name - The name of the item to test.
  Returns:
    true if the bag contains the given item, false otherwise.

removeItem

     public void removeItem(String name)

  Remove an item from that bag.

  Parameters:
    name - The name of the item to remove.

keys

     public Enumeration keys()

  Get all named items from this bag. This include both named sub-bags and items by their own.

isToplevelBag

     public boolean isToplevelBag()

  Is that a top level bag or not ?

  Returns:
    A boolean, true if the bag was a toplevel bag.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index