Package org.dlese.dpc.util.uri
Class UriMappings
java.lang.Object
org.dlese.dpc.util.uri.UriMappings
- All Implemented Interfaces:
ContentHandler
Utility class for mapping "static" URIs (i.e. "catalog_(\S+).htm") to
dynamic ones (i.e. "view_resource.do?description=$1") using regexes
- Author:
- ryandear@ucar.edu
-
Constructor Summary
ConstructorsConstructorDescriptionUriMappings(ServletContext servletContext, String xmlParserClass) Constructor for the UrlMappings object -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) (SAX) Element data (characters between tags, not used here)void(SAX) Invoked at the end of parsing.voidendElement(String namespaceURI, String localName, String qName) (SAX) Invoked upon closing tag of an XML element (not used here)voidendPrefixMapping(String prefix) (SAX) Required by SAX, but not used heregetForwardPage(HttpServletRequest request) Gets the forwardPage attribute of the UrlMappings objectvoidignorableWhitespace(char[] ch, int start, int length) (SAX) Reports any whitespace that is ignored because it falls outside of the DTD or schema definition--usefull for re-generating the file with indents intact.voidloadMappings(String configFile) Load URL mappings from the supplied configuration filevoidprocessingInstruction(String target, String data) (SAX) Required by SAX, but not used herestatic final voidsetDebug(boolean db) Sets the debug attribute of the DDSServlet objectvoidsetDocumentLocator(Locator locator) (SAX) Sets the SAX locator, which indicates the current position of the parser within the document (line number, column number).voidskippedEntity(String name) (SAX) Required by SAX, but not used herevoid(SAX) Invoked at the start of any document parsevoidstartElement(String namespaceURI, String localName, String qName, Attributes atts) (SAX) Invoked upon opening tag of an XML elementvoidstartPrefixMapping(String prefix, String uri) (SAX) Required by SAX, but not used hereMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
UriMappings
Constructor for the UrlMappings object- Parameters:
servletContext-xmlParserClass-
-
-
Method Details
-
loadMappings
Load URL mappings from the supplied configuration file- Parameters:
configFile-
-
getForwardPage
Gets the forwardPage attribute of the UrlMappings object- Parameters:
request-- Returns:
- The forwardPage value
-
setDocumentLocator
(SAX) Sets the SAX locator, which indicates the current position of the parser within the document (line number, column number). Could be used to indicate the spot where an error occured.- Specified by:
setDocumentLocatorin interfaceContentHandler- Parameters:
locator- The new saxLocator value
-
startDocument
(SAX) Invoked at the start of any document parse- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
(SAX) Invoked at the end of parsing. Rewrite the definitions XML if new Ids have been assigned.- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException (SAX) Invoked upon opening tag of an XML element- Specified by:
startElementin interfaceContentHandler- Parameters:
namespaceURI-localName-qName-atts-- Throws:
SAXException
-
endElement
(SAX) Invoked upon closing tag of an XML element (not used here)- Specified by:
endElementin interfaceContentHandler- Parameters:
namespaceURI- XML namespacelocalName- local tag nameqName- fully qualified tag name- Throws:
SAXException
-
characters
(SAX) Element data (characters between tags, not used here)- Specified by:
charactersin interfaceContentHandler- Parameters:
ch-start-length-- Throws:
SAXException
-
ignorableWhitespace
(SAX) Reports any whitespace that is ignored because it falls outside of the DTD or schema definition--usefull for re-generating the file with indents intact.- Specified by:
ignorableWhitespacein interfaceContentHandler- Parameters:
ch-start-length-- Throws:
SAXException
-
startPrefixMapping
(SAX) Required by SAX, but not used here- Specified by:
startPrefixMappingin interfaceContentHandler- Parameters:
prefix-uri-- Throws:
SAXException
-
endPrefixMapping
(SAX) Required by SAX, but not used here- Specified by:
endPrefixMappingin interfaceContentHandler- Parameters:
prefix-- Throws:
SAXException
-
processingInstruction
(SAX) Required by SAX, but not used here- Specified by:
processingInstructionin interfaceContentHandler- Parameters:
target-data-- Throws:
SAXException
-
skippedEntity
(SAX) Required by SAX, but not used here- Specified by:
skippedEntityin interfaceContentHandler- Parameters:
name-- Throws:
SAXException
-
setDebug
public static final void setDebug(boolean db) Sets the debug attribute of the DDSServlet object- Parameters:
db- The new debug value
-