Summer.Batch.Core.Converter.DefaultJobParametersConverter Class Reference

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. More...

Inheritance diagram for Summer.Batch.Core.Converter.DefaultJobParametersConverter:
Summer.Batch.Core.Converter.IJobParametersConverter

Public Member Functions

JobParameters GetJobParameters (NameValueCollection props)
 Checks for suffix on keys and use those to decide how to convert the value. More...
 
NameValueCollection GetProperties (JobParameters parms)
 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. More...
 

Public Attributes

const string DateType = "(date)"
 Date type constant. More...
 
const string StringType = "(string)"
 String type constant. More...
 
const string LongType = "(long)"
 Long type constant. More...
 

Properties

string DateFormat [set]
 Date format property. More...
 
NumberStyles NumberStyles [set]
 Number style property. More...
 
NumberStyles LongNumberStyles [set]
 Long number style property. More...
 
string NumberFormat [set]
 Numer format property. More...
 
string DecimalFormat [set]
 Decimal format property. More...
 

Detailed Description

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)

Member Function Documentation

JobParameters Summer.Batch.Core.Converter.DefaultJobParametersConverter.GetJobParameters ( NameValueCollection  props)

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

Parameters
props
Returns
Exceptions
ArgumentException  if a number or date is passed in that cannot be parsed, or cast to the correct type.

Implements Summer.Batch.Core.Converter.IJobParametersConverter.

NameValueCollection Summer.Batch.Core.Converter.DefaultJobParametersConverter.GetProperties ( JobParameters  parms)

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.

Parameters
parms
Returns

Implements Summer.Batch.Core.Converter.IJobParametersConverter.

Member Data Documentation

const string Summer.Batch.Core.Converter.DefaultJobParametersConverter.DateType = "(date)"

Date type constant.

const string Summer.Batch.Core.Converter.DefaultJobParametersConverter.LongType = "(long)"

Long type constant.

const string Summer.Batch.Core.Converter.DefaultJobParametersConverter.StringType = "(string)"

String type constant.

Property Documentation

string Summer.Batch.Core.Converter.DefaultJobParametersConverter.DateFormat
set

Date format property.

string Summer.Batch.Core.Converter.DefaultJobParametersConverter.DecimalFormat
set

Decimal format property.

NumberStyles Summer.Batch.Core.Converter.DefaultJobParametersConverter.LongNumberStyles
set

Long number style property.

string Summer.Batch.Core.Converter.DefaultJobParametersConverter.NumberFormat
set

Numer format property.

NumberStyles Summer.Batch.Core.Converter.DefaultJobParametersConverter.NumberStyles
set

Number style property.


The documentation for this class was generated from the following file:
  • Summer.Batch.Core/Core/Converter/DefaultJobParametersConverter.cs