org.apache.cocoon.transformation
Class JPathTransformer

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by org.apache.cocoon.transformation.AbstractTransformer
                  extended by org.apache.cocoon.transformation.AbstractSAXTransformer
                      extended by org.apache.cocoon.transformation.JPathTransformer
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Initializable, Component, Configurable, LogEnabled, Serviceable, SitemapModelComponent, Transformer, XMLPipe, XMLProducer, XMLConsumer, ContentHandler, LexicalHandler

public class JPathTransformer
extends AbstractSAXTransformer
implements Initializable

Version:
$Id: JPathTransformer.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Marcus Crafter

Field Summary
static String JPATH_ACTION
          jpath:action attribute constant
static String JPATH_CONTINUATION
          jpath:continuation element constant
static String JPATH_CONTINUATION_SELECT
          jpath:continuation select attribute constant
static String JPATH_IF
          jpath:if element constant
static String JPATH_NAMESPACE_URI
          namespace constant
static String JPATH_TEST
          jpath generic test attribute
static String JPATH_VALUEOF
          jpath:value-of element constant
static String JPATH_VALUEOF_SELECT
          jpath:value-of select attribute constant
 
Fields inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
context, defaultNamespaceURI, EMPTY_ATTRIBUTES, emptyAttributes, ignoreEmptyCharacters, ignoreEventsCount, ignoreHooksCount, ignoreWhitespaces, manager, namespaceURI, objectModel, parameters, recorderStack, request, resolver, response, source, stack
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
 
Constructor Summary
JPathTransformer()
           
 
Method Summary
 void endTransformingElement(String uri, String name, String raw)
          Exit method for all elements in our namespace
 void initialize()
          Initialize this transformer.
 void recycle()
          Release all held resources.
 void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters)
          Setup this transformer
 void startElement(String uri, String loc, String raw, Attributes a)
          Intercept startElement to ensure all <jpath:action> attributes are modified.
 void startTransformingElement(String uri, String name, String raw, Attributes attr)
          Entry method for all elements in our namespace
 
Methods inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
addRecorder, characters, comment, configure, dispose, endCDATA, endDocument, endDTD, endElement, endEntity, endParametersRecording, endParametersRecording, endPrefixMapping, endRecording, endSAXRecording, endSerializedXMLRecording, endTextRecording, findPrefixMapping, getMutableAttributes, ignorableWhitespace, processingInstruction, removeRecorder, sendEndElementEvent, sendEndElementEventNS, sendEndPrefixMapping, sendEvents, sendParametersEvents, sendStartElementEvent, sendStartElementEvent, sendStartElementEventNS, sendStartElementEventNS, sendStartPrefixMapping, sendTextEvent, service, setDocumentLocator, setupTransforming, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startParametersRecording, startPrefixMapping, startRecording, startSAXRecording, startSerializedXMLRecording, startTextRecording
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

JPATH_NAMESPACE_URI

public static final String JPATH_NAMESPACE_URI
namespace constant

See Also:
Constant Field Values

JPATH_ACTION

public static final String JPATH_ACTION
jpath:action attribute constant

See Also:
Constant Field Values

JPATH_VALUEOF

public static final String JPATH_VALUEOF
jpath:value-of element constant

See Also:
Constant Field Values

JPATH_VALUEOF_SELECT

public static final String JPATH_VALUEOF_SELECT
jpath:value-of select attribute constant

See Also:
Constant Field Values

JPATH_CONTINUATION

public static final String JPATH_CONTINUATION
jpath:continuation element constant

See Also:
Constant Field Values

JPATH_CONTINUATION_SELECT

public static final String JPATH_CONTINUATION_SELECT
jpath:continuation select attribute constant

See Also:
Constant Field Values

JPATH_IF

public static final String JPATH_IF
jpath:if element constant

See Also:
Constant Field Values

JPATH_TEST

public static final String JPATH_TEST
jpath generic test attribute

See Also:
Constant Field Values
Constructor Detail

JPathTransformer

public JPathTransformer()
Method Detail

initialize

public void initialize()
                throws Exception
Initialize this transformer.

Specified by:
initialize in interface Initializable
Throws:
Exception - if an error occurs

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String src,
                  Parameters parameters)
           throws ProcessingException,
                  SAXException,
                  IOException
Setup this transformer

Specified by:
setup in interface SitemapModelComponent
Overrides:
setup in class AbstractSAXTransformer
Parameters:
resolver - a SourceResolver instance
objectModel - the objectModel
src - src parameter
parameters - optional parameters
Throws:
ProcessingException - if an error occurs
SAXException - if an error occurs
IOException - if an error occurs

startElement

public void startElement(String uri,
                         String loc,
                         String raw,
                         Attributes a)
                  throws SAXException
Intercept startElement to ensure all <jpath:action> attributes are modified.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class AbstractSAXTransformer
Parameters:
uri - a String value
loc - a String value
raw - a String value
a - an Attributes value
Throws:
SAXException - if an error occurs
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

startTransformingElement

public void startTransformingElement(String uri,
                                     String name,
                                     String raw,
                                     Attributes attr)
                              throws ProcessingException,
                                     IOException,
                                     SAXException
Entry method for all elements in our namespace

Overrides:
startTransformingElement in class AbstractSAXTransformer
Parameters:
uri - a String value
name - a String value
raw - a String value
attr - an Attributes value
Throws:
ProcessingException - if an error occurs
IOException - if an error occurs
SAXException - if an error occurs

endTransformingElement

public void endTransformingElement(String uri,
                                   String name,
                                   String raw)
                            throws ProcessingException,
                                   IOException,
                                   SAXException
Exit method for all elements in our namespace

Overrides:
endTransformingElement in class AbstractSAXTransformer
Parameters:
uri - a String value
name - a String value
raw - a String value
Throws:
ProcessingException - if an error occurs
IOException - if an error occurs
SAXException - if an error occurs

recycle

public void recycle()
Release all held resources.

Specified by:
recycle in interface Recyclable
Overrides:
recycle in class AbstractSAXTransformer


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.