fr.gouv.culture.sdx.pipeline
Class AbstractTransformation
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
fr.gouv.culture.sdx.utils.xml.AbstractSdxXMLPipe
fr.gouv.culture.sdx.pipeline.AbstractTransformation
- All Implemented Interfaces:
- Transformation, Describable, Encodable, Identifiable, Localizable, SdxObject, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer, org.apache.excalibur.xml.sax.XMLConsumer, org.apache.excalibur.xml.sax.XMLizable, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler
- Direct Known Subclasses:
- AbstractNodeBasedTransformation, AbstractXSLTTransformation, DeleteResultsTransformation, FieldExpansionTransformation, GetDocumentsTransformation, GroupInformationInserter
public abstract class AbstractTransformation
- extends AbstractSdxXMLPipe
- implements Transformation
An abstract transformation for basic operations.
This abstract class properly handle the super.getLog() and the parameters.
Field Summary |
protected org.apache.excalibur.source.SourceResolver |
_resolver
The SourceResolver to use. |
protected static java.lang.String |
PARAMETER_NAME_DISABLE
|
protected static java.lang.String |
PARAMETER_NAME_ENABLE
|
protected org.apache.avalon.framework.parameters.Parameters |
parameters
The parameters for this transformation provided by the pipeline via the setParameters() method. |
protected org.apache.avalon.framework.parameters.Parameters |
transParameters
The parameters for this transformation provided by the Parameteriable interface's
parameterize method. |
Fields inherited from class fr.gouv.culture.sdx.utils.xml.AbstractSdxXMLPipe |
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Method Summary |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Loads base configuration common to all transformations. |
protected java.lang.String |
getClassNameSuffix()
Sub classes should element this method to return their class name suffix for SAX output |
org.apache.avalon.framework.parameters.Parameters |
getParameters()
The parameters for this transformation. |
protected boolean |
initToSax()
Init the DefaultContext class _xmlizable_objects with the objects in order to describ them in XML |
protected void |
initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML
Some objects need to be refresh each time a toSAX is called |
protected boolean |
isStepEnabled()
Returns a boolean indicating whether
this transformation is enabled
first check the tranformations parameters
secondly checking the parameters passed
from the containing pipeline |
void |
recycle()
Recycles the contentHandler, lexicalHandler, and xmlConsumer for the transformation |
void |
service(org.apache.avalon.framework.service.ServiceManager serviceManager)
Keeps the SourceResolver. |
void |
setParameters(org.apache.avalon.framework.parameters.Parameters p)
Sets some parameters from a pipeline. |
boolean |
shouldKeepResult()
Indicates wheter the results of this transfomation should be retained |
protected void |
verifyConfigurationParameters(org.apache.avalon.framework.parameters.Parameters params)
|
Methods inherited from class fr.gouv.culture.sdx.utils.xml.AbstractSdxXMLPipe |
configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
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.xml.sax.ContentHandler |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
setConsumer |
Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
getLog |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
enableLogging |
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable |
contextualize |
Methods inherited from interface org.apache.excalibur.xml.sax.XMLizable |
toSAX |
PARAMETER_NAME_DISABLE
protected static final java.lang.String PARAMETER_NAME_DISABLE
- See Also:
- Constant Field Values
PARAMETER_NAME_ENABLE
protected static final java.lang.String PARAMETER_NAME_ENABLE
- See Also:
- Constant Field Values
_resolver
protected org.apache.excalibur.source.SourceResolver _resolver
- The SourceResolver to use.
parameters
protected org.apache.avalon.framework.parameters.Parameters parameters
- The parameters for this transformation provided by the pipeline via the setParameters() method.
- See Also:
this.setParameters()
transParameters
protected org.apache.avalon.framework.parameters.Parameters transParameters
- The parameters for this transformation provided by the Parameteriable interface's
parameterize method.
- See Also:
this.parameterize();
AbstractTransformation
public AbstractTransformation()
service
public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
throws org.apache.avalon.framework.service.ServiceException
- Keeps the SourceResolver.
- Specified by:
service
in interface org.apache.avalon.framework.service.Serviceable
- Overrides:
service
in class AbstractSdxXMLPipe
- Throws:
org.apache.avalon.framework.service.ServiceException
getParameters
public org.apache.avalon.framework.parameters.Parameters getParameters()
- Description copied from interface:
Transformation
- The parameters for this transformation.
- Specified by:
getParameters
in interface Transformation
setParameters
public void setParameters(org.apache.avalon.framework.parameters.Parameters p)
- Sets some parameters from a pipeline.
- Specified by:
setParameters
in interface Transformation
- Parameters:
p
- The parameters
recycle
public void recycle()
- Recycles the contentHandler, lexicalHandler, and xmlConsumer for the transformation
- Specified by:
recycle
in interface Transformation
- Specified by:
recycle
in interface org.apache.avalon.excalibur.pool.Recyclable
- Overrides:
recycle
in class org.apache.cocoon.xml.AbstractXMLProducer
configure
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
- Loads base configuration common to all transformations.
Currently loads the id from the configuraion object.
It will eventually load the optional "keep" parameter which
is used to specify that the results of the transformation
should be retained.
- Specified by:
configure
in interface org.apache.avalon.framework.configuration.Configurable
- Overrides:
configure
in class AbstractSdxXMLPipe
- Parameters:
configuration
- The configuration object
- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
verifyConfigurationParameters
protected void verifyConfigurationParameters(org.apache.avalon.framework.parameters.Parameters params)
shouldKeepResult
public boolean shouldKeepResult()
- Indicates wheter the results of this transfomation should be retained
- Specified by:
shouldKeepResult
in interface Transformation
isStepEnabled
protected boolean isStepEnabled()
- Returns a boolean indicating whether
this transformation is enabled
first check the tranformations parameters
secondly checking the parameters passed
from the containing pipeline
getClassNameSuffix
protected java.lang.String getClassNameSuffix()
- Description copied from class:
AbstractSdxXMLPipe
- Sub classes should element this method to return their class name suffix for SAX output
- Specified by:
getClassNameSuffix
in class AbstractSdxXMLPipe
initToSax
protected boolean initToSax()
- Description copied from class:
AbstractSdxXMLPipe
- Init the DefaultContext class _xmlizable_objects with the objects in order to describ them in XML
- Specified by:
initToSax
in class AbstractSdxXMLPipe
initVolatileObjectsToSax
protected void initVolatileObjectsToSax()
- Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML
Some objects need to be refresh each time a toSAX is called
- Specified by:
initVolatileObjectsToSax
in class AbstractSdxXMLPipe
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.