-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from candy-kingdom/feature/43-properties-access
Do not expose private getters and setters
- Loading branch information
Showing
22 changed files
with
409 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# [Summary.DocEvent](../src/Core/DocEvent.cs#L9) | ||
```cs | ||
public record DocEvent : DocMember | ||
``` | ||
|
||
A [`DocMember`](./DocMember.md) that represents a documented event in the parsed source code. | ||
|
||
_Similar to [`DocProperty`](./DocProperty.md) but with its own set of accessors._ | ||
|
||
## Properties | ||
### [Type](../src/Core/DocEvent.cs#L14) | ||
```cs | ||
public required DocType Type { get; init; } | ||
``` | ||
|
||
The type of the event. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
# [Summary.DocProperty](../src/Core/DocProperty.cs#L6) | ||
# [Summary.DocProperty](../src/Core/DocProperty.cs#L8) | ||
```cs | ||
public record DocProperty : DocMember | ||
``` | ||
|
||
A [`DocMember`](./DocMember.md) that represents a documented property in the parsed source code. | ||
|
||
## Properties | ||
### [Type](../src/Core/DocProperty.cs#L11) | ||
### [Type](../src/Core/DocProperty.cs#L13) | ||
```cs | ||
public required DocType Type { get; init; } | ||
``` | ||
|
||
The type of the property. | ||
|
||
### [Generated](../src/Core/DocProperty.cs#L16) | ||
### [Accessors](../src/Core/DocProperty.cs#L18) | ||
```cs | ||
public required DocPropertyAccessor[] Accessors { get; init; } | ||
``` | ||
|
||
The accessors of the property (e.g., `get`, `set`, `init`). | ||
|
||
### [Generated](../src/Core/DocProperty.cs#L23) | ||
```cs | ||
public required bool Generated { get; init; } | ||
``` | ||
|
||
Whether this property was generated by compiler (e.g., it's a property of a record). | ||
|
||
### [Event](../src/Core/DocProperty.cs#L21) | ||
### [Event](../src/Core/DocProperty.cs#L29) | ||
```cs | ||
public required bool Event { get; init; } | ||
``` | ||
|
||
Whether this property represents an event. | ||
|
||
### [AccessorsDeclaration](../src/Core/DocProperty.cs#L34) | ||
```cs | ||
public string AccessorsDeclaration { get; } | ||
``` | ||
|
||
The declaration of property accessors as they declared in the C# source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# [Summary.DocPropertyAccessor](../src/Core/DocPropertyAccessor.cs#L6) | ||
```cs | ||
public record DocPropertyAccessor | ||
``` | ||
|
||
One of the [`DocProperty`](./DocProperty.md) accessors (e.g., `get`, `set`, `init`). | ||
|
||
## Fields | ||
### [Access](../src/Core/DocPropertyAccessor.cs#L29) | ||
```cs | ||
public AccessModifier? Access | ||
``` | ||
|
||
The access modifier of the accessor. | ||
If the value is `null`, then the access modifier is inherited from the property declaration. | ||
|
||
### [Kind](../src/Core/DocPropertyAccessor.cs#L34) | ||
```cs | ||
public AccessorKind Kind | ||
``` | ||
|
||
The kind of the accessor. | ||
|
||
## Methods | ||
### [Defaults()](../src/Core/DocPropertyAccessor.cs#L11) | ||
```cs | ||
public static DocPropertyAccessor[] Defaults() | ||
``` | ||
|
||
The sequence that consists only of a default `public get` property accessor. | ||
|
||
### [Default()](../src/Core/DocPropertyAccessor.cs#L19) | ||
```cs | ||
public static DocPropertyAccessor Default() | ||
``` | ||
|
||
The default `public get` property accessor. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# [Summary.Pipelines.FilteringExtensions](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L9) | ||
```cs | ||
public static class FilteringExtensions | ||
``` | ||
|
||
A set of extensions for [`SummaryPipeline`](./SummaryPipeline.md) that add support for filtering functionality. | ||
|
||
## Methods | ||
### [UseDefaultFilters(SummaryPipeline)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L14) | ||
```cs | ||
public static SummaryPipeline UseDefaultFilters(this SummaryPipeline self) | ||
``` | ||
|
||
Enables default filters for the given pipeline (i.e. a filter that removes all non-public members). | ||
|
||
### [IncludeAtLeast(SummaryPipeline, AccessModifier)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L29) | ||
```cs | ||
public static SummaryPipeline IncludeAtLeast(this SummaryPipeline self, AccessModifier access) | ||
``` | ||
|
||
Includes only members that have at least the given access modifier. | ||
|
||
#### Example | ||
In order to include both `internal` and `public` members in the generated docs, | ||
you can call this method as follows: | ||
```cs | ||
var pipeline = ...; | ||
|
||
pipeline.IncludeAtLeast(AccessModifier.Internal); | ||
``` | ||
|
||
### [IncludeOnly(SummaryPipeline, AccessModifier)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L44) | ||
```cs | ||
public static SummaryPipeline IncludeOnly(this SummaryPipeline self, AccessModifier access) | ||
``` | ||
|
||
Includes only members that have at least the given access modifier. | ||
|
||
#### Example | ||
In order to include onl `internal` members in the generated docs, | ||
you can call this method as follows: | ||
```cs | ||
var pipeline = ...; | ||
|
||
pipeline.IncludeOnly(AccessModifier.Internal); | ||
``` | ||
|
||
### [WithAccess(SummaryPipeline, Func<AccessModifier, bool>)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L50) | ||
```cs | ||
public static SummaryPipeline WithAccess(this SummaryPipeline self, Func<AccessModifier, bool> p) | ||
``` | ||
|
||
Includes only members that have the access modifier that satisfies the given predicate. | ||
|
||
### [UseFilter(SummaryPipeline, IPipe<Doc, Doc>)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L67) | ||
```cs | ||
public static SummaryPipeline UseFilter(this SummaryPipeline self, IPipe<Doc, Doc> filter) | ||
``` | ||
|
||
Adds the given filter into the pipeline. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.