Package org.alfresco.repo.processor
Class BaseProcessor
- java.lang.Object
-
- org.alfresco.repo.processor.BaseProcessor
-
- All Implemented Interfaces:
Processor
- Direct Known Subclasses:
FreeMarkerProcessor,RhinoScriptProcessor,XSLTProcessor
public abstract class BaseProcessor extends Object implements Processor
Base class of a processor, encapsulates the implementation reguarding the registration of the processor with the relevant services and the handling of processor extensions.- Author:
- Roy Wetherall
-
-
Field Summary
Fields Modifier and Type Field Description protected StringextensionThe file extension that this processor understandsprotected StringnameThe name of the processorprotected Map<String,ProcessorExtension>processorExtensionsA map containing all the processor extenstionsprotected ScriptServicescriptServiceThe script serviceprotected ServiceRegistryservicesThe service registryprotected TemplateServicetemplateServiceThe template service
-
Constructor Summary
Constructors Constructor Description BaseProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetExtension()Gets the extension that the processor understandsStringgetName()Get the name of the processorCollection<ProcessorExtension>getProcessorExtensions()Get the collection of processor extensionsvoidregister()Registers this processor with the relevant servicesvoidregisterProcessorExtension(ProcessorExtension processorExtension)Registers a processor extension with the processorvoidsetExtension(String extension)Sets the extenstion that the processor understandsvoidsetName(String name)Sets the name of the processorvoidsetScriptService(ScriptService scriptService)Sets the script servicevoidsetServiceRegistry(ServiceRegistry serviceRegistry)Sets the service registryvoidsetTemplateService(TemplateService templateService)Sets the template service
-
-
-
Field Detail
-
name
protected String name
The name of the processor
-
extension
protected String extension
The file extension that this processor understands
-
scriptService
protected ScriptService scriptService
The script service
-
templateService
protected TemplateService templateService
The template service
-
services
protected ServiceRegistry services
The service registry
-
processorExtensions
protected Map<String,ProcessorExtension> processorExtensions
A map containing all the processor extenstions
-
-
Method Detail
-
register
public void register()
Registers this processor with the relevant services
-
setScriptService
public void setScriptService(ScriptService scriptService)
Sets the script service- Parameters:
scriptService- the script service
-
setTemplateService
public void setTemplateService(TemplateService templateService)
Sets the template service- Parameters:
templateService- the template service
-
setServiceRegistry
public void setServiceRegistry(ServiceRegistry serviceRegistry)
Sets the service registry- Parameters:
serviceRegistry- the service registry
-
getName
public String getName()
Get the name of the processor
-
setName
public void setName(String name)
Sets the name of the processor- Parameters:
name- the name of the processor
-
getExtension
public String getExtension()
Gets the extension that the processor understands- Specified by:
getExtensionin interfaceProcessor- Returns:
- String the extension
-
setExtension
public void setExtension(String extension)
Sets the extenstion that the processor understands- Parameters:
extension- the extension
-
registerProcessorExtension
public void registerProcessorExtension(ProcessorExtension processorExtension)
Registers a processor extension with the processor- Specified by:
registerProcessorExtensionin interfaceProcessor- Parameters:
processorExtension- the processor extension
-
getProcessorExtensions
public Collection<ProcessorExtension> getProcessorExtensions()
Get the collection of processor extensions- Returns:
- collection of processor extensions
-
-