svnno****@sourc*****
svnno****@sourc*****
2008年 10月 5日 (日) 08:46:20 JST
Revision: 1994 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=1994 Author: daisuke_m Date: 2008-10-05 08:46:20 +0900 (Sun, 05 Oct 2008) Log Message: ----------- package構成refactor Modified Paths: -------------- artemis/trunk/org.jiemamy.composer/META-INF/MANIFEST.MF artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/exporter/SqlExporterTest.java artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java Added Paths: ----------- artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/exporter/ExportContextImpl.java artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/importer/ImportContextImpl.java Removed Paths: ------------- artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/core/ -------------- next part -------------- Modified: artemis/trunk/org.jiemamy.composer/META-INF/MANIFEST.MF =================================================================== --- artemis/trunk/org.jiemamy.composer/META-INF/MANIFEST.MF 2008-10-04 23:44:20 UTC (rev 1993) +++ artemis/trunk/org.jiemamy.composer/META-INF/MANIFEST.MF 2008-10-04 23:46:20 UTC (rev 1994) @@ -7,7 +7,7 @@ lib/freemarker-2.3.11.jar Bundle-Vendor: Jiemamy Project Export-Package: org.jiemamy.composer.exporter, - org.jiemamy.core.extension.composer + org.jiemamy.composer.importer Require-Bundle: org.jiemamy.serializer, org.jiemamy.dialect, org.jiemamy.spec.core, Copied: artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/exporter/ExportContextImpl.java (from rev 1988, artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/core/extension/composer/ExportContextImpl.java) =================================================================== --- artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/exporter/ExportContextImpl.java (rev 0) +++ artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/exporter/ExportContextImpl.java 2008-10-04 23:46:20 UTC (rev 1994) @@ -0,0 +1,44 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/07/12 + * + * 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.composer.exporter; + +import org.jiemamy.core.interpreter.AbstractContext; +import org.jiemamy.spec.extension.composer.ExportContext; + +/** + * エクスポートに関するコンテキスト情報。 + * @author daisuke + */ +public class ExportContextImpl extends AbstractContext implements ExportContext { + + /** + * {@inheritDoc} + */ + public <T>T getAdapter(Class<T> adapter) { + return null; + } + + /** + * {@inheritDoc} + */ + public boolean hasAdapter(Class<?> adapter) { + return false; + } + +} Copied: artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/importer/ImportContextImpl.java (from rev 1988, artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/core/extension/composer/ImportContextImpl.java) =================================================================== --- artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/importer/ImportContextImpl.java (rev 0) +++ artemis/trunk/org.jiemamy.composer/src/main/java/org/jiemamy/composer/importer/ImportContextImpl.java 2008-10-04 23:46:20 UTC (rev 1994) @@ -0,0 +1,61 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/07/12 + * + * 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.composer.importer; + +import org.jiemamy.core.extension.dialect.DatabaseReadingContext; +import org.jiemamy.core.interpreter.AbstractContext; +import org.jiemamy.spec.extension.composer.ImportContext; + +/** + * インポートに関するコンテキスト情報。 + * @author daisuke + */ +public class ImportContextImpl extends AbstractContext implements ImportContext { + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public <T>T getAdapter(Class<T> adapter) { + if (adapter == DatabaseReadingContext.class) { + DatabaseReadingContext instance = null; + try { + instance = (DatabaseReadingContext) adapter.newInstance(); + instance.setProperties(getProperties()); + } catch (InstantiationException ignore) { + // ignore: return null + } catch (IllegalAccessException ignore) { + // ignore: return null + } + return (T) instance; + } + return null; + } + + /** + * {@inheritDoc} + */ + public boolean hasAdapter(Class<?> adapter) { + if (DatabaseReadingContext.class.isAssignableFrom(adapter)) { + return true; + } + return false; + } + +} Modified: artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/exporter/SqlExporterTest.java =================================================================== --- artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/exporter/SqlExporterTest.java 2008-10-04 23:44:20 UTC (rev 1993) +++ artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/exporter/SqlExporterTest.java 2008-10-04 23:46:20 UTC (rev 1994) @@ -34,7 +34,6 @@ import org.seasar.framework.unit.Seasar2; import org.jiemamy.core.S2FactoryStrategy; -import org.jiemamy.core.extension.composer.ExportContextImpl; import org.jiemamy.creator.JiemamyModelFactory; import org.jiemamy.spec.extension.composer.ExportContext; import org.jiemamy.spec.extension.composer.Exporter; Modified: artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java =================================================================== --- artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java 2008-10-04 23:44:20 UTC (rev 1993) +++ artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java 2008-10-04 23:46:20 UTC (rev 1994) @@ -32,7 +32,6 @@ import org.seasar.framework.unit.Seasar2; import org.jiemamy.core.S2FactoryStrategy; -import org.jiemamy.core.extension.composer.ImportContextImpl; import org.jiemamy.creator.JiemamyModelFactory; import org.jiemamy.spec.extension.composer.ImportContext; import org.jiemamy.spec.extension.composer.Importer;