svnno****@sourc*****
svnno****@sourc*****
2008年 11月 5日 (水) 21:00:12 JST
Revision: 2087 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=2087 Author: daisuke_m Date: 2008-11-05 21:00:12 +0900 (Wed, 05 Nov 2008) Log Message: ----------- namespaceを定数クラスに分離した。 Modified Paths: -------------- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/ModelWriter.java artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/RootXmlElement.java artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/XmlElement.java Added Paths: ----------- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/Namespaces.java -------------- next part -------------- Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/ModelWriter.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/ModelWriter.java 2008-11-05 11:50:51 UTC (rev 2086) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/ModelWriter.java 2008-11-05 12:00:12 UTC (rev 2087) @@ -74,9 +74,8 @@ */ public ModelWriter(RootModel rootModel, Queue<Byte> resourceQueue) { this.resourceQueue = resourceQueue; - dataWriter.setPrefix(XmlElement.CORE_URI, ""); -// dataWriter.setPrefix(EVENT_NAMESPACE, "event"); -// dataWriter.setPrefix(VIEW_NAMESPACE, "view"); + dataWriter.setPrefix(Namespaces.CORE, ""); +// dataWriter.setPrefix(Constants.VIEW, "view"); dataWriter.setIndentStep(2); StringWriter sw = new StringWriter(); Added: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/Namespaces.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/Namespaces.java (rev 0) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/Namespaces.java 2008-11-05 12:00:12 UTC (rev 2087) @@ -0,0 +1,38 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/11/05 + * + * This file is part of Jiemamy. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package org.jiemamy.serializer; + +/** + * TODO for daisuke + * @author daisuke + */ +public final class Namespaces { + + public static final String XMLNS = "http://www.w3.org/2000/xmlns/"; + + public static final String XSI = "http://www.w3.org/2001/XMLSchema-instance"; + + public static final String CORE = "http://jiemamy.org/xml/ns/core"; + + public static final String VIEW = "http://jiemamy.org/xml/ns/view"; + + + private Namespaces() { + } +} Property changes on: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/Namespaces.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/RootXmlElement.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/RootXmlElement.java 2008-11-05 11:50:51 UTC (rev 2086) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/RootXmlElement.java 2008-11-05 12:00:12 UTC (rev 2087) @@ -18,6 +18,7 @@ */ package org.jiemamy.serializer.element; +import org.jiemamy.serializer.Namespaces; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.view.model.DiagramPresentations; @@ -50,9 +51,9 @@ // xsi:schemaLocation="http://jiemamy.org/xml/ns/core jiemamy-core.xsd" // という属性を出したい…。 - addAttribute("", "xmlns", "xmlns", "CDATA", CORE_URI); - addAttribute("", "xmlns:xsi", "xsi", "CDATA", XSI_URI); - addAttribute(XSI_URI, "schemaLocation", "", "CDATA", CORE_URI + " jiemamy-core.xsd"); + addAttribute("", "xmlns", "xmlns", "CDATA", Namespaces.CORE); + addAttribute("", "xmlns:xsi", "xsi", "CDATA", Namespaces.XSI); + addAttribute(Namespaces.XSI, "schemaLocation", "", "CDATA", Namespaces.CORE + " jiemamy-core.xsd"); // addAttribute("", "xmlns", "xmlns", "CDATA", J_URI); // addAttribute("", "xsi", "xmlns:xsi", "CDATA", XSI_URI); Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/XmlElement.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/XmlElement.java 2008-11-05 11:50:51 UTC (rev 2086) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/XmlElement.java 2008-11-05 12:00:12 UTC (rev 2087) @@ -34,14 +34,6 @@ */ public class XmlElement implements Iterator<XmlElement> { - public static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; - - public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; - - public static final String CORE_URI = "http://jiemamy.org/xml/ns/core"; - - public static final String VIEW_URI = "http://jiemamy.org/xml/ns/view"; - /** * 未出力エレメントのキュー *