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
.tmf
.analysis
.xml
.core
.model
;
15 import java
.util
.List
;
17 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 import org
.eclipse
.tracecompass
.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
123 TmfXmlPatternEventHandler
createPatternEventHandler(Element node
, IXmlStateSystemContainer container
);
126 * Create a new XML transition validator
129 * The XML test element
131 * The state system container this test belongs to
132 * @return The new {@link TmfXmlTransitionValidator}
135 TmfXmlTransitionValidator
createTransitionValidator(Element node
, IXmlStateSystemContainer container
);
138 * Create a new XML action
141 * The XML action element
143 * The state system container this action belongs to
144 * @return The new {@link TmfXmlAction}
147 TmfXmlAction
createAction(Element node
, IXmlStateSystemContainer container
);
150 * Create a new XML FSM
153 * The XML FSM element
155 * The state system container this FSM belongs to
156 * @return The new {@link TmfXmlFsm}
159 TmfXmlFsm
createFsm(Element node
, IXmlStateSystemContainer container
);
162 * Create a new XML state
165 * The XML state element
167 * The state system container this state belongs to
170 * @return The new {@link TmfXmlState}
173 TmfXmlState
createState(Element node
, IXmlStateSystemContainer container
, @Nullable TmfXmlState parent
);
176 * Create a new XML state transition
179 * The XML state transition element
181 * The state system container this state transition belongs to
182 * @return The new XML {@link TmfXmlStateTransition}
185 TmfXmlStateTransition
createStateTransition(Element node
, IXmlStateSystemContainer container
);
188 * Create a new XML timestamp condition
191 * The XML timestamp condition element
193 * The state system container this timestamp condition belongs to
194 * @return The new {@link TmfXmlTimestampCondition}
197 TmfXmlTimestampCondition
createTimestampsCondition(Element node
, IXmlStateSystemContainer container
);
200 * Create a new pattern segment builder
203 * The XML pattern segment builder
205 * The state system container this pattern segment builder belongs to
206 * @return The new {@link TmfXmlPatternSegmentBuilder}
209 TmfXmlPatternSegmentBuilder
createPatternSegmentBuilder(Element node
, IXmlStateSystemContainer container
);