[Jiemamy-notify] commit [1916] 実装完了したが、一部手動で修正が必要なモジュールがあるっぽい?

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 9月 13日 (土) 04:37:22 JST


Revision: 1916
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=1916
Author:   shin1
Date:     2008-09-13 04:37:21 +0900 (Sat, 13 Sep 2008)

Log Message:
-----------
実装完了したが、一部手動で修正が必要なモジュールがあるっぽい?
元となるソース内で変数名とそのgetterの名称のずれがソースあるのか?調査が必要。

Modified Paths:
--------------
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/CollectionProperty.java
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/JiemamyModelDoclet.java
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeListener.vm
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeSupport.vm
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/ListenerTemplateTest.java

Added Paths:
-----------
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.classpath
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.project
    sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/CollectionPropertyTest.java


-------------- next part --------------
Added: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.classpath
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.classpath	                        (rev 0)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.classpath	2008-09-12 19:37:21 UTC (rev 1916)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/seasar/container/diigu-core/1.0.0/diigu-core-1.0.0.jar" sourcepath="M2_REPO/org/seasar/container/diigu-core/1.0.0/diigu-core-1.0.0-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar">
+		<attributes>
+			<attribute name="javadoc_location" value="jar:file:/Users/shin1/.m2/repository/junit/junit/4.4/junit-4.4-javadoc.jar!/"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="var" path="M2_REPO/oro/oro/2.0.8/oro-2.0.8.jar" sourcepath="M2_REPO/oro/oro/2.0.8/oro-2.0.8-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/velocity/velocity/1.5/velocity-1.5.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/org.jiemamy.core"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>


Property changes on: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.classpath
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.project
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.project	                        (rev 0)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.project	2008-09-12 19:37:21 UTC (rev 1916)
@@ -0,0 +1,13 @@
+<projectDescription>
+  <name>org.jiemamy.core.eventcodegen</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file


Property changes on: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/.project
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/CollectionProperty.java
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/CollectionProperty.java	2008-09-12 06:48:38 UTC (rev 1915)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/CollectionProperty.java	2008-09-12 19:37:21 UTC (rev 1916)
@@ -12,27 +12,62 @@
 	private String name;
 	private String nameUpper;
 	private String nameSingle;
-	private Class<?> collectionClass;
-	private Class<?> observableCollectionClass;
-	private Class<?> elementClass;
+	private String collectionClassName;
+	private String collectionClassSimpleName;
+	private String observableCollectionClassName;
+	private String observableCollectionClassSimpleName;
+	private String elementClassName;
+	private String elementClassSimpleName;
+	private String mapKeyClassName;
+	private String mapKeyClassSimpleName;
+	private boolean isMap = false;
 
