View Javadoc

    1   package org.jaxen.javabean;
    2
    3   import java.util.Iterator;
    4
    5   public class ElementIterator
    6       implements Iterator
    7   {
    8       private Element parent;
    9       private String name;
    10      private Iterator iterator;
    11
    12      public ElementIterator(Element parent,
    13                             String name,
    14                             Iterator iterator)
    15      {
    16          this.parent    = parent;
    17          this.name     = name;
    18          this.iterator = iterator;
    19      }
    20
    21      public boolean hasNext()
    22      {
    23          return this.iterator.hasNext();
    24      }
    25
    26      public Object next()
    27      {
    28          return new Element( parent,
    29                              this.name,
    30                              this.iterator.next() );
    31      }
    32
    33      public void remove()
    34      {
    35          throw new UnsupportedOperationException();
    36      }
    37  }