Skip to content

Commit a05564e

Browse files
committed
Added missing documentation
1 parent eb70926 commit a05564e

File tree

65 files changed

+699
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+699
-13
lines changed

BeanIO/Annotation/SegmentAttribute.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace BeanIO.Annotation
66
{
7+
/// <summary>
8+
/// Segment annotation applied to class members or methods
9+
/// </summary>
710
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)]
811
public class SegmentAttribute : Attribute
912
{

BeanIO/BeanIO.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<DefineConstants>TRACE</DefineConstants>
3434
<ErrorReport>prompt</ErrorReport>
3535
<WarningLevel>4</WarningLevel>
36+
<DocumentationFile>bin\Release\BeanIO.XML</DocumentationFile>
3637
</PropertyGroup>
3738
<ItemGroup>
3839
<Compile Include="Annotation\FieldAttribute.cs" />

BeanIO/BeanReader.cs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,74 @@
22

33
namespace BeanIO
44
{
5+
/// <summary>
6+
/// Abstract basic bean reader implementation
7+
/// </summary>
58
public abstract class BeanReader : IBeanReader
69
{
10+
/// <summary>
11+
/// Error handler to handle exceptions thrown by <see cref="IBeanReader.Read"/>.
12+
/// </summary>
713
public event BeanReaderErrorHandlerDelegate Error;
814

15+
/// <summary>
16+
/// Gets or sets the record or group name of the most recent bean object read from this reader,
17+
/// or null if the end of the stream was reached.
18+
/// </summary>
919
public string RecordName { get; protected set; }
1020

21+
/// <summary>
22+
/// Gets or sets the starting line number of the first record for the most recent bean
23+
/// object read from this reader, or -1 when the end of the stream is reached.
24+
/// The line number may be zero if new lines are not used to separate characters.
25+
/// </summary>
1126
public int LineNumber { get; protected set; }
1227

28+
/// <summary>
29+
/// Gets the number of records read from the underlying input stream for the
30+
/// most recent bean object read from this reader. This typically returns 1
31+
/// unless a bean object was mapped to a record group which may span
32+
/// multiple records.
33+
/// </summary>
1334
public abstract int RecordCount { get; }
1435

36+
/// <summary>
37+
/// Gets the record information for all bean objects read from this reader.
38+
/// If a bean object can span multiple records, <see cref="IBeanReader.RecordCount"/> can be used
39+
/// to determine how many records were read from the stream.
40+
/// </summary>
41+
/// <param name="index">the index of the record, starting at 0</param>
42+
/// <returns>the <see cref="IRecordContext"/></returns>
1543
public abstract IRecordContext GetRecordContext(int index);
1644

45+
/// <summary>
46+
/// Reads a single bean from the input stream.
47+
/// </summary>
48+
/// <remarks>
49+
/// If the end of the stream is reached, null is returned.
50+
/// </remarks>
51+
/// <returns>The bean read, or null if the end of the stream was reached.</returns>
1752
public abstract object Read();
1853

54+
/// <summary>
55+
/// Skips ahead in the input stream.
56+
/// </summary>
57+
/// <remarks>
58+
/// Record validation errors are ignored, but a malformed record, unidentified
59+
/// record, or record out of sequence, will cause an exception that halts stream
60+
/// reading. Exceptions thrown by this method are not passed to the error handler.
61+
/// </remarks>
62+
/// <param name="count">The number of bean objects to skip over that would have been
63+
/// returned by calling <see cref="IBeanReader.Read"/>.
64+
/// </param>
65+
/// <returns>the number of skipped bean objects, which may be less than <paramref name="count"/>
66+
/// if the end of the stream was reached
67+
/// </returns>
1968
public abstract int Skip(int count);
2069

70+
/// <summary>
71+
/// Closes the underlying input stream.
72+
/// </summary>
2173
public abstract void Close();
2274

2375
/// <summary>

BeanIO/BeanReaderErrorEventArgs.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@
22

33
namespace BeanIO
44
{
5+
/// <summary>
6+
/// The event arguments for the bean reader error
7+
/// </summary>
58
public class BeanReaderErrorEventArgs : EventArgs
69
{
10+
/// <summary>
11+
/// Initializes a new instance of the <see cref="BeanReaderErrorEventArgs"/> class.
12+
/// </summary>
13+
/// <param name="exception">The exception to pass to the event handler</param>
714
public BeanReaderErrorEventArgs(BeanReaderException exception)
815
{
916
Exception = exception;
1017
}
1118

19+
/// <summary>
20+
/// Gets the exception that occurred while reading a bean.
21+
/// </summary>
1222
public BeanReaderException Exception { get; private set; }
1323
}
1424
}

BeanIO/Builder/Align.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace BeanIO.Builder
44
{
5+
/// <summary>
6+
/// The text alignment
7+
/// </summary>
58
public enum Align
69
{
710
/// <summary>

BeanIO/Builder/CsvParserBuilder.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,105 @@ public class CsvParserBuilder : IParserBuilder
1111
{
1212
private readonly CsvRecordParserFactory _parser = new CsvRecordParserFactory();
1313

14+
/// <summary>
15+
/// Sets the delimiter character
16+
/// </summary>
17+
/// <param name="delimiter">The delimiter to set</param>
18+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
1419
public CsvParserBuilder Delimiter(char delimiter)
1520
{
1621
_parser.Delimiter = delimiter;
1722
return this;
1823
}
1924

25+
/// <summary>
26+
/// Sets the quote character
27+
/// </summary>
28+
/// <param name="quote">The quote character to set</param>
29+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
2030
public CsvParserBuilder Quote(char quote)
2131
{
2232
_parser.Quote = quote;
2333
return this;
2434
}
2535

36+
/// <summary>
37+
/// Sets the escape character
38+
/// </summary>
39+
/// <param name="escape">The escape character to set</param>
40+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
2641
public CsvParserBuilder Escape(char escape)
2742
{
2843
_parser.Escape = escape;
2944
return this;
3045
}
3146

47+
/// <summary>
48+
/// Sets the record terminator
49+
/// </summary>
50+
/// <param name="terminator">The record terminator to set</param>
51+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
3252
public CsvParserBuilder RecordTerminator(string terminator)
3353
{
3454
_parser.RecordTerminator = terminator;
3555
return this;
3656
}
3757

58+
/// <summary>
59+
/// Enables the detection of comments using the following comment indicators
60+
/// </summary>
61+
/// <param name="comments">The comment indicators to set</param>
62+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
3863
public CsvParserBuilder EnableComments(params string[] comments)
3964
{
4065
_parser.Comments = comments;
4166
return this;
4267
}
4368

69+
/// <summary>
70+
/// Enables multi line records
71+
/// </summary>
72+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
4473
public CsvParserBuilder EnableMultiline()
4574
{
4675
_parser.IsMultilineEnabled = true;
4776
return this;
4877
}
4978

79+
/// <summary>
80+
/// Allow unquoted whitespace characters
81+
/// </summary>
82+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
5083
public CsvParserBuilder AllowUnquotedWhitespace()
5184
{
5285
_parser.IsWhitespaceAllowed = true;
5386
return this;
5487
}
5588

89+
/// <summary>
90+
/// Allow unquoted quotes
91+
/// </summary>
92+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
5693
public CsvParserBuilder AllowUnquotedQuotes()
5794
{
5895
_parser.UnquotedQuotesAllowed = true;
5996
return this;
6097
}
6198

99+
/// <summary>
100+
/// Always quote all field values
101+
/// </summary>
102+
/// <returns>the <see cref="CsvParserBuilder"/></returns>
62103
public CsvParserBuilder AlwaysQuote()
63104
{
64105
_parser.AlwaysQuote = true;
65106
return this;
66107
}
67108

109+
/// <summary>
110+
/// Builds the configuration about the record parser factory.
111+
/// </summary>
112+
/// <returns>The configuration for the record parser factory.</returns>
68113
public BeanConfig<IRecordParserFactory> Build()
69114
{
70115
var config = new BeanConfig<IRecordParserFactory>(() => _parser);

BeanIO/Builder/DelimitedParserBuilder.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,81 @@ public class DelimitedParserBuilder : IParserBuilder
1111
{
1212
private readonly DelimitedRecordParserFactory _parser = new DelimitedRecordParserFactory();
1313

14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="DelimitedParserBuilder"/> class.
16+
/// </summary>
1417
public DelimitedParserBuilder()
1518
{
1619
}
1720

21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="DelimitedParserBuilder"/> class.
23+
/// </summary>
24+
/// <param name="delimiter">The field delimiter to use</param>
1825
public DelimitedParserBuilder(char delimiter)
1926
{
2027
_parser.Delimiter = delimiter;
2128
}
2229

30+
/// <summary>
31+
/// Sets the field delimiter character
32+
/// </summary>
33+
/// <param name="delimiter">The field delimiter character to set</param>
34+
/// <returns>the <see cref="DelimitedParserBuilder"/></returns>
2335
public DelimitedParserBuilder Delimiter(char delimiter)
2436
{
2537
_parser.Delimiter = delimiter;
2638
return this;
2739
}
2840

41+
/// <summary>
42+
/// Sets the record terminator string
43+
/// </summary>
44+
/// <param name="terminator">The record terminator to set</param>
45+
/// <returns>the <see cref="DelimitedParserBuilder"/></returns>
2946
public DelimitedParserBuilder RecordTerminator(string terminator)
3047
{
3148
_parser.RecordTerminator = terminator;
3249
return this;
3350
}
3451

52+
/// <summary>
53+
/// Sets the escape character.
54+
/// </summary>
55+
/// <param name="escape">The escape character to use</param>
56+
/// <returns>the <see cref="DelimitedParserBuilder"/></returns>
3557
public DelimitedParserBuilder EnableEscape(char escape)
3658
{
3759
_parser.Escape = escape;
3860
return this;
3961
}
4062

63+
/// <summary>
64+
/// Enable line continuation using the following escape character
65+
/// </summary>
66+
/// <param name="c">The line continuation escape character to use</param>
67+
/// <returns>the <see cref="DelimitedParserBuilder"/></returns>
4168
public DelimitedParserBuilder EnableLineContinuation(char c)
4269
{
4370
_parser.LineContinuationCharacter = c;
4471
return this;
4572
}
4673

74+
/// <summary>
75+
/// Enables the detection of comments using the following comment indicators
76+
/// </summary>
77+
/// <param name="comments">The comment indicators to set</param>
78+
/// <returns>the <see cref="DelimitedParserBuilder"/></returns>
4779
public DelimitedParserBuilder EnableComments(params string[] comments)
4880
{
4981
_parser.Comments = comments;
5082
return this;
5183
}
5284

85+
/// <summary>
86+
/// Builds the configuration about the record parser factory.
87+
/// </summary>
88+
/// <returns>The configuration for the record parser factory.</returns>
5389
public BeanConfig<IRecordParserFactory> Build()
5490
{
5591
var config = new BeanConfig<IRecordParserFactory>(() => _parser);

BeanIO/Builder/FieldBuilder.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66

77
namespace BeanIO.Builder
88
{
9+
/// <summary>
10+
/// Builds the field configuration
11+
/// </summary>
912
public class FieldBuilder : PropertyBuilderSupport<FieldBuilder, FieldConfig>
1013
{
1114
private FieldConfig _config;
1215

16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="FieldBuilder"/> class.
18+
/// </summary>
19+
/// <param name="name">The field name</param>
1320
public FieldBuilder(string name)
1421
{
1522
_config = new FieldConfig()

BeanIO/Builder/FixedLengthParserBuilder.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public FixedLengthParserBuilder EnableComments(params string[] comments)
4444
return this;
4545
}
4646

47+
/// <summary>
48+
/// Builds the configuration about the record parser factory.
49+
/// </summary>
50+
/// <returns>The configuration for the record parser factory.</returns>
4751
public BeanConfig<IRecordParserFactory> Build()
4852
{
4953
var config = new BeanConfig<IRecordParserFactory>(() => _parser);

BeanIO/Builder/GroupBuilder.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace BeanIO.Builder
44
{
5+
/// <summary>
6+
/// Builds a new group configuration
7+
/// </summary>
58
public class GroupBuilder : GroupBuilderSupport<GroupBuilder, GroupConfig>
69
{
710
private GroupConfig _config;

0 commit comments

Comments
 (0)