@Override
    public void require(int type, String namespaceURI, String localName) throws XMLStreamException {
        if(type != getEventType()){
            throw new XMLStreamException("required event " + type + " but got event " + getEventType());
        }
        
        if(localName != null){
            if(!localName.equals(clocalname)){
                throw new XMLStreamException("required name " + localName + " but got name " + clocalname);
            }
        }
        
        if(namespaceURI != null){
            if(!namespaceURI.equals(curi)){
                throw new XMLStreamException("required namespace " + namespaceURI + " but got namespace " + curi);
            }
        }
    }