## org.eclipse.jetty.util.component
Class Container

    java.lang.Object
      org.eclipse.jetty.util.component.Container

    public class Container

extends java.lang.Object

Container. This class allows a containment events to be generated from update methods. The style of usage is:

       public void setFoo(Foo foo)
       {
           getContainer().update(this,this.foo,foo,"foo");
           this.foo=foo;
       }

       public void setBars(Bar[] bars)
       {
           getContainer().update(this,this.bars,bars,"bar");
           this.bars=bars;
       }

Nested Class Summary
`static interface` `Container.Listener` Listener.
`static class` `Container.Relationship` A Container event.

Constructor Summary
`Container()`

Method Summary
`void` `addBean(java.lang.Object obj)`
`void` `addEventListener(Container.Listener listener)`
`void` `removeBean(java.lang.Object obj)`
`void` `removeEventListener(Container.Listener listener)`
`void` `update(java.lang.Object parent, java.lang.Object[] oldChildren, java.lang.Object[] children, java.lang.String relationship)` Update multiple parent to child relationship.
`void` `update(java.lang.Object parent, java.lang.Object[] oldChildren, java.lang.Object[] children, java.lang.String relationship, boolean addRemove)` Update multiple parent to child relationship.
`void` `update(java.lang.Object parent, java.lang.Object oldChild, java.lang.Object child, java.lang.String relationship)` Update single parent to child relationship.
`void` `update(java.lang.Object parent, java.lang.Object oldChild, java.lang.Object child, java.lang.String relationship, boolean addRemove)` Update single parent to child relationship.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Container

    public Container()

Method Detail

### addEventListener

    public void addEventListener(Container.Listener listener)

### removeEventListener

    public void removeEventListener(Container.Listener listener)

### update

    public void update(java.lang.Object parent,
                       java.lang.Object oldChild,
                       java.lang.Object child,
                       java.lang.String relationship)

  Update single parent to child relationship.

  Parameters:
    `parent` - The parent of the child.
    `oldChild` - The previous value of the child. If this is non null and differs from `child`, then a remove event is generated.
    `child` - The current child. If this is non null and differs from `oldChild`, then an add event is generated.
    `relationship` - The name of the relationship

### update

    public void update(java.lang.Object parent,
                       java.lang.Object oldChild,
                       java.lang.Object child,
                       java.lang.String relationship,
                       boolean addRemove)

  Update single parent to child relationship.

  Parameters:
    `parent` - The parent of the child.
    `oldChild` - The previous value of the child. If this is non null and differs from `child`, then a remove event is generated.
    `child` - The current child. If this is non null and differs from `oldChild`, then an add event is generated.
    `relationship` - The name of the relationship
    `addRemove` - If true add/remove is called for the new/old children as well as the relationships

### update

    public void update(java.lang.Object parent,
                       java.lang.Object[] oldChildren,
                       java.lang.Object[] children,
                       java.lang.String relationship)

  Update multiple parent to child relationship.

  Parameters:
    `parent` - The parent of the child.
    `oldChildren` - The previous array of children. A remove event is generated for any child in this array but not in the `children` array. This array is modified and children that remain in the new children array are nulled out of the old children array.
    `children` - The current array of children. An add event is generated for any child in this array but not in the `oldChildren` array.
    `relationship` - The name of the relationship

### update

    public void update(java.lang.Object parent,
                       java.lang.Object[] oldChildren,
                       java.lang.Object[] children,
                       java.lang.String relationship,
                       boolean addRemove)

  Update multiple parent to child relationship.

  Parameters:
    `parent` - The parent of the child.
    `oldChildren` - The previous array of children. A remove event is generated for any child in this array but not in the `children` array. This array is modified and children that remain in the new children array are nulled out of the old children array.
    `children` - The current array of children. An add event is generated for any child in this array but not in the `oldChildren` array.
    `relationship` - The name of the relationship
    `addRemove` - If true add/remove is called for the new/old children as well as the relationships

### addBean

    public void addBean(java.lang.Object obj)

### removeBean

    public void removeBean(java.lang.Object obj)

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.