myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r889027 - in /myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder: model/ComponentMeta.java qdox/QdoxModelBuilder.java
Date Thu, 10 Dec 2009 00:07:18 GMT
Author: lu4242
Date: Thu Dec 10 00:07:18 2009
New Revision: 889027

URL: http://svn.apache.org/viewvc?rev=889027&view=rev
Log:
MYFACES-2455 ClientBehaviorHolder interface should be tracked by myfaces-builder-plugin metadata

Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java?rev=889027&r1=889026&r2=889027&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java
Thu Dec 10 00:07:18 2009
@@ -51,6 +51,8 @@
     private String _serialuid;
     private String _implements;
     private String _defaultEventName;
+    private Boolean _overrideDefaultEventName;
+    private Boolean _clientBehaviorHolder;
     
     private Boolean _generatedComponentClass;
     private Boolean _generatedTagClass;
@@ -76,12 +78,13 @@
         out.writeElement("rendererType", _rendererType);
         out.writeElement("configExcluded", _configExcluded);
         out.writeElement("defaultEventName", _defaultEventName);
-
+        out.writeElement("overrideDefaultEventName", _overrideDefaultEventName);
         out.writeElement("serialuid", _serialuid);
         out.writeElement("implements", _implements);
         out.writeElement("generatedComponentClass", _generatedComponentClass);
         out.writeElement("generatedTagClass", _generatedTagClass);
         out.writeElement("template", _template);
+        out.writeElement("clientBehaviorHolder", _clientBehaviorHolder);
         
         for (Iterator i = _facets.values().iterator(); i.hasNext();)
         {
@@ -116,6 +119,7 @@
         digester.addBeanPropertySetter(newPrefix + "/tagHandler");
         digester.addBeanPropertySetter(newPrefix + "/rendererType");
         digester.addBeanPropertySetter(newPrefix + "/defaultEventName");
+        digester.addBeanPropertySetter(newPrefix + "/overrideDefaultEventName");
         digester.addBeanPropertySetter(newPrefix + "/faceletRendererType");
         digester.addBeanPropertySetter(newPrefix + "/configExcluded");
         digester.addBeanPropertySetter(newPrefix + "/serialuid");
@@ -123,6 +127,7 @@
         digester.addBeanPropertySetter(newPrefix + "/generatedComponentClass");
         digester.addBeanPropertySetter(newPrefix + "/generatedTagClass");
         digester.addBeanPropertySetter(newPrefix + "/template");
+        digester.addBeanPropertySetter(newPrefix + "/clientBehaviorHolder");
         
         FacetMeta.addXmlRules(digester, newPrefix);
         ListenerMeta.addXmlRules(digester, newPrefix);
@@ -169,6 +174,7 @@
         //_tagClass = ModelUtils.merge(this._tagClass, other._tagClass);
         _tagHandler = ModelUtils.merge(this._tagHandler, other._tagHandler);
         _defaultEventName = ModelUtils.merge(this._defaultEventName, other._defaultEventName);
+        _clientBehaviorHolder = ModelUtils.merge(this._clientBehaviorHolder, other._clientBehaviorHolder);
         _namingContainer = ModelUtils.merge(this._namingContainer,
                 other._namingContainer);
         _children = ModelUtils.merge(this._children, other._children);
@@ -446,7 +452,46 @@
     {
         this._defaultEventName = defaultEventName;
     }
-            
+
+    /**
+     * 
+     * @since 1.0.5
+     */
+    public void setOverrideDefaultEventName(Boolean overrideDefaultEventName)
+    {
+        _overrideDefaultEventName = overrideDefaultEventName;
+    }
+
+    /**
+     * Indicate if this component must override the method:
+     * public String getDefaultEventName()
+     * To return the value on defaultEventName 
+     * 
+     * @since 1.0.5
+     */
+    public Boolean isOverrideDefaultEventName()
+    {
+        return ModelUtils.defaultOf(_overrideDefaultEventName,false);
+    }
+
+    /**
+     * 
+     * @since 1.0.5
+     */
+    public void setClientBehaviorHolder(Boolean clientBehaviorHolder)
+    {
+        _clientBehaviorHolder = clientBehaviorHolder;
+    }
+
+    /**
+     * 
+     * @since 1.0.5
+     */
+    public Boolean isClientBehaviorHolder()
+    {
+        return ModelUtils.defaultOf(_clientBehaviorHolder,false);
+    }
+
     //THIS METHODS ARE USED FOR VELOCITY TO GET DATA AND GENERATE CLASSES
     
     public Collection getFacetList()

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java?rev=889027&r1=889026&r2=889027&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
Thu Dec 10 00:07:18 2009
@@ -1069,6 +1069,10 @@
         component.setImplements(implementsValue);
         component.setTemplate(template);
         component.setDefaultEventName(defaultEventName);
+        if (defaultEventName != null)
+        {
+            component.setOverrideDefaultEventName(Boolean.TRUE);
+        }
         
         JavaClass[] interfaces = clazz.getImplementedInterfaces();
         for (int i = 0; i < interfaces.length; ++i)
@@ -1080,6 +1084,19 @@
                 component.setNamingContainer(Boolean.TRUE);
                 break;
             }
+            if (iface.getFullyQualifiedName().equals(
+                    "javax.faces.component.behavior.ClientBehaviorHolder"))
+            {
+                component.setClientBehaviorHolder(Boolean.TRUE);
+                break;
+            }
+        }
+        if (implementsValue != null)
+        {
+            if (StringUtils.contains(implementsValue, "javax.faces.component.behavior.ClientBehaviorHolder"))
+            {
+                component.setClientBehaviorHolder(Boolean.TRUE);
+            }
         }
 
         component.setTagClass(tagClass);



Mime
View raw message