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.*;
19 import ch.qos.logback.core.model.conditional.ElseModel;
20 import ch.qos.logback.core.model.conditional.IfModel;
21 import ch.qos.logback.core.model.conditional.ThenModel;
22 import ch.qos.logback.core.model.processor.*;
23 import ch.qos.logback.core.model.processor.conditional.ElseModelHandler;
24 import ch.qos.logback.core.model.processor.conditional.IfModelHandler;
25 import ch.qos.logback.core.model.processor.conditional.ThenModelHandler;
26 import ch.qos.logback.core.sift.SiftModelHandler;
27
28
29
30
31
32
33
34
35
36 public class ModelClassToModelHandlerLinkerBase {
37
38
39 protected Context context;
40
41 public ModelClassToModelHandlerLinkerBase(Context context) {
42 this.context = context;
43 }
44
45 public void link(DefaultProcessor defaultProcessor) {
46 defaultProcessor.addHandler(ImportModel.class, ImportModelHandler::makeInstance);
47
48 defaultProcessor.addHandler(ShutdownHookModel.class, ShutdownHookModelHandler::makeInstance);
49 defaultProcessor.addHandler(SequenceNumberGeneratorModel.class, SequenceNumberGeneratorModelHandler::makeInstance);
50 defaultProcessor.addHandler(SerializeModelModel.class, SerializeModelModelHandler::makeInstance);
51
52 defaultProcessor.addHandler(EventEvaluatorModel.class, EventEvaluatorModelHandler::makeInstance);
53 defaultProcessor.addHandler(ConversionRuleModel.class, ConversionRuleModelHandler::makeInstance);
54
55 defaultProcessor.addHandler(DefineModel.class, DefineModelHandler::makeInstance);
56 defaultProcessor.addHandler(IncludeModel.class, IncludeModelHandler::makeInstance);
57
58
59 defaultProcessor.addHandler(ParamModel.class, ParamModelHandler::makeInstance);
60 defaultProcessor.addHandler(PropertyModel.class, PropertyModelHandler::makeInstance);
61 defaultProcessor.addHandler(TimestampModel.class, TimestampModelHandler::makeInstance);
62 defaultProcessor.addHandler(StatusListenerModel.class, StatusListenerModelHandler::makeInstance);
63 defaultProcessor.addHandler(ImplicitModel.class, ImplicitModelHandler::makeInstance);
64
65 defaultProcessor.addHandler(IfModel.class, IfModelHandler::makeInstance);
66 defaultProcessor.addHandler(ThenModel.class, ThenModelHandler::makeInstance);
67 defaultProcessor.addHandler(ElseModel.class, ElseModelHandler::makeInstance);
68
69 defaultProcessor.addHandler(SiftModel.class, SiftModelHandler::makeInstance);
70 }
71
72
73
74
75
76 protected void sealModelFilters(DefaultProcessor defaultProcessor) {
77 defaultProcessor.getPhaseOneFilter().denyAll();
78 defaultProcessor.getPhaseTwoFilter().allowAll();
79 }
80 }