protected Capacity parseCapacity ( XMLStreamReader reader ) throws XMLStreamException , ParserException , ValidateException { Extension incrementer = null ; Extension decrementer = null ; while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case END_ELEMENT : { switch ( reader . getLocalName ( ) ) { case CommonXML . ELEMENT_CAPACITY : return new CapacityImpl ( incrementer , decrementer ) ; default : break ; } } case START_ELEMENT : { switch ( reader . getLocalName ( ) ) { case CommonXML . ELEMENT_INCREMENTER : { incrementer = parseExtension ( reader , CommonXML . ELEMENT_INCREMENTER ) ; break ; } case CommonXML . ELEMENT_DECREMENTER : { decrementer = parseExtension ( reader , CommonXML . ELEMENT_DECREMENTER ) ; break ; } default : // Nothing } break ; } default : throw new ParserException ( bundle . unexpectedElement ( reader . getLocalName ( ) ) ) ; } } throw new ParserException ( bundle . unexpectedEndOfDocument ( ) ) ; }
Parse capacity tag