tmf : Remove of unused import
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.analysis.xml.core / src / org / eclipse / tracecompass / tmf / analysis / xml / core / model / readonly / TmfXmlReadOnlyModelFactory.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
2bdf0193 13package org.eclipse.tracecompass.tmf.analysis.xml.core.model.readonly;
1d7e62f9
GB
14
15import java.util.List;
16
12685851 17import org.eclipse.jdt.annotation.Nullable;
2bdf0193
AM
18import org.eclipse.tracecompass.tmf.analysis.xml.core.model.ITmfXmlModelFactory;
19import org.eclipse.tracecompass.tmf.analysis.xml.core.model.ITmfXmlStateAttribute;
20import org.eclipse.tracecompass.tmf.analysis.xml.core.model.ITmfXmlStateValue;
21import org.eclipse.tracecompass.tmf.analysis.xml.core.model.TmfXmlCondition;
22import org.eclipse.tracecompass.tmf.analysis.xml.core.model.TmfXmlEventHandler;
23import org.eclipse.tracecompass.tmf.analysis.xml.core.model.TmfXmlLocation;
24import org.eclipse.tracecompass.tmf.analysis.xml.core.model.TmfXmlStateChange;
2bdf0193 25import org.eclipse.tracecompass.tmf.analysis.xml.core.module.IXmlStateSystemContainer;
1d7e62f9
GB
26import org.w3c.dom.Element;
27
28/**
b1ebf44e 29 * Concrete factory for XML model elements in read only mode
1d7e62f9
GB
30 *
31 * @author Geneviève Bastien
32 */
b1ebf44e 33public class TmfXmlReadOnlyModelFactory implements ITmfXmlModelFactory {
1d7e62f9 34
12685851 35 private static @Nullable ITmfXmlModelFactory fInstance = null;
1d7e62f9
GB
36
37 /**
38 * Get the instance of this model creator
39 *
c42ec905 40 * @return The {@link TmfXmlReadOnlyModelFactory} instance
1d7e62f9 41 */
1d7e62f9
GB
42 public static synchronized ITmfXmlModelFactory getInstance() {
43 ITmfXmlModelFactory instance = fInstance;
44 if (instance == null) {
b1ebf44e 45 instance = new TmfXmlReadOnlyModelFactory();
1d7e62f9
GB
46 fInstance = instance;
47 }
48 return instance;
49 }
50
51 @Override
52 public ITmfXmlStateAttribute createStateAttribute(Element attribute, IXmlStateSystemContainer container) {
b1ebf44e 53 return new TmfXmlReadOnlyStateAttribute(this, attribute, container);
1d7e62f9
GB
54 }
55
56 @Override
57 public ITmfXmlStateValue createStateValue(Element node, IXmlStateSystemContainer container, List<ITmfXmlStateAttribute> attributes) {
b1ebf44e 58 return new TmfXmlReadOnlyStateValue(this, node, container, attributes);
1d7e62f9
GB
59 }
60
61 @Override
62 public ITmfXmlStateValue createStateValue(Element node, IXmlStateSystemContainer container, String eventField) {
b1ebf44e 63 return new TmfXmlReadOnlyStateValue(this, node, container, eventField);
1d7e62f9
GB
64 }
65
66 @Override
67 public TmfXmlCondition createCondition(Element node, IXmlStateSystemContainer container) {
68 return new TmfXmlCondition(this, node, container);
69 }
70
71 @Override
72 public TmfXmlEventHandler createEventHandler(Element node, IXmlStateSystemContainer container) {
73 return new TmfXmlEventHandler(this, node, container);
74 }
75
76 @Override
77 public TmfXmlStateChange createStateChange(Element node, IXmlStateSystemContainer container) {
78 return new TmfXmlStateChange(this, node, container);
79 }
80
81 @Override
82 public TmfXmlLocation createLocation(Element node, IXmlStateSystemContainer container) {
83 return new TmfXmlLocation(this, node, container);
84 }
85
86}
This page took 0.059054 seconds and 5 git commands to generate.