KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > commons > debug > FacesHelper


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.commons.debug;
6
7 import java.util.* ;
8 import java.io.PrintStream JavaDoc ;
9
10 import javax.faces.component.UIComponent ;
11
12 /**
13  * Static helper methods for string operations.
14  * Author: Tuan Nguyen
15  */

16 public class FacesHelper {
17   
18   static public void printUIComponentInfo(PrintStream JavaDoc out, UIComponent component) {
19   }
20
21   static public void printTreeInfo(PrintStream JavaDoc out, UIComponent component) {
22     printTreeInfo(out,component, "") ;
23
24   }
25
26   static private void printTreeInfo(PrintStream JavaDoc out, UIComponent component, String JavaDoc indent) {
27     out.print(indent) ;
28     out.print("[class:" + component.getClass().getName() +"]");
29     out.print("[hash code:" + component.hashCode() +"]\n" );
30     List children = component.getChildren() ;
31     for (int i = 0; i < children.size(); i++) {
32       UIComponent child = (UIComponent) children.get(i) ;
33       printTreeInfo(out, child , indent + " ") ;
34     }
35   }
36 }
37
Popular Tags