From aeb658d9d5095e3d7cbcc929600123e33276b0e3 Mon Sep 17 00:00:00 2001 From: "daeryong.park" Date: Tue, 13 Jun 2017 11:05:10 +0900 Subject: [PATCH] RTSDK : Changed flash meta model specification - Changed flash meta xml and xsd file - Changed flash model class and related classes - Changed unit test for flash model Change-Id: Icf67adbe657070a080ce36df8ece2f971044ce4a Signed-off-by: daeryong.park --- .../tizen/rt/product/meta/model/flash/Execute.java | 2 +- .../rt/product/meta/model/flash/Executors.java | 2 +- .../tizen/rt/product/meta/model/flash/Flash.java | 21 ++++++- .../tizen/rt/product/meta/model/flash/Flashes.java | 68 ++++++++++++++++++++++ .../rt/product/meta/model/flash/ObjectFactory.java | 9 ++- .../tizen/rt/product/meta/model/flash/Options.java | 2 +- .../tizen/rt/product/meta/resources/flashSpec.xml | 41 ++++++++----- .../tizen/rt/product/meta/resources/flashSpec.xsd | 16 +++-- .../tizen/rt/product/meta/util/MetaModelUtil.java | 26 ++++----- .../tizen/rt/product/meta/model/LoadModelTest.java | 4 +- .../src/org/tizen/rt/ide/meta/MetaManager.java | 6 +- 11 files changed, 157 insertions(+), 40 deletions(-) create mode 100644 rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flashes.java diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Execute.java b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Execute.java index 1607616..1286272 100644 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Execute.java +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Execute.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.05.19 at 01:42:57 PM KST +// Generated on: 2017.06.12 at 05:10:24 PM KST // package org.tizen.rt.product.meta.model.flash; diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Executors.java b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Executors.java index b4494cd..994345b 100644 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Executors.java +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Executors.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.05.19 at 01:42:57 PM KST +// Generated on: 2017.06.12 at 05:10:24 PM KST // package org.tizen.rt.product.meta.model.flash; diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flash.java b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flash.java index 7743a23..b203c6c 100644 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flash.java +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flash.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.05.19 at 01:42:57 PM KST +// Generated on: 2017.06.12 at 05:10:24 PM KST // package org.tizen.rt.product.meta.model.flash; @@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlType; * <element ref="{}options"/> * </sequence> * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="virtual" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * </restriction> * </complexContent> * </complexType> @@ -48,6 +49,8 @@ public class Flash { protected Options options; @XmlAttribute(name = "name") protected String name; + @XmlAttribute(name = "virtual") + protected Boolean virtual; /** * Gets the value of the executors property. @@ -97,4 +100,20 @@ public class Flash { this.name = value; } + /** + * Gets the value of the virtual property. + * @return possible object is {@link Boolean } + */ + public Boolean isVirtual() { + return virtual; + } + + /** + * Sets the value of the virtual property. + * @param value allowed object is {@link Boolean } + */ + public void setVirtual(Boolean value) { + this.virtual = value; + } + } diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flashes.java b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flashes.java new file mode 100644 index 0000000..fcf634f --- /dev/null +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Flashes.java @@ -0,0 +1,68 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2017.06.12 at 05:10:24 PM KST +// + +package org.tizen.rt.product.meta.model.flash; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for anonymous complex type. + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{}flash" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "flash" +}) +@XmlRootElement(name = "flashes") +public class Flashes { + + @XmlElement(required = true) + protected List flash; + + /** + * Gets the value of the flash property. + *

+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is + * not a set method for the flash property. + *

+ * For example, to add a new item, do as follows: + * + *

+     * getFlash().add(newItem);
+     * 
+ *

