tmf.xml: Add mapping group to XML description
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.analysis.xml.core / src / org / eclipse / tracecompass / internal / tmf / analysis / xml / core / model / readwrite / TmfXmlReadWriteModelFactory.java
CommitLineData
1d7e62f9
GB
1/*******************************************************************************
2 * Copyright (c) 2014 École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
12
6eca054d 13package org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.readwrite;
1d7e62f9
GB
14
15import java.util.List;
16
3a5f73a1 17import org.eclipse.jdt.annotation.NonNull;
12685851 18import org.eclipse.jdt.annotation.Nullable;
6eca054d
GB
19import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.ITmfXmlModelFactory;
20import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.ITmfXmlStateAttribute;
21import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.ITmfXmlStateValue;
22import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlAction;
23import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlCondition;
24import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlEventHandler;
25import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlFsm;
55df9717 26import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlMapEntry;
6eca054d
GB
27import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlLocation;
28import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlPatternEventHandler;
29import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlPatternSegmentBuilder;
30import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlState;
31import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlStateChange;
32import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlStateTransition;
33import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlTimestampCondition;
34import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.model.TmfXmlTransitionValidator;
35import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.module.IXmlStateSystemContainer;
1d7e62f9
GB
36import org.w3c.dom.Element;
37
38/**
39 * Concrete factory for XML model elements in read write mode
40 *
41 * @author Geneviève Bastien
42 */
b1ebf44e 43public class TmfXmlReadWriteModelFactory implements ITmfXmlModelFactory {
1d7e62f9 44
12685851 45 private static @Nullable ITmfXmlModelFactory fInstance = null;
1d7e62f9
GB
46
47 /**
48 * Get the instance of this model creator
49 *
b1ebf44e 50 * @return The {@link TmfXmlReadWriteModelFactory} instance
1d7e62f9 51 */
1d7e62f9
GB
52 public static synchronized ITmfXmlModelFactory getInstance() {
53 ITmfXmlModelFactory instance = fInstance;
54 if (instance == null) {
b1ebf44e 55 instance = new TmfXmlReadWriteModelFactory();
1d7e62f9
GB
56 fInstance = instance;
57 }
58 return instance;
59 }
60
61 @Override
62 public ITmfXmlStateAttribute createStateAttribute(Element attribute, IXmlStateSystemContainer container) {
b1ebf44e 63 return new TmfXmlReadWriteStateAttribute(this, attribute, container);
1d7e62f9
GB
64 }
65
66 @Override
67 public ITmfXmlStateValue createStateValue(Element node, IXmlStateSystemContainer container, List<ITmfXmlStateAttribute> attributes) {
b1ebf44e 68 return new TmfXmlReadWriteStateValue(this, node, container, attributes);
1d7e62f9
GB
69 }
70
71 @Override
72 public ITmfXmlStateValue createStateValue(Element node, IXmlStateSystemContainer container, String eventField) {
b1ebf44e 73 return new TmfXmlReadWriteStateValue(this, node, container, eventField);
1d7e62f9
GB
74 }
75
76 @Override
77 public TmfXmlCondition createCondition(Element node, IXmlStateSystemContainer container) {
3a5f73a1 78 return TmfXmlCondition.create(this, node, container);
1d7e62f9
GB
79 }
80
81 @Override
82 public TmfXmlEventHandler createEventHandler(Element node, IXmlStateSystemContainer container) {
83 return new TmfXmlEventHandler(this, node, container);
84 }
85
86 @Override
87 public TmfXmlStateChange createStateChange(Element node, IXmlStateSystemContainer container) {
88 return new TmfXmlStateChange(this, node, container);
89 }
90
91 @Override
92 public TmfXmlLocation createLocation(Element node, IXmlStateSystemContainer container) {
93 return new TmfXmlLocation(this, node, container);
94 }
95
3a5f73a1
JCK
96 @Override
97 public TmfXmlPatternEventHandler createPatternEventHandler(Element node, IXmlStateSystemContainer container) {
98 return new TmfXmlPatternEventHandler(this, node, container);
99 }
100
3a5f73a1
JCK
101 @Override
102 public TmfXmlTransitionValidator createTransitionValidator(Element node, IXmlStateSystemContainer container) {
103 return new TmfXmlTransitionValidator(this, node, container);
104 }
105
3a5f73a1
JCK
106 @Override
107 public TmfXmlAction createAction(Element node, IXmlStateSystemContainer container) {
108 return new TmfXmlAction(this, node, container);
109 }
110
3a5f73a1
JCK
111 @Override
112 public TmfXmlFsm createFsm(Element node, IXmlStateSystemContainer container) {
113 return TmfXmlFsm.create(this, node, container);
114 }
115
3a5f73a1
JCK
116 @Override
117 public @NonNull TmfXmlState createState(Element node, IXmlStateSystemContainer container, @Nullable TmfXmlState parent) {
118 return TmfXmlState.create(this, node, container, parent);
119 }
120
3a5f73a1
JCK
121 @Override
122 public TmfXmlStateTransition createStateTransition(Element node, IXmlStateSystemContainer container) {
123 return new TmfXmlStateTransition(this, node, container);
124 }
125
3a5f73a1
JCK
126 @Override
127 public TmfXmlTimestampCondition createTimestampsCondition(Element node, IXmlStateSystemContainer container) {
128 return new TmfXmlTimestampCondition(this, node, container);
129 }
130
3a5f73a1
JCK
131 @Override
132 public TmfXmlPatternSegmentBuilder createPatternSegmentBuilder(Element node, IXmlStateSystemContainer container) {
133 return new TmfXmlPatternSegmentBuilder(this, node, container);
134 }
55df9717
JCK
135
136 @Override
137 public @NonNull TmfXmlMapEntry createMapEntry(@NonNull Element node, @NonNull IXmlStateSystemContainer container) {
138 return new TmfXmlMapEntry(this, node, container);
139 }
1d7e62f9 140}
This page took 0.081152 seconds and 5 git commands to generate.