1 /*******************************************************************************
2 * Copyright (c) 2014 École Polytechnique de Montréal
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
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.core
.model
;
15 import java
.util
.List
;
17 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.core
.module
.IXmlStateSystemContainer
;
19 import org
.w3c
.dom
.Element
;
22 * Interface to create XML model elements in different contexts. This allows to
23 * reuse the same XML syntax and parsers, but use the elements differently
24 * depending on the what is intended to be done with them.
26 * @author Geneviève Bastien
28 public interface ITmfXmlModelFactory
{
31 * Create a new XML state attribute
34 * XML element of the attribute
36 * The state system container this state attribute belongs to
37 * @return The new state attribute
39 ITmfXmlStateAttribute
createStateAttribute(Element attribute
, IXmlStateSystemContainer container
);
42 * Create a new state value where the value corresponds to a path of
43 * {@link ITmfXmlStateAttribute}
46 * The state value XML element
48 * The state system container this state value belongs to
50 * The attributes representing the path to this value
51 * @return The new state value
53 ITmfXmlStateValue
createStateValue(Element node
, IXmlStateSystemContainer container
, List
<ITmfXmlStateAttribute
> attributes
);
56 * Create a new state value where the value corresponds to a field in an
60 * The state value XML element
62 * The state system container this state value belongs to
64 * The event field where to get the value
65 * @return The new state value
67 ITmfXmlStateValue
createStateValue(Element node
, IXmlStateSystemContainer container
, String eventField
);
70 * Create a new XML condition
73 * The XML root of this condition
75 * The state system container this condition belongs to
76 * @return The new XML condition
78 TmfXmlCondition
createCondition(Element node
, IXmlStateSystemContainer container
);
81 * Create a new XML event handler
84 * The XML event handler element
86 * The state system container this state value belongs to
87 * @return The new XML event handler
89 TmfXmlEventHandler
createEventHandler(Element node
, IXmlStateSystemContainer container
);
92 * Create a new XML state change
95 * The XML state change element
97 * The state system container this state change belongs to
98 * @return The new XML state change
100 TmfXmlStateChange
createStateChange(Element node
, IXmlStateSystemContainer container
);
103 * Create a new XML location
106 * The XML location element
108 * The state system container this location belongs to
109 * @return The new XML location
111 TmfXmlLocation
createLocation(Element node
, IXmlStateSystemContainer container
);
114 * Create a new XML pattern event handler
117 * The XML pattern event handler element
119 * The state system container this pattern event handler belongs to
120 * @return The new XML pattern event handler
122 TmfXmlPatternEventHandler
createPatternEventHandler(Element node
, IXmlStateSystemContainer container
);
125 * Create a new XML transition validator
128 * The XML test element
130 * The state system container this test belongs to
131 * @return The new {@link TmfXmlTransitionValidator}
133 TmfXmlTransitionValidator
createTransitionValidator(Element node
, IXmlStateSystemContainer container
);
136 * Create a new XML action
139 * The XML action element
141 * The state system container this action belongs to
142 * @return The new {@link TmfXmlAction}
144 TmfXmlAction
createAction(Element node
, IXmlStateSystemContainer container
);
147 * Create a new XML FSM
150 * The XML FSM element
152 * The state system container this FSM belongs to
153 * @return The new {@link TmfXmlFsm}
155 TmfXmlFsm
createFsm(Element node
, IXmlStateSystemContainer container
);
158 * Create a new XML state
161 * The XML state element
163 * The state system container this state belongs to
166 * @return The new {@link TmfXmlState}
168 TmfXmlState
createState(Element node
, IXmlStateSystemContainer container
, @Nullable TmfXmlState parent
);
171 * Create a new XML state transition
174 * The XML state transition element
176 * The state system container this state transition belongs to
177 * @return The new XML {@link TmfXmlStateTransition}
179 TmfXmlStateTransition
createStateTransition(Element node
, IXmlStateSystemContainer container
);
182 * Create a new XML timestamp condition
185 * The XML timestamp condition element
187 * The state system container this timestamp condition belongs to
188 * @return The new {@link TmfXmlTimestampCondition}
190 TmfXmlTimestampCondition
createTimestampsCondition(Element node
, IXmlStateSystemContainer container
);
193 * Create a new pattern segment builder
196 * The XML pattern segment builder
198 * The state system container this pattern segment builder belongs to
199 * @return The new {@link TmfXmlPatternSegmentBuilder}
201 TmfXmlPatternSegmentBuilder
createPatternSegmentBuilder(Element node
, IXmlStateSystemContainer container
);
204 * Create a new pattern map entry
207 * The XML map entry element
209 * The state system container this state value handler belongs to
210 * @return The new {@link TmfXmlMapEntry}
212 TmfXmlMapEntry
createMapEntry(Element node
, IXmlStateSystemContainer container
);