svnno****@sourc*****
svnno****@sourc*****
2008年 11月 27日 (木) 00:41:10 JST
Revision: 2188 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2188 Author: daisuke_m Date: 2008-11-27 00:41:10 +0900 (Thu, 27 Nov 2008) Log Message: ----------- Appenderの廃止。 / appendModel/removeModelを、RootModel, TableModelに直接実装。 Modified Paths: -------------- artemis/trunk/org.jiemamy.core/META-INF/MANIFEST.MF artemis/trunk/org.jiemamy.core/build.properties artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/AbstractModel.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/DomainModelImpl.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/ValueCheckUtil.java artemis/trunk/org.jiemamy.core/src/main/resources/jiemamy-core.dicon artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/node/TableModelImplTest.java artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/ValueCheckUtilTest.java artemis/trunk/org.jiemamy.event/.project artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableList.java artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableSet.java artemis/trunk/org.jiemamy.event/src/main/resources/jiemamy-event.dicon 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/sax/ForeignKeyCommand.java artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/sax/JiemamyModelCommand.java artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ApplicationModelCreator.java artemis/trunk/org.jiemamy.view/.project artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/DiagramPresentationModelImplTest.java artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetColorProcessorTest.java artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetConstraintProcessorTest.java vesta/trunk/org.jiemamy.eclipse/.classpath vesta/trunk/org.jiemamy.eclipse/META-INF/MANIFEST.MF vesta/trunk/org.jiemamy.eclipse/build.properties vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditor.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/MultiDiagramEditor.java vesta/trunk/org.jiemamy.eclipse/src/main/resources/jiemamy-eclipse.dicon zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/JiemamyModelFactory.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/TooManyElementsException.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/JiemamyModel.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/RootModel.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java zeus/trunk/org.jiemamy.spec.view/src/main/java/org/jiemamy/spec/view/model/DiagramPresentations.java Added Paths: ----------- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/InitializePredicate.java vesta/trunk/org.jiemamy.eclipse/src/main/resources/logback.xml Removed Paths: ------------- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/appender/ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationModelAppender.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/NotInitializedException.java -------------- next part -------------- Modified: artemis/trunk/org.jiemamy.core/META-INF/MANIFEST.MF =================================================================== --- artemis/trunk/org.jiemamy.core/META-INF/MANIFEST.MF 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/META-INF/MANIFEST.MF 2008-11-26 15:41:10 UTC (rev 2188) @@ -18,7 +18,8 @@ lib/collections-generic-4.01.jar, lib/s2-extension-2.4.27.jar, lib/s2-framework-2.4.27.jar, - lib/s2-tiger-2.4.27.jar + lib/s2-tiger-2.4.27.jar, + lib/slf4j-api-1.5.5.jar Bundle-Vendor: Jiemamy Project Export-Package: javassist, javassist.bytecode, @@ -172,7 +173,6 @@ org.jiemamy.core.accessor.dataset, org.jiemamy.core.accessor.index, org.jiemamy.core.accessor.node, - org.jiemamy.core.appender, org.jiemamy.core.extension.dialect, org.jiemamy.core.extension.dialect.mapping, org.jiemamy.core.extension.dialect.parser, Modified: artemis/trunk/org.jiemamy.core/build.properties =================================================================== --- artemis/trunk/org.jiemamy.core/build.properties 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/build.properties 2008-11-26 15:41:10 UTC (rev 2188) @@ -20,7 +20,8 @@ lib/s2-framework-2.4.27.jar,\ lib/s2-tiger-2.4.27.jar,\ LICENSE.txt,\ - schema/ + schema/,\ + lib/slf4j-api-1.5.5.jar output..=target/classes/ source..=src/main/java/,src/main/resources/,src/test/java/,src/test/resources/ bin.excludes=lib/sources/ Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/AbstractModel.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/AbstractModel.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/AbstractModel.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -24,11 +24,9 @@ import org.apache.commons.collections15.list.UnmodifiableList; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; -import org.seasar.framework.container.annotation.tiger.Binding; import org.seasar.framework.util.tiger.CollectionsUtil; import org.jiemamy.core.accessor.JiemamyModelAccessor; -import org.jiemamy.core.appender.JiemamyModelAppender; import org.jiemamy.spec.Processor; import org.jiemamy.spec.exception.JiemamyRuntimeException; import org.jiemamy.spec.model.JiemamyModel; @@ -65,10 +63,6 @@ } - /** 当モデルに対して、子モデルを追加するアペンダのリスト */ - @Binding("list") - protected List<JiemamyModelAppender<? super JiemamyModel, ? super JiemamyModel>> appenders; - /** 適用可能なアダプタのリスト */ private List<Object> adapters = CollectionsUtil.newArrayList(); @@ -86,13 +80,6 @@ /** * {@inheritDoc} */ - public void appendModel(JiemamyModel jiemamyModel) { - throw new UnsupportedOperationException(); - } - - /** - * {@inheritDoc} - */ @SuppressWarnings("unchecked") public <T extends JiemamyModel>T clone() { try { @@ -209,23 +196,8 @@ } /** - * {@link JiemamyModelAppender}を登録する。 - * @param appender このモデルに対するアペンダ - */ - public void registerAppender(JiemamyModelAppender<? super JiemamyModel, ? super JiemamyModel> appender) { - appenders.add(appender); - } - - /** * {@inheritDoc} */ - public void removeModel(JiemamyModel jiemamyModel) { - throw new UnsupportedOperationException(); - } - - /** - * {@inheritDoc} - */ public void setAdapters(List<Object> adapters) { this.adapters = adapters; } Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/DomainModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/DomainModelImpl.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/DomainModelImpl.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -18,6 +18,8 @@ */ package org.jiemamy.core.model; +import org.apache.commons.lang.ObjectUtils; + import org.jiemamy.core.accessor.DomainModelAccessor; import org.jiemamy.core.model.constraint.ConstraintsModelImpl; import org.jiemamy.spec.model.DomainModel; @@ -223,7 +225,7 @@ */ @Override public String toString() { - return name + ":" + dataType.toString(); + return name + ":" + ObjectUtils.toString(dataType, "null"); } } Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -25,7 +25,7 @@ import org.seasar.framework.container.annotation.tiger.Binding; import org.jiemamy.core.accessor.RootModelAccessor; -import org.jiemamy.core.appender.JiemamyModelAppender; +import org.jiemamy.core.accessor.node.NodeModelAccessor; import org.jiemamy.core.utils.ValueCheckUtil; import org.jiemamy.core.utils.processor.connection.foreignkey.ProvideForeignKeyNameProcessor; import org.jiemamy.core.utils.processor.root.GetConnectionsProcessor; @@ -33,8 +33,6 @@ import org.jiemamy.core.utils.processor.root.GetNodesProcessor; import org.jiemamy.core.utils.processor.root.ProvideEntityNameProcessor; import org.jiemamy.spec.JiemamyModelFactory; -import org.jiemamy.spec.exception.CannotAppendException; -import org.jiemamy.spec.exception.CannotRemoveException; import org.jiemamy.spec.exception.TooManyElementsException; import org.jiemamy.spec.extension.dialect.Dialect; import org.jiemamy.spec.extension.dialect.IdentifierValidator; @@ -91,28 +89,41 @@ /** * {@inheritDoc} */ - @Override - public void appendModel(JiemamyModel jiemamyModel) { - Validate.notNull(jiemamyModel); - ValueCheckUtil.assertInitialized(jiemamyModel); - // HACK なんとか、上手くできんのやろか。 - boolean added = false; - for (JiemamyModelAppender<? super RootModel, ? super JiemamyModel> appender : appenders) { - try { - appender.append(this, jiemamyModel); - added = true; - } catch (ClassCastException ignore) { - // ignore - } - } - if (added == false) { - throw new CannotAppendException(this, jiemamyModel); - } + public void appendModel(AbstractConnectionModel connection) { + ((NodeModelAccessor) connection.getSource()).getModifiableSourceConnections().add(connection); + ((NodeModelAccessor) connection.getTarget()).getModifiableTargetConnections().add(connection); } /** * {@inheritDoc} */ + public void appendModel(AbstractNodeModel node) { + Validate.notNull(node); + ValueCheckUtil.assertInitialized(node); + nodes.add(node); + } + + /** + * {@inheritDoc} + */ + public void appendModel(DomainModel domain) { + Validate.notNull(domain); + ValueCheckUtil.assertInitialized(domain); + domains.add(domain); + } + + /** + * {@inheritDoc} + */ + public void appendModel(InsertDataSetModel insertDataSet) { + Validate.notNull(insertDataSet); + ValueCheckUtil.assertInitialized(insertDataSet); + insertDataSets.add(insertDataSet); + } + + /** + * {@inheritDoc} + */ @SuppressWarnings("unchecked") public <T extends JiemamyModel>T createJiemamyModel(Class<T> clazz) { return JiemamyModelFactory.create(this, clazz); @@ -207,6 +218,14 @@ return insertDataSets; } +// /** +// * {@inheritDoc} +// */ +// @Override +// public String toString() { +// return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); +// } + /** * {@inheritDoc} */ @@ -235,14 +254,6 @@ return schemaName; } -// /** -// * {@inheritDoc} -// */ -// @Override -// public String toString() { -// return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); -// } - /** * {@inheritDoc} */ @@ -268,27 +279,35 @@ /** * {@inheritDoc} */ - @Override - public void removeModel(JiemamyModel jiemamyModel) { - Validate.notNull(jiemamyModel); - // HACK なんとか、上手くできんのやろか。 - boolean removed = false; - for (JiemamyModelAppender<? super RootModel, ? super JiemamyModel> appender : appenders) { - try { - appender.remove(this, jiemamyModel); - removed = true; - } catch (ClassCastException ignore) { - // ignore - } - } - if (removed == false) { - throw new CannotRemoveException(this, jiemamyModel); - } + public void removeModel(AbstractConnectionModel connection) { + ((NodeModelAccessor) connection.getSource()).getModifiableSourceConnections().remove(connection); + ((NodeModelAccessor) connection.getTarget()).getModifiableTargetConnections().remove(connection); } /** * {@inheritDoc} */ + public void removeModel(AbstractNodeModel node) { + nodes.remove(node); + } + + /** + * {@inheritDoc} + */ + public void removeModel(DomainModel domain) { + domains.remove(domain); + } + + /** + * {@inheritDoc} + */ + public void removeModel(InsertDataSetModel insertDataSet) { + insertDataSets.remove(insertDataSet); + } + + /** + * {@inheritDoc} + */ public void setBeginScript(String beginScript) { this.beginScript = beginScript; } Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -21,19 +21,14 @@ import java.util.List; import org.apache.commons.collections15.list.UnmodifiableList; -import org.apache.commons.lang.Validate; import org.seasar.framework.container.annotation.tiger.Binding; import org.jiemamy.core.accessor.node.TableModelAccessor; -import org.jiemamy.core.appender.JiemamyModelAppender; import org.jiemamy.core.utils.ValueCheckUtil; import org.jiemamy.core.utils.processor.entity.table.GetColumnProcessor; import org.jiemamy.core.utils.processor.entity.table.GetPrimaryKeyColumnsProcessor; -import org.jiemamy.spec.exception.CannotAppendException; -import org.jiemamy.spec.exception.CannotRemoveException; import org.jiemamy.spec.exception.TooManyElementsException; import org.jiemamy.spec.model.ColumnModel; -import org.jiemamy.spec.model.JiemamyModel; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.constraint.CheckConstraintModel; import org.jiemamy.spec.model.index.IndexModel; @@ -63,28 +58,30 @@ /** * {@inheritDoc} */ - @Override - public void appendModel(JiemamyModel jiemamyModel) { - Validate.notNull(jiemamyModel); - ValueCheckUtil.assertInitialized(jiemamyModel); - // HACK なんとか、上手くできんのやろか。 - boolean added = false; - for (JiemamyModelAppender<? super TableModel, ? super JiemamyModel> appender : appenders) { - try { - appender.append(this, jiemamyModel); - added = true; - } catch (ClassCastException ignore) { - // ignore - } - } - if (added == false) { - throw new CannotAppendException(this, jiemamyModel); - } + public void appendModel(CheckConstraintModel check) { + ValueCheckUtil.assertInitialized(check); + checks.add(check); } /** * {@inheritDoc} */ + public void appendModel(ColumnModel column) { + ValueCheckUtil.assertInitialized(column); + columns.add(column); + } + + /** + * {@inheritDoc} + */ + public void appendModel(IndexModel index) { + ValueCheckUtil.assertInitialized(index); + indexes.add(index); + } + + /** + * {@inheritDoc} + */ @Override public void dispose() { for (ColumnModel column : columns) { @@ -177,25 +174,25 @@ /** * {@inheritDoc} */ - @Override - public void removeModel(JiemamyModel jiemamyModel) { - Validate.notNull(jiemamyModel); - // HACK なんとか、上手くできんのやろか。 - boolean removed = false; - for (JiemamyModelAppender<? super TableModel, ? super JiemamyModel> appender : appenders) { - try { - appender.remove(this, jiemamyModel); - removed = true; - } catch (ClassCastException ignore) { - // ignore - } - } - if (removed == false) { - throw new CannotRemoveException(this, jiemamyModel); - } + public void removeModel(CheckConstraintModel check) { + checks.remove(check); } /** + * {@inheritDoc} + */ + public void removeModel(ColumnModel column) { + columns.remove(column); + } + + /** + * {@inheritDoc} + */ + public void removeModel(IndexModel index) { + indexes.remove(index); + } + + /** * テーブルCHECK制約のリストを設定する。 * @param checks テーブルCHECK制約のリスト */ Added: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/InitializePredicate.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/InitializePredicate.java (rev 0) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/InitializePredicate.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -0,0 +1,42 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/11/26 + * + * 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.core.utils; + +import org.apache.commons.collections15.Predicate; + +import org.jiemamy.spec.model.JiemamyModel; + +/** + * TODO for daisuke + * @author daisuke + */ +public class InitializePredicate implements Predicate<Object> { + + /** + * {@inheritDoc} + */ + public boolean evaluate(Object object) { + if (object instanceof JiemamyModel) { + JiemamyModel jiemamyModel = (JiemamyModel) object; + return jiemamyModel.isInitialized(); + } + return true; + } + +} Property changes on: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/InitializePredicate.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/ValueCheckUtil.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/ValueCheckUtil.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/ValueCheckUtil.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -20,7 +20,6 @@ import org.apache.commons.lang.Validate; -import org.jiemamy.spec.exception.NotInitializedException; import org.jiemamy.spec.model.JiemamyModel; /** @@ -37,14 +36,14 @@ * 初期化チェックを行う。 * * @param jiemamyModel 検査対象オブジェクト - * @throws NotInitializedException 与えられたモデルが未初期化だった場合 + * @throws IllegalStateException 与えられたモデルが未初期化だった場合 */ public static void assertInitialized(JiemamyModel jiemamyModel) { if (jiemamyModel == null) { return; } if (jiemamyModel.isInitialized() == false) { - throw new NotInitializedException(jiemamyModel); + throw new IllegalArgumentException("Factory is not initialized"); } } Modified: artemis/trunk/org.jiemamy.core/src/main/resources/jiemamy-core.dicon =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/resources/jiemamy-core.dicon 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/main/resources/jiemamy-core.dicon 2008-11-26 15:41:10 UTC (rev 2188) @@ -3,25 +3,20 @@ "http://www.seasar.org/dtd/components24.dtd"> <components namespace="org.jiemamy"> - <component name="list" class="java.util.ArrayList" instance="prototype"/> - <component name="set" class="java.util.HashSet" instance="prototype"/> - <component name="map" class="java.util.HashMap" instance="prototype"/> + <component name="predicate" class="org.jiemamy.core.utils.InitializePredicate" /> + <component name="list" instance="prototype"> + @org.apache.commons.collections15.list.PredicatedList @ decorate(new java.util.ArrayList(), predicate) + </component> + <component name="set" instance="prototype"> + @org.apache.commons.collections15.set.PredicatedSet @ decorate(new java.util.HashSet(), predicate) + </component> + <component name="map" instance="prototype"> + @org.apache.commons.collections15.map.PredicatedMap @ decorate(new java.util.HashMap(), + @org.apache.commons.collections15.functors.TruePredicate @ INSTANCE, predicate) + </component> <!-- Jiemamy Model --> - <component class="org.jiemamy.core.model.RootModelImpl" instance="prototype" autoBinding="none"> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.NodeAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.ConnectionAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.DomainAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.InsertDataSetsAppender" /></arg> - </initMethod> - </component> + <component class="org.jiemamy.core.model.RootModelImpl" instance="prototype" autoBinding="none"/> <component class="org.jiemamy.core.model.node.ViewModelImpl" instance="prototype"/> <component class="org.jiemamy.core.model.node.StickyModelImpl" instance="prototype"/> <component class="org.jiemamy.core.model.connection.ForeignKeyModelImpl" instance="prototype" autoBinding="none"/> @@ -29,17 +24,7 @@ <component class="org.jiemamy.core.model.DomainModelImpl" instance="prototype" autoBinding="none"/> <component class="org.jiemamy.core.model.dataset.InsertDataSetModelImpl" instance="prototype"/> <component class="org.jiemamy.core.model.dataset.RecordModelImpl" instance="prototype"/> - <component class="org.jiemamy.core.model.node.TableModelImpl" instance="prototype"> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.ColumnAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.CheckConstraintAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.IndexAppender" /></arg> - </initMethod> - </component> + <component class="org.jiemamy.core.model.node.TableModelImpl" instance="prototype"/> <component class="org.jiemamy.core.model.ColumnModelImpl" instance="prototype"/> <component class="org.jiemamy.core.model.constraint.NotNullConstraintModelImpl" instance="prototype" /> Modified: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -33,16 +33,12 @@ import org.jiemamy.core.S2FactoryStrategy; import org.jiemamy.core.model.typedef.datatype.impl.IntegerDataTypeMock; import org.jiemamy.spec.JiemamyModelFactory; -import org.jiemamy.spec.exception.CannotAppendException; import org.jiemamy.spec.exception.CannotRemoveException; -import org.jiemamy.spec.exception.NotInitializedException; -import org.jiemamy.spec.model.ColumnModel; import org.jiemamy.spec.model.DomainModel; import org.jiemamy.spec.model.JiemamyModel; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.connection.ForeignKeyModel; import org.jiemamy.spec.model.dataset.InsertDataSetModel; -import org.jiemamy.spec.model.datatype.DataType; import org.jiemamy.spec.model.node.TableModel; /** @@ -172,7 +168,7 @@ try { rootModel.appendModel(rootModel.createJiemamyModel(DomainModel.class)); fail(); - } catch (NotInitializedException e) { + } catch (IllegalArgumentException e) { // success } } @@ -182,9 +178,8 @@ * @throws Exception */ @Test - @Ignore + @Ignore("現在この仕様は実装されていない。実装すべきか否か") public void test05_未追加のモデルをremoveしようとすると例外が飛ぶこと() throws Exception { - // THINK 現在この仕様は実装されていない。実装すべきか否か。 TableModel table = rootModel.createJiemamyModel(TableModel.class).init(rootModel); try { rootModel.removeModel(table); @@ -195,35 +190,36 @@ } } - /** - * 不適切なモデルをappendしようとすると例外が飛ぶこと。 - * @throws Exception - */ - @Test - public void test06_不適切なモデルをappendしようとすると例外が飛ぶこと() throws Exception { - DataType dataType = new IntegerDataTypeMock(); - ColumnModel column = rootModel.createJiemamyModel(ColumnModel.class).init("a", dataType); - try { - rootModel.appendModel(column); - fail(); - } catch (CannotAppendException e) { - assertThat(e.getParent(), is((JiemamyModel) rootModel)); - assertThat(e.getChild(), is((JiemamyModel) column)); - } - try { - rootModel.appendModel(dataType); - fail(); - } catch (CannotAppendException e) { - assertThat(e.getParent(), is((JiemamyModel) rootModel)); - assertThat(e.getChild(), is((JiemamyModel) dataType)); - } - } +// /** +// * 不適切なモデルをappendしようとすると例外が飛ぶこと。 +// * @throws Exception +// */ +// @Test +// public void test06_不適切なモデルをappendしようとすると例外が飛ぶこと() throws Exception { +// DataType dataType = new IntegerDataTypeMock(); +// ColumnModel column = rootModel.createJiemamyModel(ColumnModel.class).init("a", dataType); +// try { +// rootModel.appendModel(column); +// fail(); +// } catch (CannotAppendException e) { +// assertThat(e.getParent(), is((JiemamyModel) rootModel)); +// assertThat(e.getChild(), is((JiemamyModel) column)); +// } +// try { +// rootModel.appendModel(dataType); +// fail(); +// } catch (CannotAppendException e) { +// assertThat(e.getParent(), is((JiemamyModel) rootModel)); +// assertThat(e.getChild(), is((JiemamyModel) dataType)); +// } +// } /** * RootModelからのクローニングが適切に行われること。 * @throws Exception */ @Test + @Ignore("not implemented") public void test07_RootModelからのクローニングが適切に行われること() throws Exception { DomainModel domain1 = rootModel.createJiemamyModel(DomainModel.class).init("domain1", new IntegerDataTypeMock()); @@ -265,6 +261,7 @@ * @throws Exception */ @Test + @Ignore("not implemented") public void test09_外部キーのクローニングが適切に行われること() throws Exception { TableModel source = rootModel.createJiemamyModel(TableModel.class).init("table"); TableModel target = rootModel.createJiemamyModel(TableModel.class).init("table2"); Modified: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/node/TableModelImplTest.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/node/TableModelImplTest.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/node/TableModelImplTest.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -34,15 +34,12 @@ import org.jiemamy.core.model.EmptyProxyModel; import org.jiemamy.core.model.typedef.datatype.impl.IntegerDataTypeMock; import org.jiemamy.spec.JiemamyModelFactory; -import org.jiemamy.spec.exception.CannotAppendException; import org.jiemamy.spec.exception.CannotRemoveException; -import org.jiemamy.spec.exception.NotInitializedException; import org.jiemamy.spec.model.ColumnModel; import org.jiemamy.spec.model.JiemamyModel; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.connection.ForeignKeyModel; import org.jiemamy.spec.model.constraint.CheckConstraintModel; -import org.jiemamy.spec.model.datatype.DataType; import org.jiemamy.spec.model.index.IndexModel; import org.jiemamy.spec.model.node.TableModel; @@ -196,7 +193,7 @@ try { tableModel.appendModel(rootModel.createJiemamyModel(ColumnModel.class)); fail(); - } catch (NotInitializedException e) { + } catch (IllegalArgumentException e) { // success } } @@ -206,9 +203,8 @@ * @throws Exception */ @Test - @Ignore + @Ignore("現在この仕様は実装されていない。実装すべきか否か") public void test05_未追加のモデルをremoveしようとすると例外が飛ぶこと() throws Exception { - // THINK 現在この仕様は実装されていない。実装すべきか否か。 ColumnModel column = rootModel.createJiemamyModel(ColumnModel.class).init("col1", new IntegerDataTypeMock()); try { tableModel.removeModel(column); @@ -219,35 +215,36 @@ } } - /** - * 不適切なモデルをappendしようとすると例外が飛ぶこと。 - * @throws Exception - */ - @Test - public void test06_不適切なモデルをappendしようとすると例外が飛ぶこと() throws Exception { - DataType dataType = new IntegerDataTypeMock(); - TableModel table = rootModel.createJiemamyModel(TableModel.class).init(rootModel); - try { - tableModel.appendModel(table); - fail(); - } catch (CannotAppendException e) { - assertThat(e.getParent(), is((JiemamyModel) tableModel)); - assertThat(e.getChild(), is((JiemamyModel) table)); - } - try { - tableModel.appendModel(dataType); - fail(); - } catch (CannotAppendException e) { - assertThat(e.getParent(), is((JiemamyModel) tableModel)); - assertThat(e.getChild(), is((JiemamyModel) dataType)); - } - } +// /** +// * 不適切なモデルをappendしようとすると例外が飛ぶこと。 +// * @throws Exception +// */ +// @Test +// public void test06_不適切なモデルをappendしようとすると例外が飛ぶこと() throws Exception { +// DataType dataType = new IntegerDataTypeMock(); +// TableModel table = rootModel.createJiemamyModel(TableModel.class).init(rootModel); +// try { +// tableModel.appendModel(table); +// fail(); +// } catch (CannotAppendException e) { +// assertThat(e.getParent(), is((JiemamyModel) tableModel)); +// assertThat(e.getChild(), is((JiemamyModel) table)); +// } +// try { +// tableModel.appendModel(dataType); +// fail(); +// } catch (CannotAppendException e) { +// assertThat(e.getParent(), is((JiemamyModel) tableModel)); +// assertThat(e.getChild(), is((JiemamyModel) dataType)); +// } +// } /** * TableModelからのクローニングが適切に行われること。 * @throws Exception */ @Test + @Ignore("not implemented") public void test07_TableModelからのクローニングが適切に行われること() throws Exception { ColumnModel column1 = rootModel.createJiemamyModel(ColumnModel.class).init("column1", new IntegerDataTypeMock()); @@ -289,6 +286,7 @@ * @throws Exception */ @Test + @Ignore("not implemented") public void test08_RootModelからのクローニングが適切に行われること() throws Exception { ColumnModel column1 = rootModel.createJiemamyModel(ColumnModel.class).init("column1", new IntegerDataTypeMock()); Modified: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/ValueCheckUtilTest.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/ValueCheckUtilTest.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/ValueCheckUtilTest.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -24,7 +24,6 @@ import org.jiemamy.core.S2FactoryStrategy; import org.jiemamy.spec.JiemamyModelFactory; -import org.jiemamy.spec.exception.NotInitializedException; import org.jiemamy.spec.model.RootModel; /** @@ -45,7 +44,7 @@ try { ValueCheckUtil.assertInitialized(rootModel); fail(); - } catch (NotInitializedException e) { + } catch (IllegalArgumentException e) { // success } rootModel.init(); Modified: artemis/trunk/org.jiemamy.event/.project =================================================================== --- artemis/trunk/org.jiemamy.event/.project 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.event/.project 2008-11-26 15:41:10 UTC (rev 2188) @@ -30,12 +30,23 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>org.seasar.kijimuna.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.seasar.kijimuna.core.validator</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature> <nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> + <nature>org.seasar.kijimuna.core.nature</nature> </natures> <linkedResources> <link> Modified: artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableList.java =================================================================== --- artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableList.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableList.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -65,7 +65,7 @@ * Listの実装を指定しない場合は{@link java.util.ArrayList}を使用する。 * @category instance creation */ - public ObservableList() { + ObservableList() { this(new ArrayList<T>()); } Modified: artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableSet.java =================================================================== --- artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableSet.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/collectionimpl/ObservableSet.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -67,7 +67,7 @@ * Setの実装を指定しない場合は{@link HashSet}を使用する。 * @category instance creation */ - public ObservableSet() { + ObservableSet() { this(new HashSet<T>()); } Modified: artemis/trunk/org.jiemamy.event/src/main/resources/jiemamy-event.dicon =================================================================== --- artemis/trunk/org.jiemamy.event/src/main/resources/jiemamy-event.dicon 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.event/src/main/resources/jiemamy-event.dicon 2008-11-26 15:41:10 UTC (rev 2188) @@ -5,9 +5,22 @@ <include path="jiemamy-core.dicon"/> - <component name="list" class="org.jiemamy.event.collectionimpl.ObservableList" instance="prototype"/> - <component name="set" class="org.jiemamy.event.collectionimpl.ObservableSet" instance="prototype"/> - <component name="map" class="org.jiemamy.event.collectionimpl.ObservableMap" instance="prototype"/> + <component name="list" instance="prototype"> + @org.jiemamy.event.collectionimpl.ObservableList @ decorate( + @org.apache.commons.collections15.list.PredicatedList @ decorate(new java.util.ArrayList(), predicate) + ) + </component> + <component name="set" instance="prototype"> + @org.jiemamy.event.collectionimpl.ObservableSet @ decorate( + @org.apache.commons.collections15.set.PredicatedSet @ decorate(new java.util.HashSet(), predicate) + ) + </component> + <component name="map" instance="prototype"> + @org.jiemamy.event.collectionimpl.ObservableMap @ decorate( + @org.apache.commons.collections15.map.PredicatedMap @ decorate(new java.util.HashMap(), + @org.apache.commons.collections15.functors.TruePredicate @ INSTANCE, predicate) + ) + </component> <component name="observableImpl" class="org.jiemamy.event.ObservableImpl" instance="prototype"/> @@ -18,18 +31,6 @@ <initMethod name="registerAdapter"> <arg>observableImpl</arg> </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.NodeAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.ConnectionAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.DomainAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.InsertDataSetsAppender" /></arg> - </initMethod> <initMethod> #self.registerAdapter(new org.jiemamy.event.model.RootModelChangeSupportImpl(#self)) </initMethod> @@ -40,15 +41,6 @@ <initMethod name="registerAdapter"> <arg>observableImpl</arg> </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.ColumnAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.CheckConstraintAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.IndexAppender" /></arg> - </initMethod> <initMethod> #self.registerAdapter(new org.jiemamy.event.model.node.TableModelChangeSupportImpl(#self)) </initMethod> 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-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/element/RootXmlElement.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -60,8 +60,9 @@ queue.add(new CollectionXmlElement("connections", rootModel.getConnections())); queue.add(new CollectionXmlElement("insertDataSetModels", rootModel.getInsertDataSets())); if (rootModel.hasAdapter(DiagramPresentations.class)) { - queue.add(new CollectionXmlElement("view:diagramPresentations", rootModel - .getAdapter(DiagramPresentations.class))); + // TODO DiagramPresentationsXmlElementを作る + queue + .add(new XmlElement("view:diagramPresentations", rootModel.getAdapter(DiagramPresentations.class))); } } } Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/sax/ForeignKeyCommand.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/sax/ForeignKeyCommand.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/sax/ForeignKeyCommand.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -18,10 +18,10 @@ */ package org.jiemamy.serializer.sax; +import org.apache.commons.lang.StringUtils; import org.xml.sax.Attributes; import org.jiemamy.spec.JiemamyModelFactory; -import org.jiemamy.spec.model.JiemamyModel; import org.jiemamy.spec.model.connection.ForeignKeyModel; import org.jiemamy.spec.model.connection.ForeignKeyModel.InitiallyCheckTime; import org.jiemamy.spec.model.connection.ForeignKeyModel.ReferentialAction; @@ -58,21 +58,21 @@ } else if (elementName.equals("logicalName")) { foreignKeyModel.setLogicalName(text); } else if (elementName.equals("onDelete")) { - ReferentialAction value = valueOf(ReferentialAction.class, text); - if (value != null) { + if (StringUtils.isEmpty(text) == false) { + ReferentialAction value = ReferentialAction.valueOf(text); foreignKeyModel.setOnDelete(value); } } else if (elementName.equals("onUpdate")) { - ReferentialAction value = valueOf(ReferentialAction.class, text); - if (value != null) { + if (StringUtils.isEmpty(text) == false) { + ReferentialAction value = ReferentialAction.valueOf(text); foreignKeyModel.setOnUpdate(value); } } else if (elementName.equals("deferrable")) { foreignKeyModel.setDeferrable(Boolean.valueOf(text)); } else if (elementName.equals("initiallyCheckTime")) { - InitiallyCheckTime value = valueOf(InitiallyCheckTime.class, text); - if (value != null) { - foreignKeyModel.setInitiallyCheckTime(InitiallyCheckTime.valueOf(text)); + if (StringUtils.isEmpty(text) == false) { + InitiallyCheckTime value = InitiallyCheckTime.valueOf(text); + foreignKeyModel.setInitiallyCheckTime(value); } } else if (elementName.equals("description")) { foreignKeyModel.setDescription(text); @@ -113,10 +113,10 @@ } if (elementName.equals("source")) { - AbstractNodeModel source = getReferenceModel(attributes); + AbstractNodeModel source = (AbstractNodeModel) getReferenceModel(attributes); foreignKeyModel.setSource(source); } else if (elementName.equals("target")) { - AbstractNodeModel source = getReferenceModel(attributes); + AbstractNodeModel source = (AbstractNodeModel) getReferenceModel(attributes); foreignKeyModel.setTarget(source); } @@ -127,7 +127,7 @@ * {@inheritDoc} */ @Override - protected JiemamyModel getTargetModel(ModelInfo model) { + protected Object getTargetModel(ModelInfo model) { return model.getForeignKeyModel(); } Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/sax/JiemamyModelCommand.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/sax/JiemamyModelCommand.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/serializer/sax/JiemamyModelCommand.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -24,7 +24,11 @@ import org.jiemamy.core.accessor.JiemamyModelAccessor; import org.jiemamy.core.model.ModelIdManager; +import org.jiemamy.spec.model.DomainModel; import org.jiemamy.spec.model.JiemamyModel; +import org.jiemamy.spec.model.RootModel; +import org.jiemamy.spec.model.connection.AbstractConnectionModel; +import org.jiemamy.spec.model.node.AbstractNodeModel; /** * IDを持つJiemamyModelのXmlElementCommand。 @@ -37,7 +41,15 @@ */ @Override public void end(ModelInfo model, XmlElement element, String text) { - model.getRootModel().appendModel(getTargetModel(model)); + Object child = getTargetModel(model); + RootModel rootModel = model.getRootModel(); + if (child instanceof DomainModel) { + rootModel.appendModel((DomainModel) child); + } else if (child instanceof AbstractConnectionModel) { + rootModel.appendModel((AbstractConnectionModel) child); + } else if (child instanceof AbstractNodeModel) { + rootModel.appendModel((AbstractNodeModel) child); + } } /** @@ -72,7 +84,7 @@ * @param model Model情報 * @return JiemamyModel */ - protected abstract JiemamyModel getTargetModel(ModelInfo model); + protected abstract Object getTargetModel(ModelInfo model); /** * 属性があるかどうか。 @@ -84,25 +96,4 @@ return attributes.getValue(name) != null; } - /** - * enumの値を取得する。 - * - * <p>適合するenum値がなかった場合、nullを返す。</p> - * - * @param <T> enumの型 - * @param enumType enumクラス - * @param name Enumの文字 - * @return enum - */ - @SuppressWarnings("cast") - protected <T extends Enum<T>>T valueOf(Class<T> enumType, String name) { - try { - return Enum.valueOf(enumType, name); - } catch (IllegalArgumentException ignore) { - // ignore - } - - return (T) null; - } - } Modified: artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ApplicationModelCreator.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ApplicationModelCreator.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ApplicationModelCreator.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -1,6 +1,5 @@ package org.jiemamy.serializer; - import java.io.File; import java.net.URL; import java.net.URLClassLoader; @@ -137,14 +136,14 @@ bendpoints.add(1, new JmPoint(rect.x, Math.max(rect.y - offset, 0))); presentation.getConnectionLayouts().put(fkEmpEmp, bendpoints); presentation.getConnectionLayouts().put(fkEmpDept, new ArrayList<JmPoint>()); // bendpount無し - rootModel.getAdapter(DiagramPresentations.class).add(presentation); + rootModel.getAdapter(DiagramPresentations.class).appendModel(presentation); // ダイアグラム表現の生成・追加(2) presentation = rootModel.createJiemamyModel(DiagramPresentationModel.class).init("一部表示する"); presentation.getNodeLayouts().put(empTable, new JmRectangle(60, 60)); presentation.getNodeLayouts().put(highSalView, new JmRectangle(270, 270)); presentation.getConnectionLayouts().put(fkEmpDept, new ArrayList<JmPoint>()); // bendpount無し - rootModel.getAdapter(DiagramPresentations.class).add(presentation); + rootModel.getAdapter(DiagramPresentations.class).appendModel(presentation); // データセットの生成・追加(1) InsertDataSetModel dataSetEn = rootModel.createJiemamyModel(InsertDataSetModel.class).init("データ群en"); Modified: artemis/trunk/org.jiemamy.view/.project =================================================================== --- artemis/trunk/org.jiemamy.view/.project 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.view/.project 2008-11-26 15:41:10 UTC (rev 2188) @@ -30,12 +30,23 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>org.seasar.kijimuna.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.seasar.kijimuna.core.validator</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature> <nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> + <nature>org.seasar.kijimuna.core.nature</nature> </natures> <linkedResources> <link> Deleted: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationModelAppender.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationModelAppender.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationModelAppender.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -1,46 +0,0 @@ -/* - * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. - * Created on 2008/10/02 - * - * 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.view; - -import org.jiemamy.core.appender.JiemamyModelAppender; -import org.jiemamy.spec.model.RootModel; -import org.jiemamy.spec.view.model.DiagramPresentationModel; -import org.jiemamy.spec.view.model.DiagramPresentations; - -/** - * {@link RootModel} に対して {@link DiagramPresentationModel}を追加/削除するアペンダ。 - * @author daisuke - */ -public class DiagramPresentationModelAppender implements JiemamyModelAppender<RootModel, DiagramPresentationModel> { - - /** - * {@inheritDoc} - */ - public void append(RootModel rootModel, DiagramPresentationModel diagramPresentationModel) { - rootModel.getAdapter(DiagramPresentations.class).add(diagramPresentationModel); - } - - /** - * {@inheritDoc} - */ - public void remove(RootModel rootModel, DiagramPresentationModel diagramPresentationModel) { - rootModel.getAdapter(DiagramPresentations.class).remove(diagramPresentationModel); - } - -} Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -18,13 +18,14 @@ */ package org.jiemamy.view; -import java.util.Collection; import java.util.Iterator; import java.util.List; -import java.util.ListIterator; +import org.apache.commons.collections15.iterators.UnmodifiableIterator; +import org.apache.commons.lang.Validate; import org.seasar.framework.container.annotation.tiger.Binding; +import org.jiemamy.core.utils.ValueCheckUtil; import org.jiemamy.spec.view.model.DiagramPresentationModel; import org.jiemamy.spec.view.model.DiagramPresentations; @@ -41,55 +42,15 @@ /** * {@inheritDoc} */ - public boolean add(DiagramPresentationModel o) { - return composite.add(o); + public void appendModel(DiagramPresentationModel presentation) { + Validate.notNull(presentation); + ValueCheckUtil.assertInitialized(presentation); + composite.add(presentation); } /** * {@inheritDoc} */ - public void add(int index, DiagramPresentationModel element) { - composite.add(index, element); - } - - /** - * {@inheritDoc} - */ - public boolean addAll(Collection<? extends DiagramPresentationModel> c) { - return composite.addAll(c); - } - - /** - * {@inheritDoc} - */ - public boolean addAll(int index, Collection<? extends DiagramPresentationModel> c) { - return composite.addAll(index, c); - } - - /** - * {@inheritDoc} - */ - public void clear() { - composite.clear(); - } - - /** - * {@inheritDoc} - */ - public boolean contains(Object o) { - return composite.contains(o); - } - - /** - * {@inheritDoc} - */ - public boolean containsAll(Collection<?> c) { - return composite.containsAll(c); - } - - /** - * {@inheritDoc} - */ public DiagramPresentationModel get(int index) { return composite.get(index); } @@ -97,106 +58,24 @@ /** * {@inheritDoc} */ - public int indexOf(Object o) { - return composite.indexOf(o); - } - - /** - * {@inheritDoc} - */ - public boolean isEmpty() { - return composite.isEmpty(); - } - - /** - * {@inheritDoc} - */ public Iterator<DiagramPresentationModel> iterator() { - return composite.iterator(); + return UnmodifiableIterator.decorate(composite.iterator()); } /** * {@inheritDoc} */ - public int lastIndexOf(Object o) { - return composite.lastIndexOf(o); + public void removeModel(DiagramPresentationModel presentation) { + Validate.notNull(presentation); + ValueCheckUtil.assertInitialized(presentation); + composite.remove(presentation); } /** * {@inheritDoc} */ - public ListIterator<DiagramPresentationModel> listIterator() { - return composite.listIterator(); - } - - /** - * {@inheritDoc} - */ - public ListIterator<DiagramPresentationModel> listIterator(int index) { - return composite.listIterator(index); - } - - /** - * {@inheritDoc} - */ - public DiagramPresentationModel remove(int index) { - return composite.remove(index); - } - - /** - * {@inheritDoc} - */ - public boolean remove(Object o) { - return composite.remove(o); - } - - /** - * {@inheritDoc} - */ - public boolean removeAll(Collection<?> c) { - return composite.removeAll(c); - } - - /** - * {@inheritDoc} - */ - public boolean retainAll(Collection<?> c) { - return composite.retainAll(c); - } - - /** - * {@inheritDoc} - */ - public DiagramPresentationModel set(int index, DiagramPresentationModel element) { - return composite.set(index, element); - } - - /** - * {@inheritDoc} - */ public int size() { return composite.size(); } - /** - * {@inheritDoc} - */ - public List<DiagramPresentationModel> subList(int fromIndex, int toIndex) { - return composite.subList(fromIndex, toIndex); - } - - /** - * {@inheritDoc} - */ - public Object[] toArray() { - return composite.toArray(); - } - - /** - * {@inheritDoc} - */ - public <T>T[] toArray(T[] a) { - return composite.toArray(a); - } - } Modified: artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon 2008-11-26 15:41:10 UTC (rev 2188) @@ -9,21 +9,6 @@ <initMethod name="registerAdapter"> <arg><component class="org.jiemamy.view.DiagramPresentationsImpl" instance="prototype"/></arg> </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.NodeAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.ConnectionAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.DomainAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.InsertDataSetsAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.view.DiagramPresentationModelAppender" /></arg> - </initMethod> </component> <component class="org.jiemamy.view.DiagramPresentationModelImpl" instance="prototype" autoBinding="none"/> Modified: artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/DiagramPresentationModelImplTest.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/DiagramPresentationModelImplTest.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/DiagramPresentationModelImplTest.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -30,6 +30,7 @@ import org.jiemamy.spec.JiemamyModelFactory; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.view.model.DiagramPresentationModel; +import org.jiemamy.spec.view.model.DiagramPresentations; /** * {@link DiagramPresentationModelImpl}のテストクラス。 @@ -51,7 +52,7 @@ JiemamyModelFactory.init(new S2FactoryStrategy("jiemamy-view.dicon")); rootModel = JiemamyModelFactory.createRoot().init(); presentation = rootModel.createJiemamyModel(DiagramPresentationModel.class).init("testPresentation"); - rootModel.appendModel(presentation); + rootModel.getAdapter(DiagramPresentations.class).appendModel(presentation); } /** @@ -60,7 +61,7 @@ */ @After public void tearDown() throws Exception { - rootModel.removeModel(presentation); + rootModel.getAdapter(DiagramPresentations.class).removeModel(presentation); presentation = null; rootModel = null; } Modified: artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetColorProcessorTest.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetColorProcessorTest.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetColorProcessorTest.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -56,7 +56,7 @@ rootModel = JiemamyModelFactory.createRoot().init(); DiagramPresentationModel presentation = rootModel.createJiemamyModel(DiagramPresentationModel.class).init("テスト"); - rootModel.appendModel(presentation); + rootModel.getAdapter(DiagramPresentations.class).appendModel(presentation); TableModel table = rootModel.createJiemamyModel(TableModel.class).init("T_TEST"); rootModel.appendModel(table); Modified: artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetConstraintProcessorTest.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetConstraintProcessorTest.java 2008-11-21 11:03:14 UTC (rev 2187) +++ artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/utils/processor/SetConstraintProcessorTest.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -56,7 +56,7 @@ rootModel = JiemamyModelFactory.createRoot().init(); DiagramPresentationModel presentation = rootModel.createJiemamyModel(DiagramPresentationModel.class).init("テスト"); - rootModel.appendModel(presentation); + rootModel.getAdapter(DiagramPresentations.class).appendModel(presentation); TableModel table = rootModel.createJiemamyModel(TableModel.class).init("T_TEST"); rootModel.appendModel(table); Modified: vesta/trunk/org.jiemamy.eclipse/.classpath =================================================================== --- vesta/trunk/org.jiemamy.eclipse/.classpath 2008-11-21 11:03:14 UTC (rev 2187) +++ vesta/trunk/org.jiemamy.eclipse/.classpath 2008-11-26 15:41:10 UTC (rev 2188) @@ -8,6 +8,9 @@ <classpathentry kind="lib" path="lib/junit-addons-1.4.jar" sourcepath="lib/sources/junit-addons-1.4-sources.jar"/> <classpathentry kind="lib" path="lib/xercesImpl-2.6.2.jar" sourcepath="lib/sources/xercesImpl-2.6.2-sources.jar"/> <classpathentry kind="lib" path="lib/xmlParserAPIs-2.6.2.jar" sourcepath="lib/sources/xmlParserAPIs-2.6.2-sources.jar"/> + <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.5.5.jar"/> + <classpathentry exported="true" kind="lib" path="lib/logback-classic-0.9.9.jar"/> + <classpathentry exported="true" kind="lib" path="lib/logback-core-0.9.9.jar"/> <classpathentry exported="true" kind="lib" path="lib/eclipse-common-0.0.4.jar"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> Modified: vesta/trunk/org.jiemamy.eclipse/META-INF/MANIFEST.MF =================================================================== --- vesta/trunk/org.jiemamy.eclipse/META-INF/MANIFEST.MF 2008-11-21 11:03:14 UTC (rev 2187) +++ vesta/trunk/org.jiemamy.eclipse/META-INF/MANIFEST.MF 2008-11-26 15:41:10 UTC (rev 2188) @@ -8,7 +8,10 @@ lib/xercesImpl-2.6.2.jar, lib/junit-addons-1.4.jar, lib/junit-4.4.jar, - lib/eclipse-common-0.0.4.jar + lib/eclipse-common-0.0.4.jar, + lib/jcl-over-slf4j-1.5.5.jar, + lib/logback-classic-0.9.9.jar, + lib/logback-core-0.9.9.jar Bundle-Activator: org.jiemamy.eclipse.JiemamyPlugin Bundle-Vendor: Jiemamy Project Require-Bundle: org.eclipse.core.runtime, Modified: vesta/trunk/org.jiemamy.eclipse/build.properties =================================================================== --- vesta/trunk/org.jiemamy.eclipse/build.properties 2008-11-21 11:03:14 UTC (rev 2187) +++ vesta/trunk/org.jiemamy.eclipse/build.properties 2008-11-26 15:41:10 UTC (rev 2188) @@ -11,7 +11,10 @@ plugin_ja.properties,\ lib/eclipse-common-0.0.4.jar,\ schema/,\ - LICENSE.txt + LICENSE.txt,\ + lib/logback-classic-0.9.9.jar,\ + lib/logback-core-0.9.9.jar,\ + lib/jcl-over-slf4j-1.5.5.jar output..=target/classes/ source..=src/main/java/,src/main/resources/,src/test/java/,src/test/resources/ bin.excludes=lib/sources/ Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditor.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditor.java 2008-11-21 11:03:14 UTC (rev 2187) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditor.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -461,7 +461,7 @@ if (rootModel.getAdapter(DiagramPresentations.class).size() == 0) { DiagramPresentationModel presentationModel = rootModel.createJiemamyModel(DiagramPresentationModel.class).init("default"); - rootModel.appendModel(presentationModel); + rootModel.getAdapter(DiagramPresentations.class).appendModel(presentationModel); } } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/MultiDiagramEditor.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/MultiDiagramEditor.java 2008-11-21 11:03:14 UTC (rev 2187) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/MultiDiagramEditor.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -184,7 +184,7 @@ if (rootModel.getAdapter(DiagramPresentations.class).size() == 0) { DiagramPresentationModel presentationModel = rootModel.createJiemamyModel(DiagramPresentationModel.class).init("default"); - rootModel.appendModel(presentationModel); + rootModel.getAdapter(DiagramPresentations.class).appendModel(presentationModel); } } setPartName(input.getName()); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/resources/jiemamy-eclipse.dicon =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/resources/jiemamy-eclipse.dicon 2008-11-21 11:03:14 UTC (rev 2187) +++ vesta/trunk/org.jiemamy.eclipse/src/main/resources/jiemamy-eclipse.dicon 2008-11-26 15:41:10 UTC (rev 2188) @@ -6,9 +6,23 @@ <include path="jiemamy-core.dicon"/> <include path="jiemamy-dialect.dicon"/> - <component name="list" class="org.jiemamy.event.collectionimpl.ObservableList" instance="prototype"/> - <component name="set" class="org.jiemamy.event.collectionimpl.ObservableSet" instance="prototype"/> - <component name="map" class="org.jiemamy.event.collectionimpl.ObservableMap" instance="prototype"/> + <component name="predicate" class="org.jiemamy.core.utils.InitializePredicate" /> + <component name="list" instance="prototype"> + @org.jiemamy.event.collectionimpl.ObservableList @ decorate( + @org.apache.commons.collections15.list.PredicatedList @ decorate(new java.util.ArrayList(), predicate) + ) + </component> + <component name="set" instance="prototype"> + @org.jiemamy.event.collectionimpl.ObservableSet @ decorate( + @org.apache.commons.collections15.set.PredicatedSet @ decorate(new java.util.HashSet(), predicate) + ) + </component> + <component name="map" instance="prototype"> + @org.jiemamy.event.collectionimpl.ObservableMap @ decorate( + @org.apache.commons.collections15.map.PredicatedMap @ decorate(new java.util.HashMap(), + @org.apache.commons.collections15.functors.TruePredicate @ INSTANCE, predicate) + ) + </component> <component name="observableImpl" class="org.jiemamy.event.ObservableImpl" instance="prototype"/> @@ -24,21 +38,6 @@ <initMethod name="registerAdapter"> <arg><component class="org.jiemamy.view.DiagramPresentationsImpl"/></arg> </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.NodeAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.ConnectionAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.DomainAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.InsertDataSetsAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.view.DiagramPresentationModelAppender" /></arg> - </initMethod> <initMethod> #self.registerAdapter(new org.jiemamy.event.model.RootModelChangeSupportImpl(#self)) </initMethod> @@ -49,15 +48,6 @@ <initMethod name="registerAdapter"> <arg>observableImpl</arg> </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.ColumnAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.CheckConstraintAppender" /></arg> - </initMethod> - <initMethod name="registerAppender"> - <arg><component class="org.jiemamy.core.appender.IndexAppender" /></arg> - </initMethod> <initMethod> #self.registerAdapter(new org.jiemamy.event.model.node.TableModelChangeSupportImpl(#self)) </initMethod> Added: vesta/trunk/org.jiemamy.eclipse/src/main/resources/logback.xml =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/resources/logback.xml (rev 0) +++ vesta/trunk/org.jiemamy.eclipse/src/main/resources/logback.xml 2008-11-26 15:41:10 UTC (rev 2188) @@ -0,0 +1,18 @@ +<configuration> + <appender name="STDOUT" + class="ch.qos.logback.core.ConsoleAppender"> + <Target>System.out</Target> + <layout class="ch.qos.logback.classic.PatternLayout"> + <Pattern>%d{HH:mm:ss,SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern> + </layout> + </appender> + + <logger name="org.jiemamy"> + <level value="DEBUG" /> + </logger> + + <root> + <level value="INFO" /> + <appender-ref ref="STDOUT" /> + </root> +</configuration> Property changes on: vesta/trunk/org.jiemamy.eclipse/src/main/resources/logback.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/JiemamyModelFactory.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/JiemamyModelFactory.java 2008-11-21 11:03:14 UTC (rev 2187) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/JiemamyModelFactory.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -18,8 +18,6 @@ */ package org.jiemamy.spec; -import org.jiemamy.spec.exception.JiemamyRuntimeException; -import org.jiemamy.spec.exception.NotInitializedException; import org.jiemamy.spec.model.RootModel; /** @@ -52,7 +50,7 @@ */ public static <T>T create(RootModel rootModel, Class<T> clazz) { if (singleton == null) { - throw new JiemamyRuntimeException("モデル生成を行う前に、init()が必要です。"); + throw new IllegalStateException("Factory is not initialized"); } return singleton.strategy.create(clazz); } @@ -71,7 +69,7 @@ */ public static FactoryStrategy getStrategy() { if (singleton == null) { - throw new NotInitializedException(null); + throw new IllegalStateException("Factory is not initialized"); } return singleton.strategy; } Deleted: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/NotInitializedException.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/NotInitializedException.java 2008-11-21 11:03:14 UTC (rev 2187) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/NotInitializedException.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -1,51 +0,0 @@ -/* - * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. - * Created on 2008/11/10 - * - * 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.spec.exception; - -import org.jiemamy.spec.model.JiemamyModel; - -/** - * 未初期化のモデルを他モデルの子として追加しようとした時にスローされる。 - * @author daisuke - */ - @ SuppressWarnings("serial") -public class NotInitializedException extends JiemamyRuntimeException { - - /** 初期化され忘れているモデル */ - private JiemamyModel jiemamyModel; - - - /** - * コンストラクタ。 - * @param jiemamyModel - * @category instance creation - */ - public NotInitializedException(JiemamyModel jiemamyModel) { - this.jiemamyModel = jiemamyModel; - } - - /** - * 初期化され忘れているモデルを取得する。 - * @return 初期化され忘れているモデル - */ - public JiemamyModel getJiemamyModel() { - return jiemamyModel; - } - -} Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/TooManyElementsException.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/TooManyElementsException.java 2008-11-21 11:03:14 UTC (rev 2187) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/exception/TooManyElementsException.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -24,6 +24,9 @@ /** * 問い合わせの結果、同名の要素が複数存在する時スローされる例外。 + * + * THINK hasManyElement(String name)メソッド+ {@link IllegalStateException}を検討 + * * @author daisuke */ @SuppressWarnings("serial") Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/JiemamyModel.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/JiemamyModel.java 2008-11-21 11:03:14 UTC (rev 2187) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/JiemamyModel.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -23,8 +23,6 @@ import org.jiemamy.spec.Adaptable; import org.jiemamy.spec.Processor; -import org.jiemamy.spec.exception.CannotAppendException; -import org.jiemamy.spec.exception.CannotRemoveException; /** * Jiemamyが扱う、ユーザが定義するDB設計に関わるデータ(モデル)インターフェイス。 @@ -36,22 +34,6 @@ public interface JiemamyModel extends Serializable, Adaptable, Cloneable { /** - * このモデルに従属するモデルを子モデルとして追加する。 - * - * <p>与えられた {@link JiemamyModel} が、この {@link RootModel} インスタンスから生成( - * {@link RootModel#createJiemamyModel(Class)})されたものでない場合、 {@link CannotAppendException} を - * スローしてもよい(MAY)。</p> - * - * <p>与えられたもでるが、このモデルの子として有効ではない等の理由で、追加が行われなかった場合、 {@link CannotAppendException} - * または {@link UnsupportedOperationException} をスローすべきである(SHOULD)。</p> - * - * <p>引数として <code>null</code> を与えた場合、 {@link NullPointerException} をスローすべきである(SHOULD)。</p> - * - * @param jiemamyModel 子モデル - */ - void appendModel(JiemamyModel jiemamyModel); - - /** * TODO for daisuke * @param <T> * @return クローニングされたモデルのインスタンス @@ -99,13 +81,4 @@ */ <R, T extends JiemamyModel, E extends Exception>R process(Processor<T, R, E> processor) throws E; - /** - * このモデルから、従属するモデルを削除する。 - * - * <p>与えられたもでるが、このモデルの子として有効ではない等の理由で、削除が行われなかった場合、 {@link CannotRemoveException} - * または {@link UnsupportedOperationException} をスローすべきである(SHOULD)。</p> - * - * @param jiemamyModel 子モデル - */ - void removeModel(JiemamyModel jiemamyModel); } Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/RootModel.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/RootModel.java 2008-11-21 11:03:14 UTC (rev 2187) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/RootModel.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -39,6 +39,14 @@ */ public interface RootModel extends JiemamyModel { + void appendModel(AbstractConnectionModel connection); + + void appendModel(AbstractNodeModel node); + + void appendModel(DomainModel domain); + + void appendModel(InsertDataSetModel insertDataSet); + /** * 新規に、この {@link RootModel}に従属しうるモデルインスタンスを生成する。 * @@ -165,6 +173,14 @@ */ void provideValidName(ForeignKeyModel relationModel, IdentifierValidator validator); + void removeModel(AbstractConnectionModel connection); + + void removeModel(AbstractNodeModel node); + + void removeModel(DomainModel domain); + + void removeModel(InsertDataSetModel insertDataSet); + /** * 開始スクリプトを設定する。 * @param beginScript 開始スクリプト Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java 2008-11-21 11:03:14 UTC (rev 2187) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -33,6 +33,12 @@ */ public interface TableModel extends AbstractEntityModel { + void appendModel(CheckConstraintModel check); + + void appendModel(ColumnModel column); + + void appendModel(IndexModel index); + /** * テーブルCHECK制約のリストを取得する。 * @return テーブルCHECK制約のリスト @@ -80,4 +86,10 @@ */ TableModel init(String tableName); + void removeModel(CheckConstraintModel check); + + void removeModel(ColumnModel column); + + void removeModel(IndexModel index); + } Modified: zeus/trunk/org.jiemamy.spec.view/src/main/java/org/jiemamy/spec/view/model/DiagramPresentations.java =================================================================== --- zeus/trunk/org.jiemamy.spec.view/src/main/java/org/jiemamy/spec/view/model/DiagramPresentations.java 2008-11-21 11:03:14 UTC (rev 2187) +++ zeus/trunk/org.jiemamy.spec.view/src/main/java/org/jiemamy/spec/view/model/DiagramPresentations.java 2008-11-26 15:41:10 UTC (rev 2188) @@ -18,13 +18,35 @@ */ package org.jiemamy.spec.view.model; -import java.util.List; - - /** * ダイアグラム表現の集合を表すモデルインターフェイス。 * @author daisuke */ -public interface DiagramPresentations extends List<DiagramPresentationModel> { +public interface DiagramPresentations extends Iterable<DiagramPresentationModel> { + /** + * TODO for daisuke + * @param presentation + */ + void appendModel(DiagramPresentationModel presentation); + + /** + * TODO for daisuke + * @param diagramIndex + * @return + */ + DiagramPresentationModel get(int diagramIndex); + + /** + * TODO for daisuke + * @param presentation + */ + void removeModel(DiagramPresentationModel presentation); + + /** + * TODO for daisuke + * @return + */ + int size(); + }