17
17
*/
18
18
package com .github .jknack .handlebars .internal ;
19
19
20
- import static org .apache .commons .lang3 .StringUtils .isEmpty ;
21
- import static org .apache .commons .lang3 .Validate .notNull ;
22
-
23
- import java .util .ArrayList ;
24
- import java .util .Collections ;
25
- import java .util .LinkedHashMap ;
26
- import java .util .LinkedList ;
27
- import java .util .List ;
28
- import java .util .Map ;
29
-
30
- import org .antlr .v4 .runtime .CommonToken ;
31
- import org .antlr .v4 .runtime .Token ;
32
- import org .antlr .v4 .runtime .tree .ParseTree ;
33
- import org .antlr .v4 .runtime .tree .TerminalNode ;
34
- import org .apache .commons .lang3 .StringUtils ;
35
- import org .apache .commons .lang3 .math .NumberUtils ;
36
-
37
20
import com .github .jknack .handlebars .Context ;
38
21
import com .github .jknack .handlebars .Decorator ;
39
22
import com .github .jknack .handlebars .Handlebars ;
74
57
import com .github .jknack .handlebars .internal .HbsParser .UnlessContext ;
75
58
import com .github .jknack .handlebars .internal .HbsParser .VarContext ;
76
59
import com .github .jknack .handlebars .io .TemplateSource ;
60
+ import org .antlr .v4 .runtime .CommonToken ;
61
+ import org .antlr .v4 .runtime .Token ;
62
+ import org .antlr .v4 .runtime .tree .ParseTree ;
63
+ import org .antlr .v4 .runtime .tree .TerminalNode ;
64
+ import org .apache .commons .lang3 .StringUtils ;
65
+ import org .apache .commons .lang3 .math .NumberUtils ;
66
+
67
+ import java .util .ArrayList ;
68
+ import java .util .Collections ;
69
+ import java .util .LinkedHashMap ;
70
+ import java .util .LinkedList ;
71
+ import java .util .List ;
72
+ import java .util .Map ;
73
+
74
+ import static org .apache .commons .lang3 .StringUtils .isEmpty ;
75
+ import static org .apache .commons .lang3 .Validate .notNull ;
77
76
78
77
/**
79
78
* Traverse the parse tree and build templates.
@@ -144,7 +143,7 @@ private static class PartialInfo {
144
143
* @param handlebars A handlebars object. required.
145
144
* @param source The template source. required.
146
145
*/
147
- public TemplateBuilder (final Handlebars handlebars , final TemplateSource source ) {
146
+ TemplateBuilder (final Handlebars handlebars , final TemplateSource source ) {
148
147
this .handlebars = notNull (handlebars , "The handlebars can't be null." );
149
148
this .source = notNull (source , "The template source is required." );
150
149
}
@@ -551,6 +550,7 @@ protected void beforeApply(final Context context) {
551
550
LinkedList <TemplateSource > invocationStack = context .data (Context .INVOCATION_STACK );
552
551
invocationStack .addLast (source );
553
552
}
553
+
554
554
@ Override
555
555
protected void afterApply (final Context context ) {
556
556
LinkedList <TemplateSource > invocationStack = context .data (Context .INVOCATION_STACK );
@@ -772,17 +772,6 @@ private void destroy() {
772
772
this .currentText = null ;
773
773
}
774
774
775
- /**
776
- * Report a semantic error.
777
- *
778
- * @param offendingToken The offending token.
779
- * @param message An error message.
780
- */
781
- protected void reportError (final CommonToken offendingToken , final String message ) {
782
- reportError (offendingToken , offendingToken .getLine (), offendingToken .getCharPositionInLine (),
783
- message );
784
- }
785
-
786
775
/**
787
776
* Report a semantic error.
788
777
*
@@ -791,6 +780,6 @@ protected void reportError(final CommonToken offendingToken, final String messag
791
780
* @param column The offending column.
792
781
* @param message An error message.
793
782
*/
794
- protected abstract void reportError (final CommonToken offendingToken , final int line ,
795
- final int column , final String message );
783
+ protected abstract void reportError (CommonToken offendingToken , int line ,
784
+ int column , String message );
796
785
}
0 commit comments