[Jiemamy-notify:1487] commit [2711] なんだかjavacだとエラーが出るので…。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 23日 (月) 00:39:20 JST


Revision: 2711
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2711
Author:   daisuke_m
Date:     2009-02-23 00:39:20 +0900 (Mon, 23 Feb 2009)

Log Message:
-----------
なんだかjavacだとエラーが出るので…。

Modified Paths:
--------------
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/DefaultTokenResolver.java
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/TokenResolver.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/DefaultTokenResolver.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/DefaultTokenResolver.java	2009-02-22 14:46:00 UTC (rev 2710)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/DefaultTokenResolver.java	2009-02-22 15:39:20 UTC (rev 2711)
@@ -34,31 +34,40 @@
  */
 public class DefaultTokenResolver implements TokenResolver {
 	
-	public List<Token> resolve(Enum<?> value) {
+	public List<Token> resolve(Object value) {
 		List<Token> tokens = CollectionsUtil.newArrayList(1);
-		if (value == InitiallyCheckTime.IMMEDIATE) {
-			tokens.add(Keyword.IMMEDIATE);
-		} else if (value == InitiallyCheckTime.DEFERRED) {
-			tokens.add(Keyword.DEFERRED);
-		} else if (value == MatchType.SIMPLE) {
-			tokens.add(Keyword.SIMPLE);
-		} else if (value == MatchType.FULL) {
-			tokens.add(Keyword.FULL);
-		} else if (value == MatchType.PARTIAL) {
-			tokens.add(Keyword.PARTIAL);
-		} else if (value == ReferentialAction.CASCADE) {
-			tokens.add(Keyword.CASCADE);
-		} else if (value == ReferentialAction.SET_NULL) {
-			tokens.add(Keyword.SET);
-			tokens.add(Keyword.NULL);
-		} else if (value == ReferentialAction.SET_DEFAULT) {
-			tokens.add(Keyword.SET);
-			tokens.add(Keyword.DEFAULT);
-		} else if (value == ReferentialAction.RESTRICT) {
-			tokens.add(Keyword.RESTRICT);
-		} else if (value == ReferentialAction.NO_ACTION) {
-			tokens.add(Keyword.NO);
-			tokens.add(Keyword.ACTION);
+		if (value instanceof InitiallyCheckTime) {
+			InitiallyCheckTime initiallyCheckTime = (InitiallyCheckTime) value;
+			if (initiallyCheckTime == InitiallyCheckTime.IMMEDIATE) {
+				tokens.add(Keyword.IMMEDIATE);
+			} else if (initiallyCheckTime == InitiallyCheckTime.DEFERRED) {
+				tokens.add(Keyword.DEFERRED);
+			}
+		} else if (value instanceof MatchType) {
+			MatchType matchType = (MatchType) value;
+			if (matchType == MatchType.SIMPLE) {
+				tokens.add(Keyword.SIMPLE);
+			} else if (matchType == MatchType.FULL) {
+				tokens.add(Keyword.FULL);
+			} else if (matchType == MatchType.PARTIAL) {
+				tokens.add(Keyword.PARTIAL);
+			}
+		} else if (value instanceof ReferentialAction) {
+			ReferentialAction referentialAction = (ReferentialAction) value;
+			if (referentialAction == ReferentialAction.CASCADE) {
+				tokens.add(Keyword.CASCADE);
+			} else if (referentialAction == ReferentialAction.SET_NULL) {
+				tokens.add(Keyword.SET);
+				tokens.add(Keyword.NULL);
+			} else if (referentialAction == ReferentialAction.SET_DEFAULT) {
+				tokens.add(Keyword.SET);
+				tokens.add(Keyword.DEFAULT);
+			} else if (referentialAction == ReferentialAction.RESTRICT) {
+				tokens.add(Keyword.RESTRICT);
+			} else if (referentialAction == ReferentialAction.NO_ACTION) {
+				tokens.add(Keyword.NO);
+				tokens.add(Keyword.ACTION);
+			}
 		}
 		return tokens;
 	}

Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/TokenResolver.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/TokenResolver.java	2009-02-22 14:46:00 UTC (rev 2710)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/dialect/TokenResolver.java	2009-02-22 15:39:20 UTC (rev 2711)
@@ -30,11 +30,11 @@
 public interface TokenResolver {
 	
 	/**
-	 * Enum要素をトークン列に変換する。
+	 * オブジェクトをトークン列に変換する。
 	 * 
 	 * @param value 変換対象
 	 * @return トークンシーケンス
 	 */
-	List<Token> resolve(Enum<?> value);
+	List<Token> resolve(Object value);
 	
 }



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