org.kuali.rice.kew.xml
Class AbstractTransformationFilter

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by org.kuali.rice.kew.xml.AbstractTransformationFilter
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, XMLFilter, XMLReader

public abstract class AbstractTransformationFilter
extends XMLFilterImpl

This abstract class handles the xml stack of elements and makes it easier to run a transformation on certain elements.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Nested Class Summary
 class AbstractTransformationFilter.CurrentElement
           
 
Constructor Summary
AbstractTransformationFilter()
           
 
Method Summary
 void endElement(String uri, String localName, String qName)
           
abstract  List<KeyValue> getElementTransformationList()
           
abstract  String getStartingElementPath()
          This method returns the element that we should start transforming at.
protected  String getTrimmedCurrentElementKey(String currentElementKey)
           
 void startElement(String uri, String localName, String qName, Attributes atts)
           
abstract  AbstractTransformationFilter.CurrentElement transformEndElement(AbstractTransformationFilter.CurrentElement currentElement)
          This method allows you to modify the element passed in.
abstract  AbstractTransformationFilter.CurrentElement transformStartElement(AbstractTransformationFilter.CurrentElement currentElement)
          This method allows you to modify the element passed in.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTransformationFilter

public AbstractTransformationFilter()
Method Detail

transformStartElement

public abstract AbstractTransformationFilter.CurrentElement transformStartElement(AbstractTransformationFilter.CurrentElement currentElement)
                                                                           throws SAXException
This method allows you to modify the element passed in. The returned element will be pushed into a "super.startElement(uri, localName, qName, atts)" call.

Parameters:
currentElement -
Returns:
Throws:
SAXException

transformEndElement

public abstract AbstractTransformationFilter.CurrentElement transformEndElement(AbstractTransformationFilter.CurrentElement currentElement)
                                                                         throws SAXException
This method allows you to modify the element passed in. The returned element will be pushed into a "super.endElement(uri, localName, qName" call.

Parameters:
currentElement -
Returns:
Throws:
SAXException

getElementTransformationList

public abstract List<KeyValue> getElementTransformationList()

getStartingElementPath

public abstract String getStartingElementPath()
This method returns the element that we should start transforming at. So, if we had: We might want to start transforming at the group level. In that case the startingElement = "group"

Returns:

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

getTrimmedCurrentElementKey

protected String getTrimmedCurrentElementKey(String currentElementKey)

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class XMLFilterImpl
Throws:
SAXException


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.