org.deegree.commons.xml
Class FixedChildIterator

java.lang.Object
  extended by org.deegree.commons.xml.FixedChildIterator
All Implemented Interfaces:
Iterable<org.apache.axiom.om.OMElement>, Iterator<org.apache.axiom.om.OMElement>

public class FixedChildIterator
extends Object
implements Iterable<org.apache.axiom.om.OMElement>, Iterator<org.apache.axiom.om.OMElement>

This is a child element iterator that expects a fixed number of child elements. It will throw an XMLParsingException when an element is missing, or when you access the last expected element and there are stil child elements left.

Version:
$Revision: 30119 $, $Date: 2011-03-22 10:02:35 +0100 (Tue, 22 Mar 2011) $
Author:
Oliver Tonnhofer, last edited by: $Author: aschmitz $

Constructor Summary
FixedChildIterator(org.apache.axiom.om.OMElement parent, int expectedChildren)
           
 
Method Summary
 boolean hasNext()
           
 Iterator<org.apache.axiom.om.OMElement> iterator()
           
 org.apache.axiom.om.OMElement next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedChildIterator

public FixedChildIterator(org.apache.axiom.om.OMElement parent,
                          int expectedChildren)
Parameters:
parent -
expectedChildren - the number of expected child elements
Method Detail

next

public org.apache.axiom.om.OMElement next()
Specified by:
next in interface Iterator<org.apache.axiom.om.OMElement>

iterator

public Iterator<org.apache.axiom.om.OMElement> iterator()
Specified by:
iterator in interface Iterable<org.apache.axiom.om.OMElement>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<org.apache.axiom.om.OMElement>

remove

public void remove()
Specified by:
remove in interface Iterator<org.apache.axiom.om.OMElement>


Copyright © 2011. All Rights Reserved.