svnno****@sourc*****
svnno****@sourc*****
2008年 9月 15日 (月) 23:56:29 JST
Revision: 1921 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=1921 Author: daisuke_m Date: 2008-09-15 23:56:29 +0900 (Mon, 15 Sep 2008) Log Message: ----------- S2ContainerUtil追加。 Added Paths: ----------- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/debug/ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/debug/S2ContainerUtil.java -------------- next part -------------- Added: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/debug/S2ContainerUtil.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/debug/S2ContainerUtil.java (rev 0) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/debug/S2ContainerUtil.java 2008-09-15 14:56:29 UTC (rev 1921) @@ -0,0 +1,59 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/09/15 + * + * 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.debug; + +import org.apache.commons.lang.text.StrBuilder; +import org.seasar.framework.container.ComponentDef; +import org.seasar.framework.container.S2Container; + +/** + * TODO for daisuke + * @author daisuke + */ +public class S2ContainerUtil { + + /** + * TODO for daisuke + * @param container + * @return 定義情報 + */ + public static String inspect(S2Container container) { + StrBuilder sb = new StrBuilder(); + sb.appendln("--------"); + + int size = container.getComponentDefSize(); + for (int i = 0; i < size; i++) { + ComponentDef componentDef = container.getComponentDef(i); + String componentName = componentDef.getComponentName(); + Class<?> componentClass = componentDef.getComponentClass(); + Class<?> concreteClass = componentDef.getConcreteClass(); + sb.append("Def No: ").appendln(i); + sb.append("Component Class: ").appendln(componentClass.getName()); + if (componentClass != concreteClass) { + sb.append("Concrete Class: ").appendln(concreteClass.getName()); + } + sb.append("Component Name: ").appendln(componentName); + sb.appendln("--------"); + } + return sb.toString(); + } + + private S2ContainerUtil() { + } +} Property changes on: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/debug/S2ContainerUtil.java ___________________________________________________________________ Name: svn:mime-type + text/plain