1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package ch.qos.logback.core.joran;
16
17 import ch.qos.logback.core.Context;
18 import ch.qos.logback.core.model.DefineModel;
19 import ch.qos.logback.core.model.EventEvaluatorModel;
20 import ch.qos.logback.core.model.ImplicitModel;
21 import ch.qos.logback.core.model.ImportModel;
22 import ch.qos.logback.core.model.IncludeModel;
23 import ch.qos.logback.core.model.ParamModel;
24 import ch.qos.logback.core.model.PropertyModel;
25 import ch.qos.logback.core.model.SequenceNumberGeneratorModel;
26 import ch.qos.logback.core.model.SerializeModelModel;
27 import ch.qos.logback.core.model.ShutdownHookModel;
28 import ch.qos.logback.core.model.SiftModel;
29 import ch.qos.logback.core.model.StatusListenerModel;
30 import ch.qos.logback.core.model.TimestampModel;
31 import ch.qos.logback.core.model.conditional.ElseModel;
32 import ch.qos.logback.core.model.conditional.IfModel;
33 import ch.qos.logback.core.model.conditional.ThenModel;
34 import ch.qos.logback.core.model.processor.DefaultProcessor;
35 import ch.qos.logback.core.model.processor.DefineModelHandler;
36 import ch.qos.logback.core.model.processor.EventEvaluatorModelHandler;
37 import ch.qos.logback.core.model.processor.ImplicitModelHandler;
38 import ch.qos.logback.core.model.processor.ImportModelHandler;
39 import ch.qos.logback.core.model.processor.IncludeModelHandler;
40 import ch.qos.logback.core.model.processor.NOPModelHandler;
41 import ch.qos.logback.core.model.processor.PropertyModelHandler;
42 import ch.qos.logback.core.model.processor.SequenceNumberGeneratorModelHandler;
43 import ch.qos.logback.core.model.processor.SerializeModelModelHandler;
44 import ch.qos.logback.core.model.processor.ShutdownHookModelHandler;
45 import ch.qos.logback.core.model.processor.StatusListenerModelHandler;
46 import ch.qos.logback.core.model.processor.TimestampModelHandler;
47 import ch.qos.logback.core.model.processor.conditional.ElseModelHandler;
48 import ch.qos.logback.core.model.processor.conditional.IfModelHandler;
49 import ch.qos.logback.core.model.processor.conditional.ThenModelHandler;
50 import ch.qos.logback.core.sift.SiftModelHandler;
51
52
53
54
55
56
57
58
59
60 public class ModelClassToModelHandlerLinkerBase {
61
62
63 protected Context context;
64
65 public ModelClassToModelHandlerLinkerBase(Context context) {
66 this.context = context;
67 }
68
69 public void link(DefaultProcessor defaultProcessor) {
70 defaultProcessor.addHandler(ImportModel.class, ImportModelHandler::makeInstance);
71
72 defaultProcessor.addHandler(ShutdownHookModel.class, ShutdownHookModelHandler::makeInstance);
73 defaultProcessor.addHandler(SequenceNumberGeneratorModel.class, SequenceNumberGeneratorModelHandler::makeInstance);
74 defaultProcessor.addHandler(SerializeModelModel.class, SerializeModelModelHandler::makeInstance);
75
76 defaultProcessor.addHandler(EventEvaluatorModel.class, EventEvaluatorModelHandler::makeInstance);
77 defaultProcessor.addHandler(DefineModel.class, DefineModelHandler::makeInstance);
78 defaultProcessor.addHandler(IncludeModel.class, IncludeModelHandler::makeInstance);
79
80
81 defaultProcessor.addHandler(ParamModel.class, ParamModelHandler::makeInstance);
82 defaultProcessor.addHandler(PropertyModel.class, PropertyModelHandler::makeInstance);
83 defaultProcessor.addHandler(TimestampModel.class, TimestampModelHandler::makeInstance);
84 defaultProcessor.addHandler(StatusListenerModel.class, StatusListenerModelHandler::makeInstance);
85 defaultProcessor.addHandler(ImplicitModel.class, ImplicitModelHandler::makeInstance);
86
87 defaultProcessor.addHandler(IfModel.class, IfModelHandler::makeInstance);
88 defaultProcessor.addHandler(ThenModel.class, ThenModelHandler::makeInstance);
89 defaultProcessor.addHandler(ElseModel.class, ElseModelHandler::makeInstance);
90
91 defaultProcessor.addHandler(SiftModel.class, SiftModelHandler::makeInstance);
92 }
93
94
95
96
97
98 protected void sealModelFilters(DefaultProcessor defaultProcessor) {
99 defaultProcessor.getPhaseOneFilter().denyAll();
100 defaultProcessor.getPhaseTwoFilter().allowAll();
101 }
102 }