Skip to content

Commit beb547b

Browse files
committed
Add JavaDocs
1 parent 71be468 commit beb547b

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

api/src/main/java/net/quickwrite/fluent4j/parser/pattern/FluentContentParser.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,21 @@ interface EndChecker {
3030
boolean check(final ContentIterator iterator);
3131
}
3232

33+
/**
34+
* The interface to declare that the object
35+
* can be sanitized and implements custom logic for
36+
* that exact step.
37+
*/
3338
interface Sanitizable {
39+
/**
40+
* Adds the element to the current result.
41+
*
42+
* @param index The position the element is az in the unsanitized list
43+
* @param start The position that the sanitization started at.
44+
* @param unsanitizedPatternList The list that is being generated from the previous steps
45+
* @param builder The builder that is being used for the sanitization step
46+
* @param whitespace The amount of whitespace that was being calculated
47+
*/
3448
void sanitize(
3549
final int index,
3650
final int start,
@@ -40,15 +54,58 @@ void sanitize(
4054
);
4155
}
4256

57+
/**
58+
* The builder for the sanitized list
59+
* of elements for the content.
60+
*
61+
* <p>
62+
* This step is being done as it
63+
* allows for better performance and
64+
* better handling of the data at runtime.
65+
* </p>
66+
*/
4367
interface ListBuilder {
68+
/**
69+
* Returns the list that is currently being operated upon.
70+
*
71+
* @return The current list of items
72+
*/
4473
List<FluentPattern> currentList();
4574

75+
/**
76+
* Appends a string towards the current string builder.
77+
*
78+
* @param charSequence The characters that should be added
79+
* @return The ListBuilder itself
80+
*/
4681
ListBuilder appendString(final CharSequence charSequence);
4782

83+
/**
84+
* Appends a character towards the current string builder.
85+
*
86+
* @param character The character that should be added
87+
* @return The ListBuilder itself
88+
*/
4889
ListBuilder appendString(final char character);
4990

91+
/**
92+
* Adds an element to the current list and flushes
93+
* the string to ensure the correct order of elements.
94+
*
95+
* @param pattern The pattern that should be added.
96+
* @return The ListBuilder itself
97+
*/
5098
ListBuilder appendElement(final FluentPattern pattern);
5199

100+
/**
101+
* Adds the current string that is being built
102+
* to the list of elements.
103+
*
104+
* <p>
105+
* If the current string is empty it won't
106+
* get added as a new item.
107+
* </p>
108+
*/
52109
void flushString();
53110
}
54111

0 commit comments

Comments
 (0)