C# Class Summer.Batch.Core.Converter.DefaultJobParametersConverter

Converter for JobParameters instances using a simple naming convention for property keys. Key names that are prefixed with a '-' are considered non-identifying and will not contribute to the identity of a JobInstance. Key names ending with "<type>" where type is one of string, date, long are converted to the corresponding type. The default type is string. E.g. schedule.date(date)=2007/12/11 department.id(long)=2345 The literal values are converted to the correct type using the default strategies, augmented if necessary by the custom editors provided. If you need to be able to parse and format local-specific dates and numbers, you can inject formatters (NumberStyles,LongNumberStyles,NumberFormat,DecimalFormat)
Inheritance: IJobParametersConverter
Datei anzeigen Open project: SummerBatch/SummerBatch Class Usage Examples

Public Methods

Method Description
GetJobParameters ( NameValueCollection props ) : JobParameters

Checks for suffix on keys and use those to decide how to convert the value.

GetProperties ( JobParameters parms ) : NameValueCollection

Use the same suffixes to create properties (omitting the string suffix because it is the default). Non-identifying parameters will be prefixed with the NonIdentifyingFlag. However, since parameters are identifying by default, they will not be prefixed with the IdentifyingFlag.

Private Methods

Method Description
IsIdentifyingKey ( string key ) : bool
ParseDouble ( string value ) : double

Parses given value as a double.

ParseLong ( string value ) : long

Parses given value as a long.

Method Details

GetJobParameters() public method

Checks for suffix on keys and use those to decide how to convert the value.
  if a number or date is passed in that cannot be parsed, or cast to the correct type.
public GetJobParameters ( NameValueCollection props ) : JobParameters
props System.Collections.Specialized.NameValueCollection
return JobParameters

GetProperties() public method

Use the same suffixes to create properties (omitting the string suffix because it is the default). Non-identifying parameters will be prefixed with the NonIdentifyingFlag. However, since parameters are identifying by default, they will not be prefixed with the IdentifyingFlag.
public GetProperties ( JobParameters parms ) : NameValueCollection
parms JobParameters
return System.Collections.Specialized.NameValueCollection