001: /*
002: * Version: MPL 1.1/GPL 2.0/LGPL 2.1
003: *
004: * "The contents of this file are subject to the Mozilla Public License
005: * Version 1.1 (the "License"); you may not use this file except in
006: * compliance with the License. You may obtain a copy of the License at
007: * http://www.mozilla.org/MPL/
008: *
009: * Software distributed under the License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
011: * License for the specific language governing rights and limitations under
012: * the License.
013: *
014: * The Original Code is ICEfaces 1.5 open source software code, released
015: * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
016: * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
017: * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
018: *
019: * Contributor(s): _____________________.
020: *
021: * Alternatively, the contents of this file may be used under the terms of
022: * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
023: * License), in which case the provisions of the LGPL License are
024: * applicable instead of those above. If you wish to allow use of your
025: * version of this file only under the terms of the LGPL License and not to
026: * allow others to use your version of this file under the MPL, indicate
027: * your decision by deleting the provisions above and replace them with
028: * the notice and other provisions required by the LGPL License. If you do
029: * not delete the provisions above, a recipient may use your version of
030: * this file under either the MPL or the LGPL License."
031: *
032: */
033:
034: package com.icesoft.jsfmeta.util;
035:
036: import com.sun.rave.jsfmeta.beans.ComponentBean;
037: import com.sun.rave.jsfmeta.beans.FacesConfigBean;
038: import com.sun.rave.jsfmeta.beans.FacetBean;
039: import com.sun.rave.jsfmeta.beans.PropertyBean;
040: import com.sun.rave.jsfmeta.beans.RenderKitBean;
041: import com.sun.rave.jsfmeta.beans.RendererBean;
042: import java.util.logging.Level;
043: import java.util.logging.Logger;
044:
045: public class DebugUtil {
046:
047: private static Logger logger = Logger.getLogger(DebugUtil.class
048: .getName());
049:
050: public DebugUtil() {
051: }
052:
053: public static void print(FacesConfigBean config) {
054:
055: ComponentBean cbs[] = config.getComponents();
056: for (int i = 0; i < cbs.length; i++) {
057:
058: ComponentBean cb = cbs[i];
059: if (logger.isLoggable(Level.FINE)) {
060: logger.log(Level.FINE, "Component( componentType="
061: + cb.getComponentType() + ",componentFamily="
062: + cb.getComponentFamily() + ",rendererType="
063: + cb.getRendererType() + ",baseComponentType="
064: + cb.getBaseComponentType() + ")" + "");
065: }
066:
067: if (cbs[i].getComponentFamily() == null
068: || cbs[i].getComponentType() == null) {
069: continue;
070: }
071:
072: RendererBean rendererBean = config.getRenderKit(
073: "HTML_BASIC").getRenderer(
074: cbs[i].getComponentFamily(),
075: cbs[i].getRendererType());
076:
077: if (rendererBean == null) {
078: continue;
079: }
080:
081: if (logger.isLoggable(Level.FINE)) {
082: logger.log(Level.FINE, " tagName="
083: + rendererBean.getTagName());
084: }
085:
086: PropertyBean[] pbs = cbs[i].getProperties();
087: for (int j = 0; j < pbs.length; j++) {
088:
089: if (logger.isLoggable(Level.FINE)) {
090: logger.log(Level.FINE, "categoryName="
091: + pbs[j].getCategory() + " propertyName="
092: + pbs[j].getPropertyName());
093: }
094:
095: }
096: }
097:
098: for (int i = 0; i < cbs.length; i++) {
099: ComponentBean cb = cbs[i];
100: if (logger.isLoggable(Level.FINE)) {
101: logger.log(Level.FINE, "Component(componentType="
102: + cb.getComponentType() + ",componentFamily="
103: + cb.getComponentFamily() + ",rendererType="
104: + cb.getRendererType() + ",baseComponentType="
105: + cb.getBaseComponentType() + ")");
106: }
107: FacetBean fbs[] = cbs[i].getFacets();
108: for (int j = 0; j < fbs.length; j++) {
109:
110: if (logger.isLoggable(Level.FINE)) {
111: logger.log(Level.FINE, " Facet(facetName="
112: + fbs[j].getFacetName() + ",displayName="
113: + fbs[j].getDisplayName("") + ")");
114: }
115: }
116: }
117:
118: RenderKitBean rkbs[] = config.getRenderKits();
119: for (int i = 0; i < rkbs.length; i++) {
120: RenderKitBean rkb = rkbs[i];
121: RendererBean rbs[] = rkb.getRenderers();
122: for (int j = 0; j < rbs.length; j++) {
123: RendererBean rb = rbs[j];
124: if (logger.isLoggable(Level.FINE)) {
125: logger.log(Level.FINE, "Renderer(renderKitId="
126: + rkb.getRenderKitId()
127: + ",componentFamily="
128: + rb.getComponentFamily()
129: + ",rendererType=" + rb.getRendererType()
130: + ")");
131: }
132: FacetBean fbs[] = rbs[j].getFacets();
133: for (int k = 0; k < fbs.length; k++) {
134:
135: if (logger.isLoggable(Level.FINE)) {
136: logger.log(Level.FINE, " Facet(facetName="
137: + fbs[k].getFacetName()
138: + ",displayName="
139: + fbs[k].getDisplayName("") + ")");
140: }
141: }
142:
143: }
144:
145: }
146: }
147:
148: }
|