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
.readonly
;
15 import java
.util
.List
;
17 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
.ITmfXmlModelFactory
;
19 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
.ITmfXmlStateAttribute
;
20 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
.ITmfXmlStateValue
;
21 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
.TmfXmlCondition
;
22 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
.TmfXmlEventHandler
;
23 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
.TmfXmlLocation
;
24 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
.TmfXmlStateChange
;
25 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.module
.IXmlStateSystemContainer
;
26 import org
.w3c
.dom
.Element
;
29 * Concrete factory for XML model elements in read only mode
31 * @author Geneviève Bastien
33 public class TmfXmlReadOnlyModelFactory
implements ITmfXmlModelFactory
{
35 private static @Nullable ITmfXmlModelFactory fInstance
= null;
38 * Get the instance of this model creator
40 * @return The {@link TmfXmlReadOnlyModelFactory} instance
42 public static synchronized ITmfXmlModelFactory
getInstance() {
43 ITmfXmlModelFactory instance
= fInstance
;
44 if (instance
== null) {
45 instance
= new TmfXmlReadOnlyModelFactory();
52 public ITmfXmlStateAttribute
createStateAttribute(Element attribute
, IXmlStateSystemContainer container
) {
53 return new TmfXmlReadOnlyStateAttribute(this, attribute
, container
);
57 public ITmfXmlStateValue
createStateValue(Element node
, IXmlStateSystemContainer container
, List
<ITmfXmlStateAttribute
> attributes
) {
58 return new TmfXmlReadOnlyStateValue(this, node
, container
, attributes
);
62 public ITmfXmlStateValue
createStateValue(Element node
, IXmlStateSystemContainer container
, String eventField
) {
63 return new TmfXmlReadOnlyStateValue(this, node
, container
, eventField
);
67 public TmfXmlCondition
createCondition(Element node
, IXmlStateSystemContainer container
) {
68 return new TmfXmlCondition(this, node
, container
);
72 public TmfXmlEventHandler
createEventHandler(Element node
, IXmlStateSystemContainer container
) {
73 return new TmfXmlEventHandler(this, node
, container
);
77 public TmfXmlStateChange
createStateChange(Element node
, IXmlStateSystemContainer container
) {
78 return new TmfXmlStateChange(this, node
, container
);
82 public TmfXmlLocation
createLocation(Element node
, IXmlStateSystemContainer container
) {
83 return new TmfXmlLocation(this, node
, container
);