Klasse DefaultParserService

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.parser.DefaultParserService
Alle implementierten Schnittstellen:
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 $
Autor:
Thomas Vandahl
  • Konstruktordetails

    • DefaultParserService

      public DefaultParserService()
    • DefaultParserService

      public DefaultParserService(org.apache.commons.pool2.impl.GenericObjectPoolConfig<?> config)
  • Methodendetails

    • getParameterEncoding

      public String getParameterEncoding()
      Get the character encoding that will be used by this ValueParser.
      Angegeben von:
      getParameterEncoding in Schnittstelle ParserService
      Gibt zurück:
      A String for the parameter encoding
    • 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.
      Angegeben von:
      convert in Schnittstelle ParserService
      Parameter:
      value - A String to be processed.
      Gibt zurück:
      A new String converted to the case as specified by URL_CASE_FOLDING and trimmed.
    • convertAndTrim

      public String convertAndTrim(String value)
      Convert a String value according to the url-case-folding property.
      Angegeben von:
      convertAndTrim in Schnittstelle ParserService
      Parameter:
      value - the String to convert
      Gibt zurück:
      a new String.
    • 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.
      Angegeben von:
      convertAndTrim in Schnittstelle ParserService
      Parameter:
      value - A String to be processed.
      fold - The parameter folding to be applied (see ParserService)
      Gibt zurück:
      A new String converted to lowercase and trimmed.
    • getUrlFolding

      public ValueParser.URLCaseFolding getUrlFolding()
      Gets the folding value from the configuration
      Angegeben von:
      getUrlFolding in Schnittstelle ParserService
      Gibt zurück:
      The current Folding Value
    • getAutomaticUpload

      public boolean getAutomaticUpload()
      Gets the automaticUpload value from the configuration
      Angegeben von:
      getAutomaticUpload in Schnittstelle ParserService
      Gibt zurück:
      The current automaticUpload Value
    • parseUpload

      public List<Part> parseUpload(HttpServletRequest request) throws org.apache.avalon.framework.service.ServiceException
      Parse the given request for uploaded files
      Angegeben von:
      parseUpload in Schnittstelle ParserService
      Parameter:
      request - the HttpServletRequest object
      Gibt zurück:
      A list of Parts
      Löst aus:
      org.apache.avalon.framework.service.ServiceException - if parsing fails
    • getParser

      public <P extends ValueParser> P getParser(Class<P> ppClass) throws InstantiationException
      Get a ValueParser instance from the service. Use the given Class to create the object.
      Angegeben von:
      getParser in Schnittstelle ParserService
      Typparameter:
      P - The ValueParser we are using
      Parameter:
      ppClass - parameter parser class
      Gibt zurück:
      An object that implements ValueParser
      Löst aus:
      InstantiationException - if the instance could not be created
    • 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().
      Angegeben von:
      putParser in Schnittstelle ParserService
      Parameter:
      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
      Angegeben von:
      configure in Schnittstelle org.apache.avalon.framework.configuration.Configurable
      Parameter:
      conf - the configuration
      Löst aus:
      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
      Angegeben von:
      service in Schnittstelle org.apache.avalon.framework.service.Serviceable
      Parameter:
      manager - The service manager instance
      Löst aus:
      org.apache.avalon.framework.service.ServiceException - generic exception