Class BaseProcessor

  • All Implemented Interfaces:
    org.alfresco.processor.Processor
    Direct Known Subclasses:
    FreeMarkerProcessor, RhinoScriptProcessor, XSLTProcessor

    public abstract class BaseProcessor
    extends java.lang.Object
    implements org.alfresco.processor.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
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseProcessor()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getExtension()
      Gets the extension that the processor understands
      java.lang.String getName()
      Get the name of the processor
      java.util.Collection<org.alfresco.processor.ProcessorExtension> getProcessorExtensions()
      Get the collection of processor extensions
      void register()
      Registers this processor with the relevant services
      void registerProcessorExtension​(org.alfresco.processor.ProcessorExtension processorExtension)
      Registers a processor extension with the processor
      void setExtension​(java.lang.String extension)
      Sets the extenstion that the processor understands
      void setName​(java.lang.String name)
      Sets the name of the processor
      void setScriptService​(ScriptService scriptService)
      Sets the script service
      void setServiceRegistry​(ServiceRegistry serviceRegistry)
      Sets the service registry
      void setTemplateService​(TemplateService templateService)
      Sets the template service
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
        The name of the processor
      • extension

        protected java.lang.String extension
        The file extension that this processor understands
      • scriptService

        protected ScriptService scriptService
        The script service
      • templateService

        protected TemplateService templateService
        The template service
      • processorExtensions

        protected java.util.Map<java.lang.String,​org.alfresco.processor.ProcessorExtension> processorExtensions
        A map containing all the processor extenstions
    • Constructor Detail

      • BaseProcessor

        public BaseProcessor()
    • 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 java.lang.String getName()
        Get the name of the processor
        Specified by:
        getName in interface org.alfresco.processor.Processor
        Returns:
        String the name of the processor
      • setName

        public void setName​(java.lang.String name)
        Sets the name of the processor
        Parameters:
        name - the name of the processor
      • getExtension

        public java.lang.String getExtension()
        Gets the extension that the processor understands
        Specified by:
        getExtension in interface org.alfresco.processor.Processor
        Returns:
        String the extension
      • setExtension

        public void setExtension​(java.lang.String extension)
        Sets the extenstion that the processor understands
        Parameters:
        extension - the extension
      • registerProcessorExtension

        public void registerProcessorExtension​(org.alfresco.processor.ProcessorExtension processorExtension)
        Registers a processor extension with the processor
        Specified by:
        registerProcessorExtension in interface org.alfresco.processor.Processor
        Parameters:
        processorExtension - the processor extension
      • getProcessorExtensions

        public java.util.Collection<org.alfresco.processor.ProcessorExtension> getProcessorExtensions()
        Get the collection of processor extensions
        Returns:
        collection of processor extensions