cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r746577 - in /cxf/branches/2.1.x-fixes: ./ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
Date Sat, 21 Feb 2009 19:56:23 GMT
Author: bimargulies
Date: Sat Feb 21 19:56:22 2009
New Revision: 746577

URL: http://svn.apache.org/viewvc?rev=746577&view=rev
Log:
Merged revisions 746572 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r746572 | bimargulies | 2009-02-21 14:49:05 -0500 (Sat, 21 Feb 2009) | 2 lines
  
  Cleanup inspired by CXF-2044.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java?rev=746577&r1=746576&r2=746577&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
Sat Feb 21 19:56:22 2009
@@ -56,8 +56,12 @@
 /**
  * Serializes JavaBeans.
  * 
- * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
- * @author <a href="mailto:jack.xu.hong@gmail.com">Jack Hong</a>
+ * There's a really dangerous coding convention in this class, maintainers beware.
+ * There are two constructor. The no-args constructor defers, until later,
+ * the construction of a BeanTypeInfo. The one-arg constructor gets the BeanTypeInfo passed
as a parameter.
+ * Aegis doesn't have any uniform discipline of 'construct, set properties, initialize'.
Instead,
+ * each piece of code that uses the type info needs to call getTypeInfo() instead of referencing
the
+ * 'info' field. 
  */
 public class BeanType extends Type {
     private BeanTypeInfo info;
@@ -66,9 +70,17 @@
 
     private boolean isException;
 
+    /**
+     * Construct a type info. Caller must pass in the type class via 
+     * setTypeClass later.
+     */
     public BeanType() {
     }
 
+    /**
+     * Construct a type info given a full BeanTypeInfo.
+     * @param info
+     */
     public BeanType(BeanTypeInfo info) {
         this.info = info;
         this.typeClass = info.getTypeClass();
@@ -80,10 +92,8 @@
         isException = Exception.class.isAssignableFrom(typeClass);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.codehaus.xfire.aegis.type.Type#readObject(org.codehaus.xfire.aegis.MessageReader,
-     * org.codehaus.xfire.MessageContext)
+    /**
+     * {@inheritDoc}
      */
     @Override
     public Object readObject(MessageReader reader, Context context) throws DatabindingException
{
@@ -447,6 +457,9 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void setTypeClass(Class typeClass) {
         super.setTypeClass(typeClass);
@@ -464,6 +477,9 @@
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Set<Type> getDependencies() {
         Set<Type> deps = new HashSet<Type>();
@@ -526,6 +542,10 @@
         return elementTypeInfo;
     }
 
+    /**
+     * Return the Type for the superclass if this type's class, if any.
+     * @return
+     */
     public Type getSuperType() {
         BeanTypeInfo inf = getTypeInfo();
         Class c = inf.getTypeClass().getSuperclass();
@@ -550,6 +570,10 @@
         }
     }
 
+    /**
+     * Return the type info.
+     * @return
+     */
     public BeanTypeInfo getTypeInfo() {
         if (info == null) {
             info = createTypeInfo();
@@ -560,6 +584,10 @@
         return info;
     }
 
+    /**
+     * Create type info based in the type class.
+     * @return
+     */
     public BeanTypeInfo createTypeInfo() {
         BeanTypeInfo inf = new BeanTypeInfo(getTypeClass(), getSchemaType().getNamespaceURI());
 
@@ -568,6 +596,9 @@
         return inf;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public String toString() {
         StringBuffer sb = new StringBuffer();
@@ -588,6 +619,9 @@
         XmlSchemaUtils.addImportIfNeeded(root, AbstractXOPType.XML_MIME_NS);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public long getMinOccurs() {
         return getTypeInfo().getMinOccurs();
@@ -602,6 +636,7 @@
     public void setTypeMapping(TypeMapping typeMapping) {
         super.setTypeMapping(typeMapping);
         if (info != null) {
+            // this seems dangerous .. what if the type info is later created, it won't be
passed the mapping.
             info.setTypeMapping(typeMapping);
         }
     }



Mime
View raw message