-	public CollectionProperty(String name, Class<?> collectionClass,
-			Class<?> elementClass) {
+	public CollectionProperty(String name, String collectionClassName,
+			String elementClassName) {
 		this.name = name;
 		this.nameUpper = name.substring(0, 1).toUpperCase() + name.substring(1);
 		this.nameSingle = toSingle(name);
-		this.collectionClass = collectionClass;
-		this.elementClass = elementClass;
-		if (collectionClass.equals(List.class)) {
-			observableCollectionClass = ObservableList.class;
-		} else if (collectionClass.equals(Set.class)) {
-			observableCollectionClass = ObservableSet.class;
-		} else if (collectionClass.equals(Map.class)) {
-			observableCollectionClass = ObservableMap.class;
+		this.collectionClassName = collectionClassName;
+		this.collectionClassSimpleName = getSimpleName(collectionClassName);
+		this.elementClassName = elementClassName;
+		this.elementClassSimpleName = getSimpleName(elementClassName);
+		if (collectionClassName.equals(List.class.getName())
+				|| collectionClassName.equals(ObservableList.class.getName())) {
+			observableCollectionClassName = ObservableList.class.getName();
+			this.observableCollectionClassSimpleName = getSimpleName(observableCollectionClassName);
+		} else if (collectionClassName.equals(Set.class.getName())
+				|| collectionClassName.equals(ObservableSet.class.getName())) {
+			observableCollectionClassName = ObservableSet.class.getName();
+			this.observableCollectionClassSimpleName = getSimpleName(observableCollectionClassName);
+		} else if (collectionClassName.equals(Map.class.getName())
+				|| collectionClassName.equals(ObservableMap.class.getName())) {
+			observableCollectionClassName = ObservableMap.class.getName();
+			this.observableCollectionClassSimpleName = getSimpleName(observableCollectionClassName);
 		}
 	}
 
 	/**
+	 * クラス名の短い名称を返す。
+	 * 
+	 * @param name
+	 * @return
+	 */
+	static String getSimpleName(String name) {
+		String _name = name;
+		while (_name.matches("^[a-zA-Z]+\\..*")) {
+			_name = _name.replaceFirst("[a-zA-Z]+\\.", "");
+			System.out.println(_name);
+		}
+		_name = _name.replaceAll("java\\.lang\\.", "");
+		// String _name = name;
+		// while (_name.matches(".*[a-zA-Z]+\\..*")) {
+		// _name = _name.replaceFirst("[a-zA-Z]+\\.", "");
+		// System.out.println(_name);
+		// }
+		return _name;
+	}
+
+	/**
 	 * 複数形を単数系に変換する.
 	 * 
 	 * @param plural
@@ -46,14 +81,6 @@
 		}
 	}
 
-	public Class<?> getCollectionClass() {
-		return collectionClass;
-	}
-
-	public void setCollectionClass(Class<?> collectionClass) {
-		this.collectionClass = collectionClass;
-	}
-
 	public String getName() {
 		return name;
 	}
@@ -62,14 +89,6 @@
 		this.name = name;
 	}
 
-	public Class<?> getElementClass() {
-		return elementClass;
-	}
-
-	public void setElementClass(Class<?> elementClass) {
-		this.elementClass = elementClass;
-	}
-
 	public String getNameUpper() {
 		return nameUpper;
 	}
@@ -78,14 +97,6 @@
 		this.nameUpper = nameUpper;
 	}
 
-	public Class<?> getObservableCollectionClass() {
-		return observableCollectionClass;
-	}
-
-	public void setObservableCollectionClass(Class<?> observableCollectionClass) {
-		this.observableCollectionClass = observableCollectionClass;
-	}
-
 	public String getNameSingle() {
 		return nameSingle;
 	}
@@ -93,4 +104,81 @@
 	public void setNameSingle(String nameSingle) {
 		this.nameSingle = nameSingle;
 	}
+
+	public String getCollectionClassName() {
+		return collectionClassName;
+	}
+
+	public void setCollectionClassName(String collectionClassName) {
+		this.collectionClassName = collectionClassName;
+	}
+
+	public String getCollectionClassSimpleName() {
+		return collectionClassSimpleName;
+	}
+
+	public void setCollectionClassSimpleName(String collectionClassSimpleName) {
+		this.collectionClassSimpleName = collectionClassSimpleName;
+	}
+
+	public String getObservableCollectionClassName() {
+		return observableCollectionClassName;
+	}
+
+	public void setObservableCollectionClassName(
+			String observableCollectionClassName) {
+		this.observableCollectionClassName = observableCollectionClassName;
+	}
+
+	public String getObservableCollectionClassSimpleName() {
+		return observableCollectionClassSimpleName;
+	}
+
+	public void setObservableCollectionClassSimpleName(
+			String observableCollectionClassSimpleName) {
+		this.observableCollectionClassSimpleName = observableCollectionClassSimpleName;
+	}
+
+	public String getElementClassName() {
+		return elementClassName;
+	}
+
+	public void setElementClassName(String elementClassName) {
+		this.elementClassName = elementClassName;
+	}
+
+	public String getElementClassSimpleName() {
+		return elementClassSimpleName;
+	}
+
+	public void setElementClassSimpleName(String elementClassSimpleName) {
+		this.elementClassSimpleName = elementClassSimpleName;
+	}
+
+	public String getMapKeyClassName() {
+		return mapKeyClassName;
+	}
+
+	public void setMapKeyClassName(String mapKeyClassName) {
+		this.mapKeyClassName = mapKeyClassName;
+		this.mapKeyClassSimpleName = getSimpleName(mapKeyClassName);
+		isMap = true;
+	}
+
+	public String getMapKeyClassSimpleName() {
+		return mapKeyClassSimpleName;
+	}
+
+	public void setMapKeyClassSimpleName(String mapKeyClassSimpleName) {
+		this.mapKeyClassSimpleName = mapKeyClassSimpleName;
+		isMap = true;
+	}
+
+	public boolean isMap() {
+		return isMap;
+	}
+
+	public void setMap(boolean isMap) {
+		this.isMap = isMap;
+	}
 }

Modified: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/JiemamyModelDoclet.java
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/JiemamyModelDoclet.java	2008-09-12 06:48:38 UTC (rev 1915)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/java/org/jiemamy/core/eventcodegen/JiemamyModelDoclet.java	2008-09-12 19:37:21 UTC (rev 1916)
@@ -9,6 +9,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
@@ -33,6 +34,8 @@
 	public Map<Class<?>, CollectionProperty> collectionProperties = new HashMap<Class<?>, CollectionProperty>();
 	public static final String OUTPUTDIR = "target/";
 
+	// public static final String OUTPUTDIR = "src/main/java/";
+
 	public static LanguageVersion languageVersion() {
 		return LanguageVersion.JAVA_1_5;
 	}
@@ -123,13 +126,28 @@
 					|| isSubClass(fieldType, List.class)) {
 				// ListまたはSetのサブクラス
 				String parameterClassName = getParameterClassName(fieldDoc);
-				duplicateCheckAndAddToList(importClasses, fieldTypeName);
-				duplicateCheckAndAddToList(importClasses, parameterClassName);
-				properties
-						.add(new CollectionProperty(fieldDoc.name(), Class
-								.forName(fieldDoc.type().qualifiedTypeName()
-										.toString()), Class
-								.forName(parameterClassName)));
+				addImportClasses(importClasses, fieldTypeName);
+				addImportClasses(importClasses, parameterClassName);
+				properties.add(new CollectionProperty(fieldDoc.name(), fieldDoc
+						.type().qualifiedTypeName().toString(),
+						parameterClassName));
+			} else if (isSubClass(fieldType, Map.class)) {
+				// Mapのサブクラス
+				String[] parameterClassNames = getParameterClassNames(fieldDoc);
+				addImportClasses(importClasses, fieldTypeName);
+				addImportClasses(importClasses, parameterClassNames[0]);
+				addImportClasses(importClasses, parameterClassNames[1]);
+				try {
+					CollectionProperty collectionProperty = new CollectionProperty(
+							fieldDoc.name(), fieldDoc.type()
+									.qualifiedTypeName().toString(),
+							parameterClassNames[1]);
+					collectionProperty
+							.setMapKeyClassName(parameterClassNames[0]);
+					properties.add(collectionProperty);
+				} catch (Exception ex) {
+					ex.printStackTrace();
+				}
 			}
 		}
 		Collections.sort(importClasses);
@@ -159,13 +177,14 @@
 			writer.flush();
 			writer.close();
 
+			importClasses.add("java.util.List");
 			importClasses.add("java.util.ArrayList");
 			importClasses.add("org.jiemamy.core.event.ModelChangeEvent");
 			importClasses
 					.add("org.jiemamy.core.event.ObservableCollectionChangeListener");
 			for (CollectionProperty property : properties) {
-				duplicateCheckAndAddToList(importClasses, property
-						.getObservableCollectionClass().getName());
+				addImportClasses(importClasses, property
+						.getObservableCollectionClassName());
 			}
 			Collections.sort(importClasses);
 			Template supportTemplate = Velocity.getTemplate("ChangeSupport.vm");
@@ -209,7 +228,7 @@
 	}
 
 	/**
-	 * {@link List}フィールドのGeneric情報を返す。
+	 * {@link List}や{@link Set}フィールドのGeneric情報を返す。
 	 * 
 	 * @param fieldDoc
 	 * @return
@@ -223,22 +242,44 @@
 	}
 
 	/**
-	 * List内の要素に存在しない時のみListに追加する。
+	 * {@link Map}フィールドのGeneric情報を返す。
 	 * 
+	 * @param fieldDoc
+	 * @return
+	 */
+	private static String[] getParameterClassNames(FieldDoc fieldDoc) {
+		String parameterizedType = fieldDoc.type().asParameterizedType()
+				.toString();
+		int index1 = parameterizedType.indexOf('<');
+		int index2 = parameterizedType.lastIndexOf('>');
+		return parameterizedType.substring(index1 + 1, index2).split(",");
+	}
+
+	/**
+	 * List内の要素に存在しない時、java.langパッケージでない時のみListに追加する。
+	 * 
 	 * @param <E>
 	 * @param list
 	 * @param element
 	 */
-	private static <E> void duplicateCheckAndAddToList(List<E> list, E element) {
+	private static void addImportClasses(List<String> list, String element) {
+		if (element.startsWith("java.lang")) {
+			return;
+		}
+		int index = element.indexOf('<');
+		String _element = element;
+		if (index >= 0) {
+			_element = element.substring(0, index);
+		}
 		boolean exist = false;
-		for (E e : list) {
-			if (e.equals(element)) {
+		for (String e : list) {
+			if (e.equals(_element)) {
 				exist = true;
 				break;
 			}
 		}
 		if (!exist) {
-			list.add(element);
+			list.add(_element);
 		}
 	}
 }

Modified: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeListener.vm
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeListener.vm	2008-09-12 06:48:38 UTC (rev 1915)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeListener.vm	2008-09-12 19:37:21 UTC (rev 1916)
@@ -32,9 +32,10 @@
 #foreach($property in $properties)
 	
 	/**
-	 * {@link ${modelClassName}}が保持する{@link ${property.elementClass.name}}のCollectionに対する変更を処理する。
+	 * {@link ${modelClassName}}が保持する{@link ${property.elementClassName}}のCollectionに対する変更を処理する。
+	 * 
 	 * @param event
 	 */
-	void ${property.nameSingle}CollectionChange(ObservableCollectionChangeEvent<${property.collectionClass.simpleName}<${property.elementClass.simpleName}>, ${property.elementClass.simpleName}> event);
+	void ${property.nameSingle}CollectionChange(ObservableCollectionChangeEvent<${property.collectionClassSimpleName}<#if(${property.map} != false)${property.mapKeyClassSimpleName}, #end${property.elementClassSimpleName}>, ${property.elementClassSimpleName}> event);
 #end
 }

Modified: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeSupport.vm
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeSupport.vm	2008-09-12 06:48:38 UTC (rev 1915)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/main/resources/ChangeSupport.vm	2008-09-12 19:37:21 UTC (rev 1916)
@@ -16,7 +16,7 @@
  * either express or implied. See the License for the specific language
  * governing permissions and limitations under the License.
  */
-package org.jiemamy.core.event.model;
+package ${package};
 
 #foreach($importClass in $importClasses)
 import $importClass;
@@ -36,16 +36,17 @@
 	
 	/** 
 	 * ${property.name}のリストを監視するListener 
+	 * 
 	 * @see ObservableCollectionChangeListener
 	 * @see #fire${property.nameUpper}CollectionChangeEvent(ObservableCollectionChangeEvent)
 	 */
-	private ObservableCollectionChangeListener<${property.collectionClass.simpleName}<${property.elementClass.simpleName}>, ${property.elementClass.simpleName}> ${property.name}CollectionChangeListener =
-			new ObservableCollectionChangeListener<${property.collectionClass.simpleName}<${property.elementClass.simpleName}>, ${property.elementClass.simpleName}>() {
+	private ObservableCollectionChangeListener<${property.collectionClassSimpleName}<#if(${property.map} != false)${property.mapKeyClassSimpleName}, #end${property.elementClassSimpleName}>, ${property.elementClassSimpleName}> ${property.name}CollectionChangeListener =
+			new ObservableCollectionChangeListener<${property.collectionClassSimpleName}<#if(${property.map} != false)${property.mapKeyClassSimpleName}, #end${property.elementClassSimpleName}>, ${property.elementClassSimpleName}>() {
 				
 				/**
 				 * {@inheritDoc}
 				 */
-				public void collectionChanged(ObservableCollectionChangeEvent<${property.collectionClass.simpleName}<${property.elementClass.simpleName}>, ${property.elementClass.simpleName}> event) {
+				public void collectionChanged(ObservableCollectionChangeEvent<${property.collectionClassSimpleName}<#if(${property.map} != false)${property.mapKeyClassSimpleName}, #end${property.elementClassSimpleName}>, ${property.elementClassSimpleName}> event) {
 					fire${property.nameUpper}CollectionChangeEvent(event);
 				}
 			};
@@ -53,6 +54,7 @@
 	
 	/**
 	 * ${modelClassName}の属性の変更Eventを処理するListener
+	 * 
 	 * @see #fireModelChange(ModelChangeEvent)
 	 */
 	private ModelChangeListener ${modelClassNameLower}ChangeListener = new ModelChangeListener() {
@@ -67,18 +69,20 @@
 
 	/**
 	 * コンストラクタ。
+	 * 
 	 * @param source {@link ${modelClassName}}
 	 * @category instance creation
 	 */
 	public ${modelClassName}ChangeSupport(${modelClassName} source) {
 		source.addModelChangeListener(${modelClassNameLower}ChangeListener);
 #foreach($property in $properties)
-		((${property.observableCollectionClass.simpleName}<${property.elementClass.simpleName}>) source.get${property.nameUpper}()).addListener(${property.name}CollectionChangeListener);
+		((${property.observableCollectionClassSimpleName}<#if(${property.map} != false)${property.mapKeyClassSimpleName}, #end${property.elementClassSimpleName}>) source.get${property.nameUpper}()).addListener(${property.name}CollectionChangeListener);
 #end
 	}
 	
 	/**
 	 * ${modelClassName}自身のEventを監視するListenerを追加する。
+	 * 
 	 * @param l {@link ${modelClassName}ChangeListener}
 	 * @see #remove${modelClassName}ChangeListener(${modelClassName}ChangeListener)
 	 */
@@ -89,11 +93,12 @@
 #foreach($property in $properties)
 	/**
 	 * ${property.name}のcollectionを監視するListenerに通知されたEventを${modelClassName}の監視Listenerへ通知する。
+	 * 
 	 * @param event {@link ObservableCollectionChangeEvent}
 	 */
 	public void fire${property.nameUpper}CollectionChangeEvent(
-			ObservableCollectionChangeEvent<${property.collectionClass.simpleName}<${property.elementClass.simpleName}>, ${property.elementClass.simpleName}> event) {
-		for (TableModelChangeListener l : listeners) {
+			ObservableCollectionChangeEvent<${property.collectionClassSimpleName}<#if(${property.map} != false)${property.mapKeyClassSimpleName}, #end${property.elementClassSimpleName}>, ${property.elementClassSimpleName}> event) {
+		for (${modelClassName}ChangeListener l : listeners) {
 			l.${property.nameSingle}CollectionChange(event);
 		}
 	}
@@ -101,6 +106,7 @@
 	
 	/**
 	 * ${modelClassName}自身を監視するListenerに通知されたEventを${modelClassName}の監視Listenerへ通知する。
+	 * 
 	 * @param event {@link ModelChangeEvent}
 	 */
 	public void fireModelChange(ModelChangeEvent event) {
@@ -111,6 +117,7 @@
 	
 	/**
 	 * ${modelClassName}自身のEventを監視するListenerを削除する。
+	 * 
 	 * @param l {@link ${modelClassName}ChangeListener}
 	 * @see #add${modelClassName}ChangeListener(${modelClassName}ChangeListener)
 	 */

Added: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/CollectionPropertyTest.java
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/CollectionPropertyTest.java	                        (rev 0)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/CollectionPropertyTest.java	2008-09-12 19:37:21 UTC (rev 1916)
@@ -0,0 +1,29 @@
+package org.jiemamy.core.eventcodegen;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class CollectionPropertyTest {
+	@Test
+	public void testGetSimpleName01() {
+		assertEquals("JmPoint", CollectionProperty
+				.getSimpleName("org.jiemamy.core.model.presentation.JmPoint"));
+	}
+
+	@Test
+	public void testGetSimpleName02() {
+		assertEquals(
+				"List<org.jiemamy.core.model.presentation.JmPoint>",
+				CollectionProperty
+						.getSimpleName("java.util.List<org.jiemamy.core.model.presentation.JmPoint>"));
+	}
+
+	@Test
+	public void testGetSimpleName03() {
+		assertEquals(
+				"Map<String, org.jiemamy.core.model.presentation.JmPoint>",
+				CollectionProperty
+						.getSimpleName("java.util.Map<java.lang.String, org.jiemamy.core.model.presentation.JmPoint>"));
+	}
+}


Property changes on: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/CollectionPropertyTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/ListenerTemplateTest.java
===================================================================
--- sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/ListenerTemplateTest.java	2008-09-12 06:48:38 UTC (rev 1915)
+++ sandbox/org.jiemamy.core.eventcodegen/trunk/org.jiemamy.core.eventcodegen/src/test/java/org/jiemamy/core/eventcodegen/ListenerTemplateTest.java	2008-09-12 19:37:21 UTC (rev 1916)
@@ -58,12 +58,12 @@
 		importClasses.add("hoge");
 
 		List<CollectionProperty> properties = new ArrayList<CollectionProperty>();
-		properties.add(new CollectionProperty("columns", List.class,
-				ColumnModel.class));
-		properties.add(new CollectionProperty("indexes", List.class,
-				IndexModel.class));
-		properties.add(new CollectionProperty("checks", List.class,
-				CheckConstraintModel.class));
+		properties.add(new CollectionProperty("columns", List.class.getName(),
+				ColumnModel.class.getName()));
+		properties.add(new CollectionProperty("indexes", List.class.getName(),
+				IndexModel.class.getName()));
+		properties.add(new CollectionProperty("checks", List.class.getName(),
+				CheckConstraintModel.class.getName()));
 
 		velocityContext.put("modelClassName", "TableModel");
 		velocityContext.put("importClasses", importClasses);


Jiemamy-notify メーリングリストの案内
Back to archive index