bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r995396 - /incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/MetaBeanBuilder.java
Date Thu, 09 Sep 2010 12:20:19 GMT
Author: mbenson
Date: Thu Sep  9 12:20:19 2010
New Revision: 995396

URL: http://svn.apache.org/viewvc?rev=995396&view=rev
Log:
another missed formatting merge

Modified:
    incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/MetaBeanBuilder.java

Modified: incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/MetaBeanBuilder.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/MetaBeanBuilder.java?rev=995396&r1=995395&r2=995396&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/MetaBeanBuilder.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/MetaBeanBuilder.java
Thu Sep  9 12:20:19 2010
@@ -16,7 +16,6 @@
  */
 package org.apache.bval;
 
-
 import org.apache.bval.model.MetaBean;
 import org.apache.commons.lang3.ClassUtils;
 import org.apache.commons.logging.Log;
@@ -26,98 +25,109 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Description: internal implementation class to construct
- * metabeans with factories<br/>
+ * Description: internal implementation class to construct metabeans with
+ * factories<br/>
  */
 public class MetaBeanBuilder {
-  private static final Log log = LogFactory.getLog(MetaBeanBuilder.class);
+    private static final Log log = LogFactory.getLog(MetaBeanBuilder.class);
+
+    /**
+     * here you can install different kinds of factories to create MetaBeans
+     * from
+     */
+    private MetaBeanFactory[] factories;
+
+    /**
+     * Create a new MetaBeanBuilder instance.
+     */
+    public MetaBeanBuilder() {
+        this(new MetaBeanFactory[] { new IntrospectorMetaBeanFactory() });
+    }
+
+    /**
+     * Create a new MetaBeanBuilder instance.
+     * 
+     * @param factories
+     */
+    public MetaBeanBuilder(MetaBeanFactory[] factories) {
+        setFactories(factories);
+    }
+
+    /**
+     * Get the configured set of {@link MetaBeanFactory} objects.
+     * 
+     * @return {@link MetaBeanFactory} array
+     */
+    public MetaBeanFactory[] getFactories() {
+        return factories;
+    }
 
-  /**
-   * here you can install different kinds of factories to create MetaBeans from
-   */
-  private MetaBeanFactory[] factories;
-
-  /**
-   * Create a new MetaBeanBuilder instance.
-   */
-  public MetaBeanBuilder() {
-    this(new MetaBeanFactory[]{new IntrospectorMetaBeanFactory()});
-  }
-
-  /**
-   * Create a new MetaBeanBuilder instance.
-   * @param factories
-   */
-  public MetaBeanBuilder(MetaBeanFactory[] factories) {
-    setFactories(factories);
-  }
-
-  /**
-   * Get the configured set of {@link MetaBeanFactory} objects.
-   * @return {@link MetaBeanFactory} array
-   */
-  public MetaBeanFactory[] getFactories() {
-    return factories;
-  }
-
-  /**
-   * Set the array of {@link MetaBeanFactory} instances with which to enrich {@link MetaBean}s.
-   * @param factories
-   */
-  public void setFactories(MetaBeanFactory[] factories) {
-    this.factories = factories;
-  }
-
-  /**
-   * Build a {@link MetaBean} for a given id.
-   * @param beanInfoId
-   * @return MetaBean
-   * @throws Exception if unable to build
-   */
-  public MetaBean buildForId(String beanInfoId) throws Exception {
-    throw new IllegalArgumentException("MetaBean " + beanInfoId + " not found");
-  }
-
-  /**
-   * Build beans for all known ids.  Default implementation returns an empty map.
-   * @return Map of String : MetaBean
-   */
-  public Map<String, MetaBean> buildAll() throws Exception {
-    return new HashMap<String, MetaBean>();
-  }
-
-  /**
-   * Find the named class.
-   * @param className
-   * @return Class found or null
-   */
-  protected Class<?> findLocalClass(String className) {
-    if (className != null) {
-      try {
-        return ClassUtils.getClass(className);
-      } catch (ClassNotFoundException e) {
-        log.trace("class not found: " + className, e);
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Build a MetaBean for the specified class.
-   * @param clazz
-   * @return MetaBean
-   * @throws Exception
-   */
-  public MetaBean buildForClass(Class<?> clazz) throws Exception {
-    MetaBean meta = new MetaBean();
-    if (clazz != null) { // local class here?
-      meta.setBeanClass(clazz);
-      meta.setId(clazz.getName()); // default id = full class name!
+    /**
+     * Set the array of {@link MetaBeanFactory} instances with which to enrich
+     * {@link MetaBean}s.
+     * 
+     * @param factories
+     */
+    public void setFactories(MetaBeanFactory[] factories) {
+        this.factories = factories;
     }
-    for (MetaBeanFactory factory : factories) {
-      factory.buildMetaBean(meta);
+
+    /**
+     * Build a {@link MetaBean} for a given id.
+     * 
+     * @param beanInfoId
+     * @return MetaBean
+     * @throws Exception
+     *             if unable to build
+     */
+    public MetaBean buildForId(String beanInfoId) throws Exception {
+        throw new IllegalArgumentException("MetaBean " + beanInfoId + " not found");
+    }
+
+    /**
+     * Build beans for all known ids. Default implementation returns an empty
+     * map.
+     * 
+     * @return Map of String : MetaBean
+     */
+    public Map<String, MetaBean> buildAll() throws Exception {
+        return new HashMap<String, MetaBean>();
+    }
+
+    /**
+     * Find the named class.
+     * 
+     * @param className
+     * @return Class found or null
+     */
+    protected Class<?> findLocalClass(String className) {
+        if (className != null) {
+            try {
+                return ClassUtils.getClass(className);
+            } catch (ClassNotFoundException e) {
+                log.trace("class not found: " + className, e);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Build a MetaBean for the specified class.
+     * 
+     * @param clazz
+     * @return MetaBean
+     * @throws Exception
+     */
+    public MetaBean buildForClass(Class<?> clazz) throws Exception {
+        MetaBean meta = new MetaBean();
+        if (clazz != null) { // local class here?
+            meta.setBeanClass(clazz);
+            meta.setId(clazz.getName()); // default id = full class name!
+        }
+        for (MetaBeanFactory factory : factories) {
+            factory.buildMetaBean(meta);
+        }
+        return meta;
     }
-    return meta;
-  }
 
 }



Mime
View raw message