Skip to content

Commit 25215e5

Browse files
ars18wrwiText-CI
authored andcommitted
Add missing javadocs
DEVSIX-6349 Autoported commit. Original commit hash: [c46afb5]
1 parent e2201b1 commit 25215e5

File tree

7 files changed

+102
-12
lines changed

7 files changed

+102
-12
lines changed

itext/itext.cleanup/itext/pdfcleanup/PdfCleanUpEventListener.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ source product.
4848
using iText.Kernel.Pdf.Canvas.Parser.Listener;
4949

5050
namespace iText.PdfCleanup {
51+
/// <summary>An event listener which handles cleanup related events.</summary>
5152
public class PdfCleanUpEventListener : IEventListener {
5253
private const String textDataExpected = "Text data expected.";
5354

@@ -57,6 +58,7 @@ public class PdfCleanUpEventListener : IEventListener {
5758

5859
private IList<IEventData> content = new List<IEventData>();
5960

61+
/// <summary><inheritDoc/></summary>
6062
public virtual void EventOccurred(IEventData data, EventType type) {
6163
switch (type) {
6264
case EventType.RENDER_TEXT:
@@ -121,6 +123,7 @@ internal virtual PathRenderInfo GetEncounteredPath() {
121123
return (PathRenderInfo)eventData;
122124
}
123125

126+
/// <summary><inheritDoc/></summary>
124127
public virtual ICollection<EventType> GetSupportedEvents() {
125128
return null;
126129
}

itext/itext.cleanup/itext/pdfcleanup/PdfCleanUpProcessor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ source product.
6464
using iText.PdfCleanup.Util;
6565

6666
namespace iText.PdfCleanup {
67+
/// <summary>PDF content stream processor, which filters content to be cleaned up.</summary>
6768
public class PdfCleanUpProcessor : PdfCanvasProcessor {
6869
private static readonly ICollection<String> TEXT_SHOWING_OPERATORS = JavaCollectionsUtil.UnmodifiableSet(new
6970
HashSet<String>(JavaUtil.ArraysAsList("TJ", "Tj", "'", "\"")));

itext/itext.cleanup/itext/pdfcleanup/PdfCleanUpTool.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,20 @@ public PdfCleanUpTool(PdfDocument pdfDocument, IList<iText.PdfCleanup.PdfCleanUp
197197
}
198198
}
199199

200+
/// <summary>
201+
/// Adds a
202+
/// <see cref="PdfCleanUpLocation"/>
203+
/// to be cleaned up.
204+
/// </summary>
205+
/// <param name="cleanUpLocation">
206+
/// a
207+
/// <see cref="PdfCleanUpLocation"/>
208+
/// to be cleaned up
209+
/// </param>
210+
/// <returns>
211+
/// this
212+
/// <see cref="PdfCleanUpTool"/>
213+
/// </returns>
200214
public virtual iText.PdfCleanup.PdfCleanUpTool AddCleanupLocation(iText.PdfCleanup.PdfCleanUpLocation cleanUpLocation
201215
) {
202216
IList<iText.PdfCleanup.PdfCleanUpLocation> pgLocations = this.pdfCleanUpLocations.Get(cleanUpLocation.GetPage

itext/itext.cleanup/itext/pdfcleanup/autosweep/CompositeCleanupStrategy.cs

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,45 @@ source product.
5151
namespace iText.PdfCleanup.Autosweep {
5252
/// <summary>
5353
/// This class is a composite pattern for
54-
/// <c>ICleanupStrategy</c>
55-
/// It allows users to have multiple ICleanupStrategy implementations and bundle them as one.
54+
/// <see cref="ICleanupStrategy"/>.
5655
/// </summary>
56+
/// <remarks>
57+
/// This class is a composite pattern for
58+
/// <see cref="ICleanupStrategy"/>.
59+
/// It allows users to have multiple ICleanupStrategy implementations and bundle them as one.
60+
/// </remarks>
5761
public class CompositeCleanupStrategy : ICleanupStrategy {
5862
private IDictionary<int, ICollection<IPdfTextLocation>> locations = new Dictionary<int, ICollection<IPdfTextLocation
5963
>>();
6064

6165
private IList<ICleanupStrategy> strategies = new List<ICleanupStrategy>();
6266

67+
/// <summary>
68+
/// Creates a
69+
/// <see cref="CompositeCleanupStrategy">composite pattern</see>
70+
/// for
71+
/// <see cref="ICleanupStrategy">cleanup strategies</see>.
72+
/// </summary>
6373
public CompositeCleanupStrategy() {
6474
}
6575

66-
public virtual void Add(ICleanupStrategy ies) {
67-
strategies.Add(ies);
76+
/// <summary>
77+
/// Adds a
78+
/// <see cref="ICleanupStrategy">cleanup strategy</see>
79+
/// to this
80+
/// <see cref="CompositeCleanupStrategy">composite pattern</see>.
81+
/// </summary>
82+
/// <param name="strategy">
83+
/// a
84+
/// <see cref="ICleanupStrategy">cleanup strategy</see>
85+
/// to be added to this
86+
/// <see cref="CompositeCleanupStrategy">composite pattern</see>.
87+
/// </param>
88+
public virtual void Add(ICleanupStrategy strategy) {
89+
strategies.Add(strategy);
6890
}
6991

92+
/// <summary><inheritDoc/></summary>
7093
public virtual ICollection<IPdfTextLocation> GetResultantLocations() {
7194
locations.Clear();
7295
// build return value
@@ -78,13 +101,12 @@ public virtual ICollection<IPdfTextLocation> GetResultantLocations() {
78101
locations.Put(i, new HashSet<IPdfTextLocation>(rects));
79102
}
80103
IList<IPdfTextLocation> rectangles = new List<IPdfTextLocation>(retval);
81-
JavaCollectionsUtil.Sort(rectangles, new _IComparer_94());
82-
// return
104+
JavaCollectionsUtil.Sort(rectangles, new _IComparer_106());
83105
return rectangles;
84106
}
85107

86-
private sealed class _IComparer_94 : IComparer<IPdfTextLocation> {
87-
public _IComparer_94() {
108+
private sealed class _IComparer_106 : IComparer<IPdfTextLocation> {
109+
public _IComparer_106() {
88110
}
89111

90112
public int Compare(IPdfTextLocation l1, IPdfTextLocation l2) {
@@ -99,6 +121,7 @@ public int Compare(IPdfTextLocation l1, IPdfTextLocation l2) {
99121
}
100122
}
101123

124+
/// <summary><inheritDoc/></summary>
102125
public virtual Color GetRedactionColor(IPdfTextLocation location) {
103126
for (int i = 0; i < strategies.Count; i++) {
104127
if (locations.Get(i).Contains(location)) {
@@ -108,12 +131,14 @@ public virtual Color GetRedactionColor(IPdfTextLocation location) {
108131
return ColorConstants.BLACK;
109132
}
110133

134+
/// <summary><inheritDoc/></summary>
111135
public virtual void EventOccurred(IEventData data, EventType type) {
112136
foreach (ILocationExtractionStrategy s in strategies) {
113137
s.EventOccurred(data, type);
114138
}
115139
}
116140

141+
/// <summary><inheritDoc/></summary>
117142
public virtual ICollection<EventType> GetSupportedEvents() {
118143
ICollection<EventType> evts = new HashSet<EventType>();
119144
foreach (ILocationExtractionStrategy s in strategies) {
@@ -125,13 +150,35 @@ public virtual ICollection<EventType> GetSupportedEvents() {
125150
return evts.IsEmpty() ? null : evts;
126151
}
127152

153+
/// <summary>
154+
/// Returns a
155+
/// <see cref="ICleanupStrategy">cleanup strategy</see>
156+
/// which represents
157+
/// a reset
158+
/// <see cref="CompositeCleanupStrategy">composite cleanup strategy</see>.
159+
/// </summary>
160+
/// <remarks>
161+
/// Returns a
162+
/// <see cref="ICleanupStrategy">cleanup strategy</see>
163+
/// which represents
164+
/// a reset
165+
/// <see cref="CompositeCleanupStrategy">composite cleanup strategy</see>.
166+
/// <para />
167+
/// Note that all the inner
168+
/// <see cref="ICleanupStrategy">strategies</see>
169+
/// will be reset as well.
170+
/// </remarks>
171+
/// <returns>
172+
/// a reset
173+
/// <see cref="CompositeCleanupStrategy">composite strategy</see>
174+
/// </returns>
128175
public virtual ICleanupStrategy Reset() {
129-
iText.PdfCleanup.Autosweep.CompositeCleanupStrategy retval = new iText.PdfCleanup.Autosweep.CompositeCleanupStrategy
176+
iText.PdfCleanup.Autosweep.CompositeCleanupStrategy resetCompositeStrategy = new iText.PdfCleanup.Autosweep.CompositeCleanupStrategy
130177
();
131178
foreach (ICleanupStrategy s in strategies) {
132-
retval.Add(s.Reset());
179+
resetCompositeStrategy.Add(s.Reset());
133180
}
134-
return retval;
181+
return resetCompositeStrategy;
135182
}
136183
}
137184
}

itext/itext.cleanup/itext/pdfcleanup/autosweep/RegexBasedCleanupStrategy.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,49 @@ public class RegexBasedCleanupStrategy : RegexBasedLocationExtractionStrategy, I
5252

5353
private Color redactionColor = ColorConstants.BLACK;
5454

55+
/// <summary>Creates an object of regular expression based cleanup strategy.</summary>
56+
/// <param name="regex">regular expression on which cleanup strategy will be based</param>
5557
public RegexBasedCleanupStrategy(String regex)
5658
: base(regex) {
5759
this.pattern = iText.Commons.Utils.StringUtil.RegexCompile(regex);
5860
}
5961

62+
/// <summary>Creates an object of regular expression based cleanup strategy.</summary>
63+
/// <param name="pattern">
64+
///
65+
/// <see cref="System.Text.RegularExpressions.Regex"/>
66+
/// pattern on which cleanup strategy will be based
67+
/// </param>
6068
public RegexBasedCleanupStrategy(Regex pattern)
6169
: base(pattern) {
6270
this.pattern = pattern;
6371
}
6472

73+
/// <summary><inheritDoc/></summary>
6574
public virtual Color GetRedactionColor(IPdfTextLocation location) {
6675
return redactionColor;
6776
}
6877

78+
/// <summary>Sets the color in which redaction is to take place.</summary>
79+
/// <param name="color">the color in which redaction is to take place</param>
80+
/// <returns>
81+
/// this
82+
/// <see cref="RegexBasedCleanupStrategy">strategy</see>
83+
/// </returns>
6984
public virtual iText.PdfCleanup.Autosweep.RegexBasedCleanupStrategy SetRedactionColor(Color color) {
7085
this.redactionColor = color;
7186
return this;
7287
}
7388

89+
/// <summary>
90+
/// Returns an
91+
/// <see cref="ICleanupStrategy"/>
92+
/// object which is set to this regular pattern and redaction color.
93+
/// </summary>
94+
/// <returns>
95+
/// a reset
96+
/// <see cref="ICleanupStrategy">cleanup strategy</see>
97+
/// </returns>
7498
public virtual ICleanupStrategy Reset() {
7599
return new iText.PdfCleanup.Autosweep.RegexBasedCleanupStrategy(pattern).SetRedactionColor(redactionColor);
76100
}

itext/itext.cleanup/itext/pdfcleanup/logs/CleanUpLogMessageConstant.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ You should have received a copy of the GNU Affero General Public License
2323
using System;
2424

2525
namespace iText.PdfCleanup.Logs {
26+
/// <summary>Class that bundles all the log message templates as constants.</summary>
2627
public class CleanUpLogMessageConstant {
2728
/// <summary>The Constant CANNOT_OBTAIN_IMAGE_INFO_AFTER_FILTERING.</summary>
2829
public const String CANNOT_OBTAIN_IMAGE_INFO_AFTER_FILTERING = "Cannot obtain image info after filtering.";

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fc4787cb9ce8c1d8720cb01dfb36c2423afa7de9
1+
c46afb540b875a2340e3c1ce352efb7ec075c65f

0 commit comments

Comments
 (0)