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