org.apache.fulcrum.parser
Interface ParserService

All Known Implementing Classes:
DefaultParserService

public interface ParserService

ParserService defines the methods which are needed by the parser objects to get their necessities.

Version:
$Id: ValueParser.java 535465 2007-05-05 06:58:06Z tv $
Author:
Thomas Vandahl

Field Summary
static boolean AUTOMATIC_DEFAULT
           The default value of 'automaticUpload' property (false).
static String AUTOMATIC_KEY
          Parse file upload items automatically
static String PARAMETER_ENCODING_DEFAULT
          Default Encoding for Parameter Parser
static String PARAMETER_ENCODING_KEY
          Key for the Parameter Parser Encoding
static String ROLE
          Avalon Identifier
static String URL_CASE_FOLDING_KEY
          Property for setting the URL folding value
static int URL_CASE_FOLDING_LOWER
          Folding set to "lowercase"
static String URL_CASE_FOLDING_LOWER_VALUE
          Fold to lower case
static int URL_CASE_FOLDING_NONE
          Folding set to "no folding"
static String URL_CASE_FOLDING_NONE_VALUE
          No folding
static int URL_CASE_FOLDING_UNSET
          No folding set
static int URL_CASE_FOLDING_UPPER
          Folding set to "uppercase"
static String URL_CASE_FOLDING_UPPER_VALUE
          Fold to upper case
 
Method Summary
 String convert(String value)
          Trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING.
 String convertAndTrim(String value)
          Convert a String value according to the url-case-folding property.
 String convertAndTrim(String value, int fold)
          A convert method, which trims the string data and applies the conversion specified in the parameter given.
 boolean getAutomaticUpload()
          Gets the automaticUpload value from the configuration
 String getParameterEncoding()
          Get the parameter encoding that has been configured as default for the ParserService.
 ValueParser getParser(Class ppClass)
          Get a ValueParser instance from the service.
 int getUrlFolding()
          Gets the folding value from the configuration
 List parseUpload(javax.servlet.http.HttpServletRequest request)
          Use the UploadService if available to parse the given request for uploaded files
 void putParser(ValueParser parser)
          Return a used Parser to the service.
 

Field Detail

ROLE

static final String ROLE
Avalon Identifier


PARAMETER_ENCODING_DEFAULT

static final String PARAMETER_ENCODING_DEFAULT
Default Encoding for Parameter Parser

See Also:
Constant Field Values

PARAMETER_ENCODING_KEY

static final String PARAMETER_ENCODING_KEY
Key for the Parameter Parser Encoding

See Also:
Constant Field Values

URL_CASE_FOLDING_KEY

static final String URL_CASE_FOLDING_KEY
Property for setting the URL folding value

See Also:
Constant Field Values

URL_CASE_FOLDING_NONE_VALUE

static final String URL_CASE_FOLDING_NONE_VALUE
No folding

See Also:
Constant Field Values

URL_CASE_FOLDING_LOWER_VALUE

static final String URL_CASE_FOLDING_LOWER_VALUE
Fold to lower case

See Also:
Constant Field Values

URL_CASE_FOLDING_UPPER_VALUE

static final String URL_CASE_FOLDING_UPPER_VALUE
Fold to upper case

See Also:
Constant Field Values

URL_CASE_FOLDING_UNSET

static final int URL_CASE_FOLDING_UNSET
No folding set

See Also:
Constant Field Values

URL_CASE_FOLDING_NONE

static final int URL_CASE_FOLDING_NONE
Folding set to "no folding"

See Also:
Constant Field Values

URL_CASE_FOLDING_LOWER

static final int URL_CASE_FOLDING_LOWER
Folding set to "lowercase"

See Also:
Constant Field Values

URL_CASE_FOLDING_UPPER

static final int URL_CASE_FOLDING_UPPER
Folding set to "uppercase"

See Also:
Constant Field Values

AUTOMATIC_KEY

static final String AUTOMATIC_KEY
Parse file upload items automatically

See Also:
Constant Field Values

AUTOMATIC_DEFAULT

static final boolean AUTOMATIC_DEFAULT

The default value of 'automaticUpload' property (false). If set to true, parsing the multipart request will be performed automatically by ParameterParser. Otherwise, an org.apache.turbine.modules.Action may decide to parse the request by calling parseRequest manually.

See Also:
Constant Field Values
Method Detail

getParameterEncoding

String getParameterEncoding()
Get the parameter encoding that has been configured as default for the ParserService.


convert

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.

Parameters:
value - A String to be processed.
Returns:
A new String converted to lowercase and trimmed.

convertAndTrim

String convertAndTrim(String value)
Convert a String value according to the url-case-folding property.

Parameters:
value - the String to convert
Returns:
a new String.

convertAndTrim

String convertAndTrim(String value,
                      int fold)
A convert method, which trims the string data and applies the conversion specified in the parameter given. It returns a new string so that it does not destroy the value data.

Parameters:
value - A String to be processed.
fold - The parameter folding to be applied (see ParserService)
Returns:
A new String converted to the correct case and trimmed.

getUrlFolding

int getUrlFolding()
Gets the folding value from the configuration

Returns:
The current Folding Value

getAutomaticUpload

boolean getAutomaticUpload()
Gets the automaticUpload value from the configuration

Returns:
The current automaticUpload Value

parseUpload

List parseUpload(javax.servlet.http.HttpServletRequest request)
                 throws org.apache.avalon.framework.service.ServiceException
Use the UploadService if available to parse the given request for uploaded files

Returns:
A list of org.apache.commons.upload.FileItems
Throws:
org.apache.avalon.framework.service.ServiceException - if parsing fails or the UploadService is not available

getParser

ValueParser getParser(Class ppClass)
                      throws InstantiationException
Get a ValueParser instance from the service. Use the default imlementation.

Returns:
An object that implements ValueParser
Throws:
InstantiationException - if the instance could not be created

putParser

void putParser(ValueParser parser)
Return a used Parser to the service. This allows for pooling and recycling

Parameters:
parser -


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.