|
1 | 1 | package in.wilsonl.minifyhtml; |
2 | 2 |
|
3 | | -// WARNING: Do not manually edit, use Configuration.java.gen.js. |
| 3 | +import lombok.AccessLevel; |
| 4 | +import lombok.AllArgsConstructor; |
| 5 | +import lombok.Builder; |
4 | 6 |
|
5 | 7 | /** |
6 | 8 | * Class representing minification configuration. |
| 9 | + * Use the {@link Builder} to create an instance of this class. |
7 | 10 | */ |
| 11 | +@Builder( |
| 12 | + setterPrefix = "set", |
| 13 | + builderClassName = "Builder" |
| 14 | +) |
| 15 | +@AllArgsConstructor(access = AccessLevel.PRIVATE) |
8 | 16 | public class Configuration { |
9 | | - public final boolean allow_noncompliant_unquoted_attribute_values; |
10 | | - public final boolean allow_optimal_entities; |
11 | | - public final boolean allow_removing_spaces_between_attributes; |
12 | | - public final boolean keep_closing_tags; |
13 | | - public final boolean keep_comments; |
14 | | - public final boolean keep_html_and_head_opening_tags; |
15 | | - public final boolean keep_input_type_text_attr; |
16 | | - public final boolean keep_ssi_comments; |
17 | | - public final boolean minify_css; |
18 | | - public final boolean minify_doctype; |
19 | | - public final boolean minify_js; |
20 | | - public final boolean preserve_brace_template_syntax; |
21 | | - public final boolean preserve_chevron_percent_template_syntax; |
22 | | - public final boolean remove_bangs; |
23 | | - public final boolean remove_processing_instructions; |
24 | | - |
25 | | - private Configuration( |
26 | | - boolean allow_noncompliant_unquoted_attribute_values, |
27 | | - boolean allow_optimal_entities, |
28 | | - boolean allow_removing_spaces_between_attributes, |
29 | | - boolean keep_closing_tags, |
30 | | - boolean keep_comments, |
31 | | - boolean keep_html_and_head_opening_tags, |
32 | | - boolean keep_input_type_text_attr, |
33 | | - boolean keep_ssi_comments, |
34 | | - boolean minify_css, |
35 | | - boolean minify_doctype, |
36 | | - boolean minify_js, |
37 | | - boolean preserve_brace_template_syntax, |
38 | | - boolean preserve_chevron_percent_template_syntax, |
39 | | - boolean remove_bangs, |
40 | | - boolean remove_processing_instructions |
41 | | - ) { |
42 | | - this.allow_noncompliant_unquoted_attribute_values = allow_noncompliant_unquoted_attribute_values; |
43 | | - this.allow_optimal_entities = allow_optimal_entities; |
44 | | - this.allow_removing_spaces_between_attributes = allow_removing_spaces_between_attributes; |
45 | | - this.keep_closing_tags = keep_closing_tags; |
46 | | - this.keep_comments = keep_comments; |
47 | | - this.keep_html_and_head_opening_tags = keep_html_and_head_opening_tags; |
48 | | - this.keep_input_type_text_attr = keep_input_type_text_attr; |
49 | | - this.keep_ssi_comments = keep_ssi_comments; |
50 | | - this.minify_css = minify_css; |
51 | | - this.minify_doctype = minify_doctype; |
52 | | - this.minify_js = minify_js; |
53 | | - this.preserve_brace_template_syntax = preserve_brace_template_syntax; |
54 | | - this.preserve_chevron_percent_template_syntax = preserve_chevron_percent_template_syntax; |
55 | | - this.remove_bangs = remove_bangs; |
56 | | - this.remove_processing_instructions = remove_processing_instructions; |
57 | | - } |
58 | | - |
59 | | - /** |
60 | | - * Builder to help create configuration. |
61 | | - */ |
62 | | - public static class Builder { |
63 | | - private boolean allow_noncompliant_unquoted_attribute_values = false; |
64 | | - private boolean allow_optimal_entities = false; |
65 | | - private boolean allow_removing_spaces_between_attributes = false; |
66 | | - private boolean keep_closing_tags = false; |
67 | | - private boolean keep_comments = false; |
68 | | - private boolean keep_html_and_head_opening_tags = false; |
69 | | - private boolean keep_input_type_text_attr = false; |
70 | | - private boolean keep_ssi_comments = false; |
71 | | - private boolean minify_css = false; |
72 | | - private boolean minify_doctype = false; |
73 | | - private boolean minify_js = false; |
74 | | - private boolean preserve_brace_template_syntax = false; |
75 | | - private boolean preserve_chevron_percent_template_syntax = false; |
76 | | - private boolean remove_bangs = false; |
77 | | - private boolean remove_processing_instructions = false; |
78 | | - |
79 | | - public Builder setAllowNoncompliantUnquotedAttributeValues(boolean v) { |
80 | | - this.allow_noncompliant_unquoted_attribute_values = v; |
81 | | - return this; |
82 | | - } |
83 | | - public Builder setAllowOptimalEntities(boolean v) { |
84 | | - this.allow_optimal_entities = v; |
85 | | - return this; |
86 | | - } |
87 | | - public Builder setAllowRemovingSpacesBetweenAttributes(boolean v) { |
88 | | - this.allow_removing_spaces_between_attributes = v; |
89 | | - return this; |
90 | | - } |
91 | | - public Builder setKeepClosingTags(boolean v) { |
92 | | - this.keep_closing_tags = v; |
93 | | - return this; |
94 | | - } |
95 | | - public Builder setKeepComments(boolean v) { |
96 | | - this.keep_comments = v; |
97 | | - return this; |
98 | | - } |
99 | | - public Builder setKeepHtmlAndHeadOpeningTags(boolean v) { |
100 | | - this.keep_html_and_head_opening_tags = v; |
101 | | - return this; |
102 | | - } |
103 | | - public Builder setKeepInputTypeTextAttr(boolean v) { |
104 | | - this.keep_input_type_text_attr = v; |
105 | | - return this; |
106 | | - } |
107 | | - public Builder setKeepSsiComments(boolean v) { |
108 | | - this.keep_ssi_comments = v; |
109 | | - return this; |
110 | | - } |
111 | | - public Builder setMinifyCss(boolean v) { |
112 | | - this.minify_css = v; |
113 | | - return this; |
114 | | - } |
115 | | - public Builder setMinifyDoctype(boolean v) { |
116 | | - this.minify_doctype = v; |
117 | | - return this; |
118 | | - } |
119 | | - public Builder setMinifyJs(boolean v) { |
120 | | - this.minify_js = v; |
121 | | - return this; |
122 | | - } |
123 | | - public Builder setPreserveBraceTemplateSyntax(boolean v) { |
124 | | - this.preserve_brace_template_syntax = v; |
125 | | - return this; |
126 | | - } |
127 | | - public Builder setPreserveChevronPercentTemplateSyntax(boolean v) { |
128 | | - this.preserve_chevron_percent_template_syntax = v; |
129 | | - return this; |
130 | | - } |
131 | | - public Builder setRemoveBangs(boolean v) { |
132 | | - this.remove_bangs = v; |
133 | | - return this; |
134 | | - } |
135 | | - public Builder setRemoveProcessingInstructions(boolean v) { |
136 | | - this.remove_processing_instructions = v; |
137 | | - return this; |
138 | | - } |
139 | | - |
140 | | - public Configuration build() { |
141 | | - return new Configuration( |
142 | | - this.allow_noncompliant_unquoted_attribute_values, |
143 | | - this.allow_optimal_entities, |
144 | | - this.allow_removing_spaces_between_attributes, |
145 | | - this.keep_closing_tags, |
146 | | - this.keep_comments, |
147 | | - this.keep_html_and_head_opening_tags, |
148 | | - this.keep_input_type_text_attr, |
149 | | - this.keep_ssi_comments, |
150 | | - this.minify_css, |
151 | | - this.minify_doctype, |
152 | | - this.minify_js, |
153 | | - this.preserve_brace_template_syntax, |
154 | | - this.preserve_chevron_percent_template_syntax, |
155 | | - this.remove_bangs, |
156 | | - this.remove_processing_instructions |
157 | | - ); |
158 | | - } |
159 | | - } |
| 17 | + public final boolean allowNoncompliantUnquotedAttributeValues; |
| 18 | + public final boolean allowOptimalEntities; |
| 19 | + public final boolean allowRemovingSpacesBetweenAttributes; |
| 20 | + public final boolean keepClosingTags; |
| 21 | + public final boolean keepComments; |
| 22 | + public final boolean keepHtmlAndHeadOpeningTags; |
| 23 | + public final boolean keepInputTypeTextAttr; |
| 24 | + public final boolean keepSsiComments; |
| 25 | + public final boolean minifyCss; |
| 26 | + public final boolean minifyDoctype; |
| 27 | + public final boolean minifyJs; |
| 28 | + public final boolean preserveBraceTemplateSyntax; |
| 29 | + public final boolean preserveChevronPercentTemplateSyntax; |
| 30 | + public final boolean removeBangs; |
| 31 | + public final boolean removeProcessingInstructions; |
160 | 32 | } |
0 commit comments