1 package org.apache.fulcrum.json.jackson.filters;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import org.apache.fulcrum.json.jackson.CustomModule;
23
24 import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
25 import com.fasterxml.jackson.databind.ser.std.StdSerializer;
26
27 /**
28 * Provides a wrapper module as a helper class for the inner class {@link CustomModule}.
29 *
30 * @author gkallidis
31 *
32 * @param <T> the class to wrap
33 */
34 public class CustomModuleWrapper<T> {
35
36 // serializer and deserializer objects
37 StdSerializer<T> ser = null;
38 StdDeserializer<T> deSer = null;
39
40 /**
41 * Constructor for the custom module wrapper
42 *
43 * @param ser the standard serializer
44 * @param deSer the standard de-serializer
45 */
46 public CustomModuleWrapper(StdSerializer<T> ser, StdDeserializer<T> deSer) {
47 this.ser = ser;
48 this.deSer = deSer;
49 }
50
51 /**
52 * @return the serializer
53 */
54 public StdSerializer<T> getSer() {
55 return ser;
56 }
57
58 /**
59 * @param ser set the standard serializer
60 */
61 public void setSer(StdSerializer<T> ser) {
62 this.ser = ser;
63 }
64
65 /**
66 * @return the de-serializer in use
67 */
68 public StdDeserializer<T> getDeSer() {
69 return deSer;
70 }
71
72 /**
73 * @param deSer standard deserializer
74 */
75 public void setDeSer(StdDeserializer<T> deSer) {
76 this.deSer = deSer;
77 }
78
79 }