+ * Objects of the following type(s) are allowed in the list {@link Flash } + */ + public List getFlash() { + if (flash == null) { + flash = new ArrayList(); + } + return this.flash; + } + +} diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/ObjectFactory.java b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/ObjectFactory.java index 3e80162..cf9f438 100644 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/ObjectFactory.java +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/ObjectFactory.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.05.19 at 01:42:57 PM KST +// Generated on: 2017.06.12 at 05:10:24 PM KST // package org.tizen.rt.product.meta.model.flash; @@ -51,6 +51,13 @@ public class ObjectFactory { } /** + * Create an instance of {@link Flashes } + */ + public Flashes createFlashes() { + return new Flashes(); + } + + /** * Create an instance of {@link Flash } */ public Flash createFlash() { diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Options.java b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Options.java index 7ea1394..18afee8 100644 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Options.java +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/model/flash/Options.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.05.19 at 01:42:57 PM KST +// Generated on: 2017.06.12 at 05:10:24 PM KST // package org.tizen.rt.product.meta.model.flash; diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xml b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xml index 6a55910..0548765 100644 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xml +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xml @@ -1,14 +1,29 @@ - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xsd b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xsd index 0eef16a..a748277 100644 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xsd +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/resources/flashSpec.xsd @@ -1,5 +1,5 @@ - + + @@ -44,10 +44,18 @@ - - + + + + + + + + + + diff --git a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/util/MetaModelUtil.java b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/util/MetaModelUtil.java index 1a3c64c..d5f5995 100755 --- a/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/util/MetaModelUtil.java +++ b/rt-ide/tizen.rt.product.meta/src/org/tizen/rt/product/meta/util/MetaModelUtil.java @@ -54,7 +54,7 @@ import org.tizen.rt.product.meta.IModelConstants; import org.tizen.rt.product.meta.RtMetaPlugin; import org.tizen.rt.product.meta.model.build.Build; import org.tizen.rt.product.meta.model.debug.Debugs; -import org.tizen.rt.product.meta.model.flash.Flash; +import org.tizen.rt.product.meta.model.flash.Flashes; import org.w3c.dom.Document; import org.xml.sax.SAXException; @@ -86,13 +86,13 @@ public class MetaModelUtil { /** * Copy default flashSpec.xml file to destination and load copied flashSpec.xml file * @param destination File full path string - * @return Load {@link Flash} model instance + * @return Load {@link Flashes} model instance * @throws IOException * @throws JAXBException */ - public static Flash copyDefaultFlashModelAndLoad(String destination) throws IOException, JAXBException { + public static Flashes copyDefaultFlashModelAndLoad(String destination) throws IOException, JAXBException { InputStream source = RtMetaPlugin.class.getResourceAsStream("resources" + File.separator + IModelConstants.FILE_NAME_FLASH_META_XML); - return copyDefaultModelAndLoad(Flash.class, source, destination); + return copyDefaultModelAndLoad(Flashes.class, source, destination); } /** @@ -179,29 +179,29 @@ public class MetaModelUtil { /** * @param flashXmlFile flashSpec.xml file - * @return {@link Flash} model instance + * @return {@link Flashes} model instance * @throws JAXBException */ - public static Flash loadFlashModel(File flashXmlFile) throws JAXBException { - return loadModel(Flash.class, flashXmlFile); + public static Flashes loadFlashModel(File flashXmlFile) throws JAXBException { + return loadModel(Flashes.class, flashXmlFile); } /** * @param flashXmlFile flashSpec.xml file input stream - * @return {@link Flash} model instance + * @return {@link Flashes} model instance * @throws JAXBException */ - public static Flash loadFlashModel(InputStream flashXmlFile) throws JAXBException { - return loadModel(Flash.class, flashXmlFile); + public static Flashes loadFlashModel(InputStream flashXmlFile) throws JAXBException { + return loadModel(Flashes.class, flashXmlFile); } /** - * @param flashModel {@link Flash} model instance + * @param flashModel {@link Flashes} model instance * @return xml strings of marshaled flash model * @throws JAXBException */ - public static String showFlashModel(Flash flashModel) throws JAXBException { - return showModel(Flash.class, flashModel); + public static String showFlashModel(Flashes flashModel) throws JAXBException { + return showModel(Flashes.class, flashModel); } /** diff --git a/rt-ide/tizen.rt.product.meta/test/src/org/tizen/rt/product/meta/model/LoadModelTest.java b/rt-ide/tizen.rt.product.meta/test/src/org/tizen/rt/product/meta/model/LoadModelTest.java index 25db5f7..cf41841 100755 --- a/rt-ide/tizen.rt.product.meta/test/src/org/tizen/rt/product/meta/model/LoadModelTest.java +++ b/rt-ide/tizen.rt.product.meta/test/src/org/tizen/rt/product/meta/model/LoadModelTest.java @@ -39,7 +39,7 @@ import org.tizen.rt.product.meta.IModelConstants; import org.tizen.rt.product.meta.RtMetaPlugin; import org.tizen.rt.product.meta.model.build.Build; import org.tizen.rt.product.meta.model.debug.Debugs; -import org.tizen.rt.product.meta.model.flash.Flash; +import org.tizen.rt.product.meta.model.flash.Flashes; import org.tizen.rt.product.meta.util.MetaModelUtil; import org.xml.sax.SAXException; @@ -63,7 +63,7 @@ public class LoadModelTest { @Test public void flashModelTest() throws JAXBException { InputStream is = RtMetaPlugin.class.getResourceAsStream("resources/flashSpec.xml"); - Flash model = MetaModelUtil.loadFlashModel(is); + Flashes model = MetaModelUtil.loadFlashModel(is); Assert.assertNotNull(model); String result = MetaModelUtil.showFlashModel(model); diff --git a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/meta/MetaManager.java b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/meta/MetaManager.java index 157f8ec..a2064f4 100644 --- a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/meta/MetaManager.java +++ b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/meta/MetaManager.java @@ -35,7 +35,7 @@ import org.tizen.rt.ide.exception.MetaLoadException; import org.tizen.rt.ide.exception.MetaNotFoundException; import org.tizen.rt.product.meta.model.build.Build; import org.tizen.rt.product.meta.model.debug.Debugs; -import org.tizen.rt.product.meta.model.flash.Flash; +import org.tizen.rt.product.meta.model.flash.Flashes; import org.tizen.rt.product.meta.util.MetaModelUtil; import org.tizen.rt.product.meta.util.MetaModelUtil.MODEL_TYPE; import org.xml.sax.SAXException; @@ -66,7 +66,7 @@ public class MetaManager implements IMetaConstants { } } - public static Flash loadFlashMeta(IProject project, String board) + public static Flashes loadFlashMeta(IProject project, String board) throws MetaNotFoundException, InvalidMetaException, MetaLoadException { // flashSpec.xml file load File metaFile = getMetaFile(project, board, FILE_NAME_FLASH_META_XML); @@ -76,7 +76,7 @@ public class MetaManager implements IMetaConstants { try { // flashSpec.xml model load - Flash model = MetaModelUtil.loadFlashModel(metaFile); + Flashes model = MetaModelUtil.loadFlashModel(metaFile); return model; } catch (JAXBException e) { throw new MetaLoadException(e); -- 2.7.4