You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2005/04/30 03:39:52 UTC
svn commit: r165369 [2/7] - in
/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay: component/
component/chain/ config/ config/beans/ parser/ parser/builder/
parser/builder/chain/ taglib/ utils/
Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayConfigureListener.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayConfigureListener.java?rev=165369&r1=165368&r2=165369&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayConfigureListener.java (original)
+++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayConfigureListener.java Fri Apr 29 18:39:50 2005
@@ -1,133 +1,133 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * 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.
- *
- * $Id$
- */
-
-package org.apache.shale.clay.config;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.shale.clay.config.beans.ConfigBean;
-import org.apache.shale.clay.config.beans.ConfigBeanFactory;
-import org.apache.shale.clay.config.beans.ComponentConfigBean;
-import org.apache.shale.clay.config.beans.TemplateConfigBean;
-import org.apache.shale.util.Messages;
-
-/**
- * <p>This context listener is responsible for loading the clay
- * configuration files on application startup. It is registered
- * in our tag library descriptor, so no further registration is
- * required. The configuration files are defined by a context
- * initialization parameter named <code>Globals.CLAY_CONFIG_FILES</code>.
- * </p>
- *
- * <p>After the data is loaded, it will be accessable using the factory class
- * {@link org.apache.shale.clay.config.beans.ConfigBeanFactory}</p>
- */
-
-public class ClayConfigureListener implements ServletContextListener {
-
- /**
- * <p>Static instanc reference to the common logger utility class.</p>
- */
- private static Log log;
- static {
- log = LogFactory.getLog(ClayConfigureListener.class);
- }
-
- /**
- * <p>Message resources for this class.</p>
- */
- private static Messages messages = new Messages("org.apache.shale.clay.Bundle",
- ClayConfigureListener.class.getClassLoader());
-
- /**
- * <p>Loads the configuration files on startup into an instance of {@link ComponentConfigBean}.
- * and registers it with the factory {@link ConfigBeanFactory}. The HTML template style of
- * clay config bean {@link TemplateConfigBean} is also registered with the factory
- * {@link ConfigBeanFactory}. Both config bean pools implement the {@link ConfigBean} interface
- * </p>
- *
- * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
- */
- public void contextInitialized(ServletContextEvent event) {
- if (log.isInfoEnabled())
- log.info(messages.getMessage("config.load.begin"));
-
- try {
-
- ClayXmlParser parser = new ClayXmlParser();
- // grab the default config file
- StringBuffer configFiles = new StringBuffer(
- Globals.DEFAULT_CLAY_CONFIG_FILE);
-
- // a comma delimited value list of config files
- String param = event.getServletContext().getInitParameter(
- Globals.CLAY_CONFIG_FILES);
-
- if (param != null && param.trim().length() > 0)
- configFiles.append(", ").append(param);
-
- ConfigBean config = new ComponentConfigBean();
- config.init(event.getServletContext());
-
- parser.setConfig((ComponentConfigBean) config);
- // materialize into an object graph
- parser.load(configFiles.toString());
-
- ConfigBeanFactory.register(config);
-
- parser = null;
- param = null;
- configFiles = null;
-
- // load template config
- config = new TemplateConfigBean();
-
- config.init(event.getServletContext());
- ConfigBeanFactory.register(config);
-
-
-
- } catch (RuntimeException e) {
- log.error(messages.getMessage("config.load.error"), e);
- throw e;
- }
-
- if (log.isInfoEnabled())
- log.info(messages.getMessage("config.load.done"));
-
- }
-
- /**
- * <p>Tear down the factories and clean house</p>
- *
- * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
- */
- public void contextDestroyed(ServletContextEvent event) {
-
- if (log.isInfoEnabled())
- log.debug(messages.getMessage("config.destroy"));
-
- ConfigBeanFactory.destroy();
- LogFactory.release(Thread.currentThread().getContextClassLoader());
-
- }
-
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.clay.config;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.shale.clay.config.beans.ConfigBean;
+import org.apache.shale.clay.config.beans.ConfigBeanFactory;
+import org.apache.shale.clay.config.beans.ComponentConfigBean;
+import org.apache.shale.clay.config.beans.TemplateConfigBean;
+import org.apache.shale.util.Messages;
+
+/**
+ * <p>This context listener is responsible for loading the clay
+ * configuration files on application startup. It is registered
+ * in our tag library descriptor, so no further registration is
+ * required. The configuration files are defined by a context
+ * initialization parameter named <code>Globals.CLAY_CONFIG_FILES</code>.
+ * </p>
+ *
+ * <p>After the data is loaded, it will be accessible using the factory class
+ * {@link org.apache.shale.clay.config.beans.ConfigBeanFactory}</p>
+ */
+
+public class ClayConfigureListener implements ServletContextListener {
+
+ /**
+ * <p>Static instanc reference to the common logger utility class.</p>
+ */
+ private static Log log;
+ static {
+ log = LogFactory.getLog(ClayConfigureListener.class);
+ }
+
+ /**
+ * <p>Message resources for this class.</p>
+ */
+ private static Messages messages = new Messages("org.apache.shale.clay.Bundle",
+ ClayConfigureListener.class.getClassLoader());
+
+ /**
+ * <p>Loads the configuration files on startup into an instance of {@link ComponentConfigBean}.
+ * and registers it with the factory {@link ConfigBeanFactory}. The HTML template style of
+ * clay configuration bean {@link TemplateConfigBean} is also registered with the factory
+ * {@link ConfigBeanFactory}. Both configuration bean pools implement the {@link ConfigBean} interface
+ * </p>
+ *
+ * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
+ */
+ public void contextInitialized(ServletContextEvent event) {
+ if (log.isInfoEnabled())
+ log.info(messages.getMessage("config.load.begin"));
+
+ try {
+
+ ClayXmlParser parser = new ClayXmlParser();
+ // grab the default config file
+ StringBuffer configFiles = new StringBuffer(
+ Globals.DEFAULT_CLAY_CONFIG_FILE);
+
+ // a comma delimited value list of config files
+ String param = event.getServletContext().getInitParameter(
+ Globals.CLAY_CONFIG_FILES);
+
+ if (param != null && param.trim().length() > 0)
+ configFiles.append(", ").append(param);
+
+ ConfigBean config = new ComponentConfigBean();
+ config.init(event.getServletContext());
+
+ parser.setConfig((ComponentConfigBean) config);
+ // materialize into an object graph
+ parser.load(configFiles.toString());
+
+ ConfigBeanFactory.register(config);
+
+ parser = null;
+ param = null;
+ configFiles = null;
+
+ // load template config
+ config = new TemplateConfigBean();
+
+ config.init(event.getServletContext());
+ ConfigBeanFactory.register(config);
+
+
+
+ } catch (RuntimeException e) {
+ log.error(messages.getMessage("config.load.error"), e);
+ throw e;
+ }
+
+ if (log.isInfoEnabled())
+ log.info(messages.getMessage("config.load.done"));
+
+ }
+
+ /**
+ * <p>Tear down the factories and clean house</p>
+ *
+ * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
+ */
+ public void contextDestroyed(ServletContextEvent event) {
+
+ if (log.isInfoEnabled())
+ log.debug(messages.getMessage("config.destroy"));
+
+ ConfigBeanFactory.destroy();
+ LogFactory.release(Thread.currentThread().getContextClassLoader());
+
+ }
+
+}
Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java?rev=165369&r1=165368&r2=165369&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java (original)
+++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java Fri Apr 29 18:39:50 2005
@@ -1,253 +1,253 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * 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.
- *
- * $Id$
- */
-
-package org.apache.shale.clay.config;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.StringTokenizer;
-
-import org.apache.commons.digester.Digester;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.shale.clay.config.beans.ComponentConfigBean;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.apache.shale.util.Messages;
-
-
-/**
- * <p>This class loads the configuration files defining page fragments and
- * caches a graph of beans in application scope. The location of the default
- * configuration file is located at <code>Globals.DEFAULT_CLAY_CONFIG_FILE</code>.
- * A comma value list of names can be supplied as a initalization parameter in
- * the web deployment descriptor using the parameter name
- * <code>Globals.CLAY_CONFIG_FILES</code>.
- * </p>
- */
-
-
-public class ClayXmlParser {
-
- /**
- * <p>The {@link ComponentConfigBean} is the container holding all of the
- * component metadata definitions read for the configuration files.
- * </p>
- */
- private ComponentConfigBean config = null;
-
- /**
- * <p>The <code>Digester</code> makes short work of materalizing a XML document
- * into an object graph using simple binding rules.
- * </p>
- */
- private Digester digester;
-
- /**
- * <p>Commons logging utility object static instance.</p>
- */
- private static Log log;
- static {
- log = LogFactory.getLog(org.apache.shale.clay.config.ClayXmlParser.class);
- }
-
- /**
- * @return config {@link ComponentConfigBean} instance of the component metadata container
- */
- public ComponentConfigBean getConfig() {
- return config;
- }
- /**
- * @param config {@link ComponentConfigBean} instance of the component metadata container
- */
- public void setConfig(ComponentConfigBean config) {
- this.config = config;
- }
-
- /**
- * <p>Message resources for this class.</p>
- */
- private static Messages messages = new Messages("org.apache.shale.clay.Bundle",
- ClayConfigureListener.class.getClassLoader());
-
-
- /**
- * <p>A static array of local DTD's to validate the digested documents against when not
- * connected to the internet.
- * </p>
- */
- protected Object[] registrations = {
- new String[] {"-//Apache Software Foundation//DTD Shale Clay View//EN", "/org/apache/shale/clay/config/resources/clay-config_1_0.dtd"}};
-
-
- /**
- * <p>Loads a single config file adding the bound objects to the config {@link ComponentConfigBean}.
- * This method will be called for each file specified in the comma delimited list.<p>
- *
- * @param configFile <code>String</code> a file path relative to the context root.
- *
- */
- protected void loadConfigFile(String configFile) {
-
- if (log.isInfoEnabled())
- log.info(messages.getMessage("parser.load.file", new Object[] { configFile }));
-
- if (digester == null) {
- digester = new Digester();
- digester.setLogger(log);
- digester.setValidating(true);
- digester.setUseContextClassLoader(true);
-
- // Register our local copy of the DTDs that we can find
- for (int i = 0; i < registrations.length; i++) {
- URL url = this.getClass().getResource(((String[]) registrations[i])[1]);
- if (url != null) {
- digester.register(((String[]) registrations[i])[0], url.toString());
- }
- }
-
- configureRules();
- digester.push(config);
- } else {
- digester.clear();
- digester.push(config);
- }
- InputSource in =
- new InputSource(config.getServletContext().getResourceAsStream(configFile));
- try {
- digester.parse(in);
- } catch (IOException e) {
- log.error(messages.getMessage("parser.load.error", new Object[] {configFile}), e);
- } catch (SAXException e) {
- log.error(messages.getMessage("parser.load.error", new Object[] {configFile}), e);
- }
-
- in = null;
-
- }
-
- /**
- * <p>This method is called once to register the object binding rules with
- * the <code>Digester</code> instance.
- *</p>
- */
- protected void configureRules() {
-
- if (log.isInfoEnabled())
- log.info(messages.getMessage("parser.load.rules"));
-
- digester.addObjectCreate(
- "*/attributes/set",
- org.apache.shale.clay.config.beans.AttributeBean.class);
- digester.addSetProperties("*/attributes/set");
- digester.addSetNext(
- "*/attributes/set",
- "addAttribute",
- "org.apache.shale.clay.config.beans.AttributeBean");
-
-
- digester.addObjectCreate(
- "*/valueChangeListener",
- org.apache.shale.clay.config.beans.ValueChangeListenerBean.class);
- digester.addSetProperties(
- "*/valueChangeListener");
- digester.addSetNext(
- "*/valueChangeListener",
- "addValueChangeListener",
- "org.apache.shale.clay.config.beans.ValueChangeListenerBean");
-
-
- digester.addObjectCreate(
- "*/actionListener",
- org.apache.shale.clay.config.beans.ActionListenerBean.class);
- digester.addSetProperties("*/actionListener");
- digester.addSetNext(
- "*/actionListener",
- "addActionListener",
- "org.apache.shale.clay.config.beans.ActionListenerBean");
-
- digester.addObjectCreate(
- "*/validator",
- org.apache.shale.clay.config.beans.ValidatorBean.class);
- digester.addSetProperties("*/validator");
- digester.addSetNext(
- "*/validator",
- "addValidator",
- "org.apache.shale.clay.config.beans.ValidatorBean");
-
- digester.addObjectCreate(
- "*/converter",
- org.apache.shale.clay.config.beans.ConverterBean.class);
- digester.addSetProperties("*/converter");
- digester.addSetNext(
- "*/converter",
- "addConverter",
- "org.apache.shale.clay.config.beans.ConverterBean");
-
- digester.addObjectCreate(
- "*/element",
- org.apache.shale.clay.config.beans.ElementBean.class);
- digester.addSetProperties("*/element");
- digester.addSetNext(
- "*/element",
- "addChild",
- "org.apache.shale.clay.config.beans.ElementBean");
-
-
- digester.addObjectCreate(
- "view/component",
- org.apache.shale.clay.config.beans.ComponentBean.class);
- digester.addSetProperties("view/component");
- digester.addSetNext(
- "view/component",
- "addChild",
- "org.apache.shale.clay.config.beans.ComponentBean");
-
- }
-
- /**
- * <p>Called to load a comma delimited value list of XML configuration files.
- * The list passed a a parameter will be tokenized and loaded individually by
- * calling the <code>loadConfigFile</code> method.
- *</p>
- *
- * @param configFiles <code>String</code> comma delimited list of files to load.
- */
- public void load(String configFiles) {
-
- StringTokenizer tokenizer = new StringTokenizer(configFiles, ", ");
- while (tokenizer.hasMoreTokens()) {
- StringBuffer configFile = new StringBuffer(tokenizer.nextToken().trim());
- if (configFile.toString().endsWith(".xml")) {
- for (int i = configFile.length() - 5; i > 0; i--) {
- if (configFile.charAt(i) == '.')
- configFile.setCharAt(i, '/');
- }
- }
-
- loadConfigFile(configFile.toString());
-
- configFile = null;
- }
- tokenizer = null;
-
- config.resolveInheritance();
-
- }
-
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.clay.config;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.StringTokenizer;
+
+import org.apache.commons.digester.Digester;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.shale.clay.config.beans.ComponentConfigBean;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.apache.shale.util.Messages;
+
+
+/**
+ * <p>This class loads the configuration files defining page fragments and
+ * caches a graph of beans in application scope. The location of the default
+ * configuration file is located at <code>Globals.DEFAULT_CLAY_CONFIG_FILE</code>.
+ * A comma value list of names can be supplied as a initialization parameter in
+ * the web deployment descriptor using the parameter name
+ * <code>Globals.CLAY_CONFIG_FILES</code>.
+ * </p>
+ */
+
+
+public class ClayXmlParser {
+
+ /**
+ * <p>The {@link ComponentConfigBean} is the container holding all of the
+ * component metadata definitions read for the configuration files.
+ * </p>
+ */
+ private ComponentConfigBean config = null;
+
+ /**
+ * <p>The <code>Digester</code> makes short work of materalizing a XML document
+ * into an object graph using simple binding rules.
+ * </p>
+ */
+ private Digester digester;
+
+ /**
+ * <p>Commons logging utility object static instance.</p>
+ */
+ private static Log log;
+ static {
+ log = LogFactory.getLog(org.apache.shale.clay.config.ClayXmlParser.class);
+ }
+
+ /**
+ * @return config {@link ComponentConfigBean} instance of the component metadata container
+ */
+ public ComponentConfigBean getConfig() {
+ return config;
+ }
+ /**
+ * @param config {@link ComponentConfigBean} instance of the component metadata container
+ */
+ public void setConfig(ComponentConfigBean config) {
+ this.config = config;
+ }
+
+ /**
+ * <p>Message resources for this class.</p>
+ */
+ private static Messages messages = new Messages("org.apache.shale.clay.Bundle",
+ ClayConfigureListener.class.getClassLoader());
+
+
+ /**
+ * <p>A static array of local DTD's to validate the digested documents against when not
+ * connected to the internet.
+ * </p>
+ */
+ protected Object[] registrations = {
+ new String[] {"-//Apache Software Foundation//DTD Shale Clay View//EN", "/org/apache/shale/clay/config/resources/clay-config_1_0.dtd"}};
+
+
+ /**
+ * <p>Loads a single configuration file adding the bound objects to the config {@link ComponentConfigBean}.
+ * This method will be called for each file specified in the comma delimited list.<p>
+ *
+ * @param configFile <code>String</code> a file path relative to the context root.
+ *
+ */
+ protected void loadConfigFile(String configFile) {
+
+ if (log.isInfoEnabled())
+ log.info(messages.getMessage("parser.load.file", new Object[] { configFile }));
+
+ if (digester == null) {
+ digester = new Digester();
+ digester.setLogger(log);
+ digester.setValidating(true);
+ digester.setUseContextClassLoader(true);
+
+ // Register our local copy of the DTDs that we can find
+ for (int i = 0; i < registrations.length; i++) {
+ URL url = this.getClass().getResource(((String[]) registrations[i])[1]);
+ if (url != null) {
+ digester.register(((String[]) registrations[i])[0], url.toString());
+ }
+ }
+
+ configureRules();
+ digester.push(config);
+ } else {
+ digester.clear();
+ digester.push(config);
+ }
+ InputSource in =
+ new InputSource(config.getServletContext().getResourceAsStream(configFile));
+ try {
+ digester.parse(in);
+ } catch (IOException e) {
+ log.error(messages.getMessage("parser.load.error", new Object[] {configFile}), e);
+ } catch (SAXException e) {
+ log.error(messages.getMessage("parser.load.error", new Object[] {configFile}), e);
+ }
+
+ in = null;
+
+ }
+
+ /**
+ * <p>This method is called once to register the object binding rules with
+ * the <code>Digester</code> instance.
+ *</p>
+ */
+ protected void configureRules() {
+
+ if (log.isInfoEnabled())
+ log.info(messages.getMessage("parser.load.rules"));
+
+ digester.addObjectCreate(
+ "*/attributes/set",
+ org.apache.shale.clay.config.beans.AttributeBean.class);
+ digester.addSetProperties("*/attributes/set");
+ digester.addSetNext(
+ "*/attributes/set",
+ "addAttribute",
+ "org.apache.shale.clay.config.beans.AttributeBean");
+
+
+ digester.addObjectCreate(
+ "*/valueChangeListener",
+ org.apache.shale.clay.config.beans.ValueChangeListenerBean.class);
+ digester.addSetProperties(
+ "*/valueChangeListener");
+ digester.addSetNext(
+ "*/valueChangeListener",
+ "addValueChangeListener",
+ "org.apache.shale.clay.config.beans.ValueChangeListenerBean");
+
+
+ digester.addObjectCreate(
+ "*/actionListener",
+ org.apache.shale.clay.config.beans.ActionListenerBean.class);
+ digester.addSetProperties("*/actionListener");
+ digester.addSetNext(
+ "*/actionListener",
+ "addActionListener",
+ "org.apache.shale.clay.config.beans.ActionListenerBean");
+
+ digester.addObjectCreate(
+ "*/validator",
+ org.apache.shale.clay.config.beans.ValidatorBean.class);
+ digester.addSetProperties("*/validator");
+ digester.addSetNext(
+ "*/validator",
+ "addValidator",
+ "org.apache.shale.clay.config.beans.ValidatorBean");
+
+ digester.addObjectCreate(
+ "*/converter",
+ org.apache.shale.clay.config.beans.ConverterBean.class);
+ digester.addSetProperties("*/converter");
+ digester.addSetNext(
+ "*/converter",
+ "addConverter",
+ "org.apache.shale.clay.config.beans.ConverterBean");
+
+ digester.addObjectCreate(
+ "*/element",
+ org.apache.shale.clay.config.beans.ElementBean.class);
+ digester.addSetProperties("*/element");
+ digester.addSetNext(
+ "*/element",
+ "addChild",
+ "org.apache.shale.clay.config.beans.ElementBean");
+
+
+ digester.addObjectCreate(
+ "view/component",
+ org.apache.shale.clay.config.beans.ComponentBean.class);
+ digester.addSetProperties("view/component");
+ digester.addSetNext(
+ "view/component",
+ "addChild",
+ "org.apache.shale.clay.config.beans.ComponentBean");
+
+ }
+
+ /**
+ * <p>Called to load a comma delimited value list of XML configuration files.
+ * The list passed a a parameter will be tokenized and loaded individually by
+ * calling the <code>loadConfigFile</code> method.
+ *</p>
+ *
+ * @param configFiles <code>String</code> comma delimited list of files to load.
+ */
+ public void load(String configFiles) {
+
+ StringTokenizer tokenizer = new StringTokenizer(configFiles, ", ");
+ while (tokenizer.hasMoreTokens()) {
+ StringBuffer configFile = new StringBuffer(tokenizer.nextToken().trim());
+ if (configFile.toString().endsWith(".xml")) {
+ for (int i = configFile.length() - 5; i > 0; i--) {
+ if (configFile.charAt(i) == '.')
+ configFile.setCharAt(i, '/');
+ }
+ }
+
+ loadConfigFile(configFile.toString());
+
+ configFile = null;
+ }
+ tokenizer = null;
+
+ config.resolveInheritance();
+
+ }
+
+}
Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java?rev=165369&r1=165368&r2=165369&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java (original)
+++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java Fri Apr 29 18:39:50 2005
@@ -1,200 +1,200 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * 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.
- *
- * $Id$
- */
-
-package org.apache.shale.clay.config;
-
-/**
- * <p>A {@link Globals} contains static constants used throughout the clay
- * plugin.
- * </p>
- */
-public class Globals {
-
- /**
- * <p>This literal constant is a fabricated name. In the JSF/JSP specification,
- * the facet is a parent tag. In the clay world, we use this identifier for
- * an attribute name.
- * </p>
- */
- public static final String CLAY_FACET_ATTRIBUTE_NAME = "facetName";
-
- /**
- * <p>A clay attribute used when defining the template style of page
- * composition where the body of the HTML element is rendered by
- * the component. This is used by the abstract
- * {@link org.apache.shale.clay.parser.builder}.
- */
- public static final String COMPONENT_ATTRIBUTE_ALLOW_BODY = "allowBody";
-
- /**
- *<p>EL properties will replaced the literal value of this constant with the
- * mapped ViewController bean before the expression is evaluated.
- *</p>
- */
- public static final String MANAGED_BEAN_MNEMONIC = "managed-bean-name";
-
- /**
- *<p>Name of the initialization param in the web deployment descriptor
- * containing additional registered config files. The list of files
- * should be comma delimited and the path relative to the context root.
- * <br>
- * The configuration files should conform to the view-config.dtd
- *</p>
- */
- public static final String CLAY_CONFIG_FILES = "clay-config-files";
-
- /**
- * <p>The name of the initialization parameter defined in the
- * web deployment descriptor that's value will define a suffix
- * identifier used by the {@link org.apache.shale.clay.config.beans.ComponentConfigBean}.
- * to identify a jsfid that uses HTML to define page composition.
- * </p>
- */
- public static final String CLAY_TEMPLATE_SUFFIX = "clay-template-suffix";
-
- /**
- * <p>The default template suffix identifier if one is not specified
- * using the CLAY_TEMPLATE_SUFFIX parameter.</p>
- */
- public static final String CLAY_DEFAULT_TEMPLATE_SUFFIX = ".clay";
-
- /**
- * <p>The default subiew configuration file containing the base supported
- * components.
- *</p>
- */
- public static final String DEFAULT_CLAY_CONFIG_FILE = "/WEB-INF/view-config.xml";
-
- /**
- * <p>The literal string used to identify that a clay subtree should be
- * built at runtime. This value "RUNTIME" will be placed in the jsfid
- * attribute. The subtree construction should be build by providing implementation
- * for the "shapeValidator" component event.
- * </p>
- */
- public static final String RUNTIME_ELEMENT_ID = "RUNTIME";
-
- /**
- * <p>The default catalog name used to configure the chain
- * workflow for building the clay subtree from a object
- * graph of metadata.
- *</p>
- */
- public static final String CLAY_CATALOG_NAME = "clay";
-
- /**
- * <p>Chain subchain command invoked by the {@link org.apache.shale.clay.component.chain.AssignPropertiesCommand}
- * to assign the attributes to the components. There are five subcommands
- * under this chain that handle the associated attributes.
- * </p
- */
- public static final String SET_ATTRIBUTE_COMMAND_NAME = "setAttribute";
-
- /**
- * <p>The command name used to add a component. There are several subchains
- * that will be invoked. This command is invoked recursivaly for each child
- * component.
- * </p>
- */
- public static final String ADD_COMPONENT_COMMAND_NAME = "addComponent";
-
- /**
- * <p>This command is invoked to add a converter to a component implementing
- * the {@link javax.faces.component.ValueHolder} interface.
- * </p>
- */
- public static final String ADD_CONVERTER_COMMAND_NAME = "addConverter";
-
- /**
- * <p>This command is invoked to add a validator to a component
- * implementing the {@link javax.faces.component.EditableValueHolder}
- * interface.</p
- */
- public static final String ADD_VALIDATOR_COMMAND_NAME = "addValidator";
-
- /**
- * <p>This command is invoked to add a valueChangeListener to a component that
- * implements the {@link javax.faces.component.EditableValueHolder} interface.</p>
- */
- public static final String ADD_VALUE_CHANGE_LISTENER_COMMAND_NAME = "addValueChangeListener";
-
- /**
- * <p>This command is invoked to add a actionListener to a component that
- * implements the {@link javax.faces.component.ActionSource} interface.
- *</p>
- */
- public static final String ADD_ACTION_LISTENER_COMMAND_NAME = "addActionListener";
-
- /**
- * <p>The catalog name used by {@link org.apache.shale.clay.parser.builder.BuilderFactory}
- * to define the rules that map an HTML element to a {@link org.apache.shale.clay.parser.builder.Builder}.
- * </p>
- */
- public static final String BUILDER_CATALOG_NAME = "builder";
-
- /**
- * <p> Command name in the BUILDER_CATALOG_NAME used to invoke a command
- * chain of rule commands that locates a {@link org.apache.shale.clay.parser.builder.Builder}.
- * </p>
- */
- public static final String FIND_BUILDER_COMMAND_NAME = "findBuilder";
-
- /**
- * <p>The config file used by {@link org.apache.shale.clay.component.Clay} component to
- * load the ADD_COMPONENT_COMMAND_NAME from the CLAY_CATALOG_NAME.
- * </p>
- */
- public static final String CLAY_RESOURCE_NAME = "org/apache/shale/clay/component/chain/shale-clay-config.xml";
-
- /**
- * <p> The config file used by the {@link org.apache.shale.clay.parser.builder.BuilderFactory}
- * to assemble the rule finder chain.
- * </p>
- */
- public static final String BUILDER_RESOURCE_NAME = "org/apache/shale/clay/parser/builder/chain/shale-builder-config.xml";
-
- /**
- * <p>A constants array of attribute names used by the faces components
- * as method binding events.</p
- */
- public static final String[] METHOD_ATTRIBUTES = { "converter",
- "validator", "valueChangeListener", "action", "actionListener" };
-
- /**
- * <p>A constants array of attribute names used by the faces components
- * to define additional behavior using a value binding expression.</b>
- */
- public static final String[] VALUE_ATTRIBUTES = { "value", "for",
- "immediate", "rendered", "required", "disabledClass",
- "enabledClass" };
-
- /**
- * <p>A constants array of component attributes that are HTML related. This
- * list is used by the abstract {@link org.apache.shale.clay.parser.builder.Builder}
- * to override component attributes defined in the view XML files.
- * </p>
- */
- public static final String[] HTML_ATTRIBUTES = { "accesskey", "dir",
- "disabled", "lang", "onblur", "onchange", "onclick", "ondblclick",
- "onfocus", "onkeydown", "onkeypress", "onkeyup", "onmousedown",
- "onmousemove", "onmouseout", "onmouseover", "onmouseup",
- "onselect", "readonly", "size", "style", "styleClass", "tabindex",
- "title", };
-
-
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.clay.config;
+
+/**
+ * <p>A {@link Globals} contains static constants used throughout the clay
+ * plug-in.
+ * </p>
+ */
+public class Globals {
+
+ /**
+ * <p>This literal constant is a fabricated name. In the JSF/JSP specification,
+ * the facet is a parent tag. In the clay world, we use this identifier for
+ * an attribute name.
+ * </p>
+ */
+ public static final String CLAY_FACET_ATTRIBUTE_NAME = "facetName";
+
+ /**
+ * <p>A clay attribute used when defining the template style of page
+ * composition where the body of the HTML element is rendered by
+ * the component. This is used by the abstract
+ * {@link org.apache.shale.clay.parser.builder}.
+ */
+ public static final String COMPONENT_ATTRIBUTE_ALLOW_BODY = "allowBody";
+
+ /**
+ *<p>EL properties will replaced the literal value of this constant with the
+ * mapped ViewController bean before the expression is evaluated.
+ *</p>
+ */
+ public static final String MANAGED_BEAN_MNEMONIC = "managed-bean-name";
+
+ /**
+ *<p>Name of the initialization param in the web deployment descriptor
+ * containing additional registered config files. The list of files
+ * should be comma delimited and the path relative to the context root.
+ * <br>
+ * The configuration files should conform to the view-config.dtd
+ *</p>
+ */
+ public static final String CLAY_CONFIG_FILES = "clay-config-files";
+
+ /**
+ * <p>The name of the initialization parameter defined in the
+ * web deployment descriptor that's value will define a suffix
+ * identifier used by the {@link org.apache.shale.clay.config.beans.ComponentConfigBean}.
+ * to identify a jsfid that uses HTML to define page composition.
+ * </p>
+ */
+ public static final String CLAY_TEMPLATE_SUFFIX = "clay-template-suffix";
+
+ /**
+ * <p>The default template suffix identifier if one is not specified
+ * using the CLAY_TEMPLATE_SUFFIX parameter.</p>
+ */
+ public static final String CLAY_DEFAULT_TEMPLATE_SUFFIX = ".clay";
+
+ /**
+ * <p>The default subiew configuration file containing the base supported
+ * components.
+ *</p>
+ */
+ public static final String DEFAULT_CLAY_CONFIG_FILE = "/WEB-INF/view-config.xml";
+
+ /**
+ * <p>The literal string used to identify that a clay subtree should be
+ * built at runtime. This value "RUNTIME" will be placed in the jsfid
+ * attribute. The subtree construction should be build by providing implementation
+ * for the "shapeValidator" component event.
+ * </p>
+ */
+ public static final String RUNTIME_ELEMENT_ID = "RUNTIME";
+
+ /**
+ * <p>The default catalog name used to configure the chain
+ * workflow for building the clay subtree from a object
+ * graph of metadata.
+ *</p>
+ */
+ public static final String CLAY_CATALOG_NAME = "clay";
+
+ /**
+ * <p>Chain subchain command invoked by the {@link org.apache.shale.clay.component.chain.AssignPropertiesCommand}
+ * to assign the attributes to the components. There are five subcommands
+ * under this chain that handle the associated attributes.
+ * </p
+ */
+ public static final String SET_ATTRIBUTE_COMMAND_NAME = "setAttribute";
+
+ /**
+ * <p>The command name used to add a component. There are several subchains
+ * that will be invoked. This command is invoked recursively for each child
+ * component.
+ * </p>
+ */
+ public static final String ADD_COMPONENT_COMMAND_NAME = "addComponent";
+
+ /**
+ * <p>This command is invoked to add a converter to a component implementing
+ * the {@link javax.faces.component.ValueHolder} interface.
+ * </p>
+ */
+ public static final String ADD_CONVERTER_COMMAND_NAME = "addConverter";
+
+ /**
+ * <p>This command is invoked to add a validator to a component
+ * implementing the {@link javax.faces.component.EditableValueHolder}
+ * interface.</p
+ */
+ public static final String ADD_VALIDATOR_COMMAND_NAME = "addValidator";
+
+ /**
+ * <p>This command is invoked to add a valueChangeListener to a component that
+ * implements the {@link javax.faces.component.EditableValueHolder} interface.</p>
+ */
+ public static final String ADD_VALUE_CHANGE_LISTENER_COMMAND_NAME = "addValueChangeListener";
+
+ /**
+ * <p>This command is invoked to add a actionListener to a component that
+ * implements the {@link javax.faces.component.ActionSource} interface.
+ *</p>
+ */
+ public static final String ADD_ACTION_LISTENER_COMMAND_NAME = "addActionListener";
+
+ /**
+ * <p>The catalog name used by {@link org.apache.shale.clay.parser.builder.BuilderFactory}
+ * to define the rules that map an HTML element to a {@link org.apache.shale.clay.parser.builder.Builder}.
+ * </p>
+ */
+ public static final String BUILDER_CATALOG_NAME = "builder";
+
+ /**
+ * <p> Command name in the BUILDER_CATALOG_NAME used to invoke a command
+ * chain of rule commands that locates a {@link org.apache.shale.clay.parser.builder.Builder}.
+ * </p>
+ */
+ public static final String FIND_BUILDER_COMMAND_NAME = "findBuilder";
+
+ /**
+ * <p>The config file used by {@link org.apache.shale.clay.component.Clay} component to
+ * load the ADD_COMPONENT_COMMAND_NAME from the CLAY_CATALOG_NAME.
+ * </p>
+ */
+ public static final String CLAY_RESOURCE_NAME = "org/apache/shale/clay/component/chain/shale-clay-config.xml";
+
+ /**
+ * <p> The config file used by the {@link org.apache.shale.clay.parser.builder.BuilderFactory}
+ * to assemble the rule finder chain.
+ * </p>
+ */
+ public static final String BUILDER_RESOURCE_NAME = "org/apache/shale/clay/parser/builder/chain/shale-builder-config.xml";
+
+ /**
+ * <p>A constants array of attribute names used by the faces components
+ * as method binding events.</p
+ */
+ public static final String[] METHOD_ATTRIBUTES = { "converter",
+ "validator", "valueChangeListener", "action", "actionListener" };
+
+ /**
+ * <p>A constants array of attribute names used by the faces components
+ * to define additional behavior using a value binding expression.</b>
+ */
+ public static final String[] VALUE_ATTRIBUTES = { "value", "for",
+ "immediate", "rendered", "required", "disabledClass",
+ "enabledClass" };
+
+ /**
+ * <p>A constants array of component attributes that are HTML related. This
+ * list is used by the abstract {@link org.apache.shale.clay.parser.builder.Builder}
+ * to override component attributes defined in the view XML files.
+ * </p>
+ */
+ public static final String[] HTML_ATTRIBUTES = { "accesskey", "dir",
+ "disabled", "lang", "onblur", "onchange", "onclick", "ondblclick",
+ "onfocus", "onkeydown", "onkeypress", "onkeyup", "onmousedown",
+ "onmousemove", "onmouseout", "onmouseover", "onmouseup",
+ "onselect", "readonly", "size", "style", "styleClass", "tabindex",
+ "title", };
+
+
}
Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ActionListenerBean.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ActionListenerBean.java?rev=165369&r1=165368&r2=165369&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ActionListenerBean.java (original)
+++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ActionListenerBean.java Fri Apr 29 18:39:50 2005
@@ -1,29 +1,27 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * 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.
- *
- * $Id$
- */
-
-package org.apache.shale.clay.config.beans;
-
-/**
- * Bound to a actionListener node within the config file
- *
- *
- */
-
-public class ActionListenerBean extends InnerComponentBean {
-
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.clay.config.beans;
+
+/**
+ * This meta component will be used to construct a JSF <code>ActionListener</code>. It is
+ * a subclass of {@link ComponentBean} where this class acts like an enumerated type.
+ */
+public class ActionListenerBean extends InnerComponentBean {
+
+}
Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/AttributeBean.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/AttributeBean.java?rev=165369&r1=165368&r2=165369&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/AttributeBean.java (original)
+++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/AttributeBean.java Fri Apr 29 18:39:50 2005
@@ -1,139 +1,231 @@
-/*
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * 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.
- *
- * $Id$
- */
-
-package org.apache.shale.clay.config.beans;
-
-import java.io.Serializable;
-
-/**
- * Represents a value for a component property or a tag attribute.
- *
- *
- */
-
-public class AttributeBean implements Comparable, Serializable {
- private String name = null;
-
- private String value = null;
-
- private ComponentBean hasAParent = null;
-
- private AttributeBean isAParent = null;
-
- private String valueLateBinding = null;
-
- private String methodLateBinding = null;
-
- boolean isInheritanceFinal = false;
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buff = new StringBuffer();
- buff.append("name=\"").append(name).append("\" value=\"").append(value)
- .append("\" usesValueLateBinding=\"").append(valueLateBinding)
- .append("\" usesMethodLateBinding=\"")
- .append(methodLateBinding).append("\"");
- return buff.toString();
- }
-
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setName(String string) {
- name = string;
- }
-
- public void setValue(String string) {
- value = string;
- }
-
- public int compareTo(Object obj) {
- AttributeBean item = (AttributeBean) obj;
-
- return item.getName().compareTo(getName());
- }
-
- public ComponentBean getHasAParent() {
- return hasAParent;
- }
-
- public void setHasAParent(ComponentBean bean) {
- hasAParent = bean;
- }
-
- public AttributeBean getIsAParent() {
- return isAParent;
- }
-
- public void setIsAParent(AttributeBean bean) {
- isAParent = bean;
- }
-
- public boolean useMethodLateBinding() {
- try {
- return Boolean.valueOf(methodLateBinding).booleanValue();
- } catch (RuntimeException e) {
- }
-
- return true;
- }
-
- public String getUseMethodLateBinding() {
- return methodLateBinding;
- }
-
- public void setUseMethodLateBinding(String b) {
- methodLateBinding = b;
- }
-
- public boolean useValueLateBinding() {
- try {
- return Boolean.valueOf(valueLateBinding).booleanValue();
- } catch (RuntimeException e) {
- }
-
- return true;
- }
-
- public String getUseValueLateBinding() {
- return valueLateBinding;
- }
-
- public void setUseValueLateBinding(String b) {
- valueLateBinding = b;
- }
-
- public boolean isInheritanceFinal() {
- return isInheritanceFinal;
- }
-
- public void setInheritanceFinal(boolean b) {
- isInheritanceFinal = b;
- }
-
-}
+/*
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.clay.config.beans;
+
+import java.io.Serializable;
+
+/**
+ * <p>Represents a value for a component property or a tag attribute.
+ * Instances of this class will be placed in the {@link ComponentBean}
+ * <code>attributes</code> collection.</p>
+ */
+public class AttributeBean implements Comparable, Serializable {
+
+ /**
+ * <p>Name of the attribute in the target JSF object property</p>
+ */
+ private String name = null;
+
+ /**
+ * <p>Value of the named attribute in the target JSF object property</p>
+ */
+ private String value = null;
+
+ /**
+ * <p>The parent meta component that contains this attribute in its
+ * attributes collection.
+ * </p>
+ */
+ private ComponentBean hasAParent = null;
+
+ /**
+ * <p>A meta component reference that this object is inherited from</p>
+ */
+ private AttributeBean isAParent = null;
+
+ /**
+ * <p>A flag that indicates a value binding expression is evaluated
+ * by the UIComponent. Otherwise the component is populated with the
+ * result of the expression.</p>
+ */
+ private String valueLateBinding = null;
+
+ /**
+ * <p>A flag that indicates a method binding expression is evaluated
+ * by the UIComponent. Otherwise the component is populated with the
+ * result of the expression.</p>
+ */
+ private String methodLateBinding = null;
+
+ /**
+ * <p>A boolean flag that the meta component inheritance has been
+ * resolved for this object instance.
+ * </p>
+ */
+ boolean isInheritanceFinal = false;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer buff = new StringBuffer();
+ buff.append("name=\"").append(name).append("\" value=\"").append(value)
+ .append("\" usesValueLateBinding=\"").append(valueLateBinding)
+ .append("\" usesMethodLateBinding=\"")
+ .append(methodLateBinding).append("\"");
+ return buff.toString();
+ }
+
+ /**
+ * <p>Returns a name corresponding to an associated JSF object property</p>
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <p>Returns the value of the attribute that can be a literal or a
+ * expression.</p>
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * <p>Sets the name of the attribute</p>
+ */
+ public void setName(String string) {
+ name = string;
+ }
+
+ /**
+ * <p>Sets the value of the attribute</p>
+ */
+ public void setValue(String string) {
+ value = string;
+ }
+
+ /**
+ * <p>This implementation of the <code>Comparable</code> interface makes
+ * the <code>name</code> property the compared key.</p>
+ */
+ public int compareTo(Object obj) {
+ AttributeBean item = (AttributeBean) obj;
+
+ return item.getName().compareTo(getName());
+ }
+
+ /**
+ * <p>Returns the parent component containing this object instance</p>
+ */
+ public ComponentBean getHasAParent() {
+ return hasAParent;
+ }
+
+ /**
+ * <p>Sets the parent component that contains this object instance</p>
+ */
+ public void setHasAParent(ComponentBean bean) {
+ hasAParent = bean;
+ }
+
+ /**
+ * <p>Returns a parent component that this component extends in terms of
+ * a meta relationship.
+ */
+ public AttributeBean getIsAParent() {
+ return isAParent;
+ }
+
+ /**
+ * <p>Sets a parent component that this component extends in terms of
+ * a meta relationship.
+ */
+ public void setIsAParent(AttributeBean bean) {
+ isAParent = bean;
+ }
+
+ /**
+ * <p>Returns a boolean flag that indicates the <code>value</code> property is a
+ * method binding expression and should be invoked by the component</p>
+ */
+ public boolean useMethodLateBinding() {
+ try {
+ return Boolean.valueOf(methodLateBinding).booleanValue();
+ } catch (RuntimeException e) {
+ }
+
+ return true;
+ }
+
+ /**
+ * <p>Returns a String that indicates the <code>value</code> property is a
+ * method binding expression and should be invoked by the component</p>
+ */
+ public String getUseMethodLateBinding() {
+ return methodLateBinding;
+ }
+
+ /**
+ * <p>Sets a String that indicates the <code>value</code> property is a
+ * method binding expression and should be invoked by the component</p>
+ */
+ public void setUseMethodLateBinding(String b) {
+ methodLateBinding = b;
+ }
+
+ /**
+ * <p>Returns a boolean flag that indicates the <code>value</code> property is a
+ * value binding expression and should be invoked by the component</p>
+ */
+ public boolean useValueLateBinding() {
+ try {
+ return Boolean.valueOf(valueLateBinding).booleanValue();
+ } catch (RuntimeException e) {
+ }
+
+ return true;
+ }
+
+ /**
+ * <p>Returns a String that indicates the <code>value</code> property is a
+ * value binding expression and should be invoked by the component</p>
+ */
+ public String getUseValueLateBinding() {
+ return valueLateBinding;
+ }
+
+ /**
+ * <p>Sets a String that indicates the <code>value</code> property is a
+ * value binding expression and should be invoked by the component</p>
+ */
+ public void setUseValueLateBinding(String b) {
+ valueLateBinding = b;
+ }
+
+ /**
+ * <p>Returns boolean that indicates the meta inheritance relationships have been
+ * resolved</p>
+ */
+ public boolean isInheritanceFinal() {
+ return isInheritanceFinal;
+ }
+
+ /**
+ * <p>Sets a boolean that indicates the meta inheritance relationships have been
+ * resolved</p>
+ */
+ public void setInheritanceFinal(boolean b) {
+ isInheritanceFinal = b;
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org