nu.validator.xml
Class IdFilter

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by nu.validator.xml.IdFilter
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, XMLFilter, XMLReader

public class IdFilter
extends XMLFilterImpl

Supports XML 1.0 only! String interning must be on!

Version:
$Id$
Author:
hsivonen

Field Summary
private  Map<String,Locator> ids
           
private  Locator locator
           
private static Pattern NCNAME_PATTERN
           
private  IdnessChangingAttributesWrapper wrapper
           
 
Constructor Summary
IdFilter()
           
IdFilter(XMLReader parent)
           
 
Method Summary
private  String avNormalize(String value)
           
private  void checkId(String name, String value)
           
 void endDocument()
           
 void setDocumentLocator(Locator locator)
           
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes atts)
           
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NCNAME_PATTERN

private static final Pattern NCNAME_PATTERN

ids

private final Map<String,Locator> ids

wrapper

private final IdnessChangingAttributesWrapper wrapper

locator

private Locator locator
Constructor Detail

IdFilter

public IdFilter()

IdFilter

public IdFilter(XMLReader parent)
Parameters:
parent -
Method Detail

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class XMLFilterImpl
Throws:
SAXException
See Also:
XMLFilterImpl.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

avNormalize

private String avNormalize(String value)

checkId

private void checkId(String name,
                     String value)
              throws SAXException
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class XMLFilterImpl
Throws:
SAXException
See Also:
XMLFilterImpl.endDocument()

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class XMLFilterImpl
Throws:
SAXException
See Also:
XMLFilterImpl.startDocument()

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class XMLFilterImpl
See Also:
XMLFilterImpl.setDocumentLocator(org.xml.sax.Locator)