Package crawlercommons.sitemaps.sax
Class DelegatorHandler
- java.lang.Object
- 
- org.xml.sax.helpers.DefaultHandler
- 
- crawlercommons.sitemaps.sax.DelegatorHandler
 
 
- 
- All Implemented Interfaces:
- ContentHandler,- DTDHandler,- EntityResolver,- ErrorHandler
 
 public class DelegatorHandler extends DefaultHandler Provides a base SAX handler for parsing of XML documents representing sub-classes of AbstractSiteMap.
- 
- 
Constructor SummaryConstructors Modifier Constructor Description DelegatorHandler(URL url, boolean strict)protectedDelegatorHandler(LinkedList<String> elementStack, boolean strict)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendCharacterBuffer(char[] ch, int start, int length)protected voidappendCharacterBuffer(String str)voidcharacters(char[] ch, int start, int length)protected StringcurrentElement()protected StringcurrentElementParent()voidendElement(String uri, String localName, String qName)voiderror(SAXParseException e)voidfatalError(SAXParseException e)protected StringgetAndResetCharacterBuffer()UnknownFormatExceptiongetException()AbstractSiteMapgetSiteMap()protected URLgetUrl()protected booleanisAcceptedNamespace(String uri)static booleanisAllBlank(CharSequence charSeq)Return true if character sequence contains only white space including Unicode whitespace, cf.protected booleanisExtensionNamespace(String uri)protected booleanisStrict()protected booleanisStrictNamespace()static booleanisWhitespace(char c)Check whether character is any Unicode whitespace, including the space characters not covered byCharacter.isWhitespace(char)protected voidresetCharacterBuffer()voidsetAcceptedNamespaces(Set<String> acceptedSet)protected voidsetException(UnknownFormatException exception)voidsetExtensionNamespaces(Map<String,Extension> extensionMap)voidsetStrictNamespace(boolean s)voidsetURLFilter(Function<String,String> urlFilter)voidstartElement(String uri, String localName, String qName, Attributes attributes)static StringstripAllBlank(CharSequence charSeq)Trim all whitespace including Unicode whitespace- 
Methods inherited from class org.xml.sax.helpers.DefaultHandlerendDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
- 
 
- 
- 
- 
Constructor Detail- 
DelegatorHandlerprotected DelegatorHandler(LinkedList<String> elementStack, boolean strict) 
 - 
DelegatorHandlerpublic DelegatorHandler(URL url, boolean strict) 
 
- 
 - 
Method Detail- 
getUrlprotected URL getUrl() 
 - 
isStrictprotected boolean isStrict() 
 - 
isStrictNamespaceprotected boolean isStrictNamespace() 
 - 
setStrictNamespacepublic void setStrictNamespace(boolean s) 
 - 
isAcceptedNamespaceprotected boolean isAcceptedNamespace(String uri) 
 - 
isExtensionNamespaceprotected boolean isExtensionNamespace(String uri) 
 - 
setExceptionprotected void setException(UnknownFormatException exception) 
 - 
getExceptionpublic UnknownFormatException getException() 
 - 
startElementpublic void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
- startElementin interface- ContentHandler
- Overrides:
- startElementin class- DefaultHandler
- Throws:
- SAXException
 
 - 
endElementpublic void endElement(String uri, String localName, String qName) throws SAXException - Specified by:
- endElementin interface- ContentHandler
- Overrides:
- endElementin class- DefaultHandler
- Throws:
- SAXException
 
 - 
characterspublic void characters(char[] ch, int start, int length) throws SAXException- Specified by:
- charactersin interface- ContentHandler
- Overrides:
- charactersin class- DefaultHandler
- Throws:
- SAXException
 
 - 
appendCharacterBufferprotected void appendCharacterBuffer(char[] ch, int start, int length)
 - 
appendCharacterBufferprotected void appendCharacterBuffer(String str) 
 - 
getAndResetCharacterBufferprotected String getAndResetCharacterBuffer() 
 - 
resetCharacterBufferprotected void resetCharacterBuffer() 
 - 
currentElementprotected String currentElement() 
 - 
currentElementParentprotected String currentElementParent() 
 - 
getSiteMappublic AbstractSiteMap getSiteMap() 
 - 
errorpublic void error(SAXParseException e) throws SAXException - Specified by:
- errorin interface- ErrorHandler
- Overrides:
- errorin class- DefaultHandler
- Throws:
- SAXException
 
 - 
fatalErrorpublic void fatalError(SAXParseException e) throws SAXException - Specified by:
- fatalErrorin interface- ErrorHandler
- Overrides:
- fatalErrorin class- DefaultHandler
- Throws:
- SAXException
 
 - 
isAllBlankpublic static boolean isAllBlank(CharSequence charSeq) Return true if character sequence contains only white space including Unicode whitespace, cf.isWhitespace(char)
 - 
isWhitespacepublic static boolean isWhitespace(char c) Check whether character is any Unicode whitespace, including the space characters not covered byCharacter.isWhitespace(char)
 - 
stripAllBlankpublic static String stripAllBlank(CharSequence charSeq) Trim all whitespace including Unicode whitespace
 
- 
 
-