Package org.apache.fulcrum.parser
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
-
Feldübersicht
Von Schnittstelle geerbte Felder org.apache.fulcrum.parser.ParserService
AUTOMATIC_DEFAULT, AUTOMATIC_KEY, DEFAULT_MAX_IDLE, DEFAULT_POOL_CAPACITY, FULCRUM_POOL_DEFAULT, FULCRUM_POOL_KEY, PARAMETER_ENCODING_DEFAULT, PARAMETER_ENCODING_KEY, POOL_KEY, ROLE, URL_CASE_FOLDING_KEY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefaultParserService
(org.apache.commons.pool2.impl.GenericObjectPoolConfig<?> config) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
configure
(org.apache.avalon.framework.configuration.Configuration conf) Avalon component lifecycle methodTrims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING.convertAndTrim
(String value) Convert a String value according to the url-case-folding property.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.boolean
Gets the automaticUpload value from the configurationGet the character encoding that will be used by this ValueParser.<P extends ValueParser>
PGet aValueParser
instance from the service.Gets the folding value from the configurationparseUpload
(HttpServletRequest request) Parse the given request for uploaded filesvoid
putParser
(ValueParser parser) Clears the parse and puts it back into the pool service.void
service
(org.apache.avalon.framework.service.ServiceManager manager) Avalon component lifecycle methodvoid
setParameterEncoding
(String encoding) Set the character encoding that will be used by this ValueParser.Von Klasse geerbte Methoden org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Konstruktordetails
-
DefaultParserService
public DefaultParserService() -
DefaultParserService
public DefaultParserService(org.apache.commons.pool2.impl.GenericObjectPoolConfig<?> config)
-
-
Methodendetails
-
getParameterEncoding
Get the character encoding that will be used by this ValueParser.- Angegeben von:
getParameterEncoding
in SchnittstelleParserService
- Gibt zurück:
- A String for the parameter encoding
-
setParameterEncoding
Set the character encoding that will be used by this ValueParser. -
convert
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 SchnittstelleParserService
- 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
Convert a String value according to the url-case-folding property.- Angegeben von:
convertAndTrim
in SchnittstelleParserService
- Parameter:
value
- the String to convert- Gibt zurück:
- a new String.
-
convertAndTrim
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 SchnittstelleParserService
- Parameter:
value
- A String to be processed.fold
- The parameter folding to be applied (seeParserService
)- Gibt zurück:
- A new String converted to lowercase and trimmed.
-
getUrlFolding
Gets the folding value from the configuration- Angegeben von:
getUrlFolding
in SchnittstelleParserService
- Gibt zurück:
- The current Folding Value
-
getAutomaticUpload
public boolean getAutomaticUpload()Gets the automaticUpload value from the configuration- Angegeben von:
getAutomaticUpload
in SchnittstelleParserService
- 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 SchnittstelleParserService
- Parameter:
request
- the HttpServletRequest object- Gibt zurück:
- A list of
Part
s - Löst aus:
org.apache.avalon.framework.service.ServiceException
- if parsing fails
-
getParser
Get aValueParser
instance from the service. Use the given Class to create the object.- Angegeben von:
getParser
in SchnittstelleParserService
- 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
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 instedaValueParser.dispose()
.- Angegeben von:
putParser
in SchnittstelleParserService
- 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 Schnittstelleorg.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 Schnittstelleorg.apache.avalon.framework.service.Serviceable
- Parameter:
manager
- The service manager instance- Löst aus:
org.apache.avalon.framework.service.ServiceException
- generic exception
-