33 * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
44 * Copyright (c) 2012 Edgar Espina
55 */
6- package com .github .jknack .handlebars ;
6+ package com .github .jknack .handlebars . jackson ;
77
88import static java .util .Objects .requireNonNull ;
99
1818import com .fasterxml .jackson .core .io .SegmentedStringWriter ;
1919import com .fasterxml .jackson .databind .ObjectMapper ;
2020import com .fasterxml .jackson .databind .ObjectWriter ;
21+ import com .github .jknack .handlebars .Handlebars ;
22+ import com .github .jknack .handlebars .Helper ;
23+ import com .github .jknack .handlebars .Options ;
2124
2225/**
2326 * A Jackson 2.x helper.
6972 * @author edgar.espina
7073 * @since 0.4.0
7174 */
72- public class Jackson2Helper implements Helper <Object > {
75+ public class JacksonHelper implements Helper <Object > {
7376
7477 /**
7578 * Escape HTML chars from JSON content. See
@@ -106,8 +109,8 @@ public SerializableString getEscapeSequence(final int ch) {
106109 }
107110 }
108111
109- /** A singleton version of {@link Jackson2Helper }. */
110- public static final Helper <Object > INSTANCE = new Jackson2Helper ();
112+ /** A singleton version of {@link JacksonHelper }. */
113+ public static final Helper <Object > INSTANCE = new JacksonHelper ();
111114
112115 /** The JSON parser. */
113116 private final ObjectMapper mapper ;
@@ -116,16 +119,16 @@ public SerializableString getEscapeSequence(final int ch) {
116119 private final Map <String , Class <?>> alias = new HashMap <String , Class <?>>();
117120
118121 /**
119- * Creates a new {@link Jackson2Helper }.
122+ * Creates a new {@link JacksonHelper }.
120123 *
121124 * @param objectMapper The object's mapper. Required.
122125 */
123- public Jackson2Helper (final ObjectMapper objectMapper ) {
126+ public JacksonHelper (final ObjectMapper objectMapper ) {
124127 mapper = requireNonNull (objectMapper , "The object mapper is required." );
125128 }
126129
127- /** Creates a new {@link Jackson2Helper }. */
128- private Jackson2Helper () {
130+ /** Creates a new {@link JacksonHelper }. */
131+ private JacksonHelper () {
129132 this (new ObjectMapper ());
130133 }
131134
@@ -189,7 +192,7 @@ public Object apply(final Object context, final Options options) throws IOExcept
189192 * @param viewClass The view class. Required.
190193 * @return This helper.
191194 */
192- public Jackson2Helper viewAlias (final String alias , final Class <?> viewClass ) {
195+ public JacksonHelper viewAlias (final String alias , final Class <?> viewClass ) {
193196 this .alias .put (
194197 requireNonNull (alias , "A view alias is required." ),
195198 requireNonNull (viewClass , "A view class is required." ));
0 commit comments