Class DefaultParserService

  • All Implemented Interfaces:
    org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, ParserService

    public class DefaultParserService
    extends org.apache.avalon.framework.logger.AbstractLogEnabled
    implements ParserService, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.service.Serviceable
    The DefaultParserService provides the default implementation of a ParserService.
    Version:
    $Id: BaseValueParser.java 542062 2007-05-28 00:29:43Z seade $
    Author:
    Thomas Vandahl
    • Method Detail

      • setParameterEncoding

        public void setParameterEncoding​(String encoding)
        Set the character encoding that will be used by this ValueParser.
      • convert

        public String convert​(String value)
        Trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING. It returns a new string so that it does not destroy the value data.
        Specified by:
        convert in interface ParserService
        Parameters:
        value - A String to be processed.
        Returns:
        A new String converted to the case as specified by URL_CASE_FOLDING and trimmed.
      • convertAndTrim

        public String convertAndTrim​(String value,
                                     ValueParser.URLCaseFolding fold)
        A static version of the convert method, which trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING. It returns a new string so that it does not destroy the value data.
        Specified by:
        convertAndTrim in interface ParserService
        Parameters:
        value - A String to be processed.
        fold - The parameter folding to be applied (see ParserService)
        Returns:
        A new String converted to lowercase and trimmed.
      • parseUpload

        public List<PartparseUpload​(HttpServletRequest request)
                               throws org.apache.avalon.framework.service.ServiceException
        Parse the given request for uploaded files
        Specified by:
        parseUpload in interface ParserService
        Parameters:
        request - the HttpServletRequest object
        Returns:
        A list of Parts
        Throws:
        org.apache.avalon.framework.service.ServiceException - if parsing fails
      • putParser

        public void putParser​(ValueParser parser)
        Clears the parse and puts it back into the pool service. This allows for pooling and recycling As we are not yet using org.apache.fulcrum.pool.Recyclable, we call insteda ValueParser.dispose().
        Specified by:
        putParser in interface ParserService
        Parameters:
        parser - The value parser to use
      • configure

        public void configure​(org.apache.avalon.framework.configuration.Configuration conf)
                       throws org.apache.avalon.framework.configuration.ConfigurationException
        Avalon component lifecycle method
        Specified by:
        configure in interface org.apache.avalon.framework.configuration.Configurable
        Parameters:
        conf - the configuration
        Throws:
        org.apache.avalon.framework.configuration.ConfigurationException - Generic exception
      • service

        public void service​(org.apache.avalon.framework.service.ServiceManager manager)
                     throws org.apache.avalon.framework.service.ServiceException
        Avalon component lifecycle method
        Specified by:
        service in interface org.apache.avalon.framework.service.Serviceable
        Parameters:
        manager - The service manager instance
        Throws:
        org.apache.avalon.framework.service.ServiceException - generic exception