myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r641479 - /myfaces/myfaces-build-tools/branches/skitching/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/Model.java
Date Wed, 26 Mar 2008 18:53:37 GMT
Author: skitching
Date: Wed Mar 26 11:53:28 2008
New Revision: 641479

URL: http://svn.apache.org/viewvc?rev=641479&view=rev
Log:
Ensure converters and validators are read back in from xml files.
Minor code tidyups

Modified:
    myfaces/myfaces-build-tools/branches/skitching/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/Model.java

Modified: myfaces/myfaces-build-tools/branches/skitching/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/Model.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/skitching/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/Model.java?rev=641479&r1=641478&r2=641479&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/skitching/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/Model.java
(original)
+++ myfaces/myfaces-build-tools/branches/skitching/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/Model.java
Wed Mar 26 11:53:28 2008
@@ -35,14 +35,14 @@
 {
     static private final Logger _LOG = Logger.getLogger(Model.class.getName());
 
+    private List _components = new ArrayList(100);
     private List _converters = new ArrayList(100);
     private List _validators = new ArrayList(100);
-    private List _components = new ArrayList(100);
     private List _renderKits = new ArrayList(100);
 
+    private Map _componentsByClass = new TreeMap();
     private Map _convertersByClass = new TreeMap();
     private Map _validatorsByClass = new TreeMap();
-    private Map _componentsByClass = new TreeMap();
     private Map _renderKitsByClass = new TreeMap();
 
     /**
@@ -90,6 +90,8 @@
 
         digester.addObjectCreate(prefix, Model.class);
         ComponentMeta.addXmlRules(digester, prefix);
+        ConverterMeta.addXmlRules(digester, prefix);
+        ValidatorMeta.addXmlRules(digester, prefix);
     }
 
     /**
@@ -169,6 +171,39 @@
     }
 
     /**
+     * Adds a component to this faces config document.
+     * 
+     * @param component
+     *            the component to add
+     */
+    public void addComponent(ComponentMeta component)
+    {
+        _components.add(component);
+        _componentsByClass.put(component.getClassName(), component);
+    }
+
+    /**
+     * Returns all components
+     */
+    public List getComponents()
+    {
+        return _components;
+    }
+
+    /**
+     * Returns an iterator for all components.
+     */
+    public Iterator components()
+    {
+        return _components.iterator();
+    }
+
+    public ComponentMeta findComponentByClassName(String className)
+    {
+        return (ComponentMeta) _componentsByClass.get(className);
+    }
+
+    /**
      * Holds info about a JSF Converter definition
      */
     public void addConverter(ConverterMeta converter)
@@ -226,39 +261,6 @@
     public ValidatorMeta findValidatorByClassName(String className)
     {
         return (ValidatorMeta) _validatorsByClass.get(className);
-    }
-
-    /**
-     * Adds a component to this faces config document.
-     * 
-     * @param component
-     *            the component to add
-     */
-    public void addComponent(ComponentMeta component)
-    {
-        _components.add(component);
-        _componentsByClass.put(component.getClassName(), component);
-    }
-
-    /**
-     * Returns all components
-     */
-    public List getComponents()
-    {
-        return _components;
-    }
-
-    /**
-     * Returns an iterator for all components.
-     */
-    public Iterator components()
-    {
-        return _components.iterator();
-    }
-
-    public ComponentMeta findComponentByClassName(String className)
-    {
-        return (ComponentMeta) _componentsByClass.get(className);
     }
 
     /**



Mime
View raw message