commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Commons Wiki] Update of "BeanUtils/FAQ" by xiaogan21st
Date Sun, 17 Apr 2011 10:08:05 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification.

The "BeanUtils/FAQ" page has been changed by xiaogan21st.
http://wiki.apache.org/commons/BeanUtils/FAQ?action=diff&rev1=7&rev2=8

--------------------------------------------------

  BeanUtils uses '.' as a property separator, and the second property should actually used
mapped syntax, since it is directly accessing a map now, thus the correct usage should be:
  String val = PropertyUtils.getProperty(bean, "map(key1).key2");
  
+ 
+ === Why does it omit some properties when call BeanUtils.describe? ===
+ say you get a dto Type through wsimport tools:
+ package local;
+ import java.io.Serializable;
+ import java.util.ArrayList;
+ import java.util.List;
+ import javax.xml.bind.annotation.XmlAccessType;
+ import javax.xml.bind.annotation.XmlAccessorType;
+ import javax.xml.bind.annotation.XmlAnyElement;
+ import javax.xml.bind.annotation.XmlElement;
+ import javax.xml.bind.annotation.XmlType;
+ import org.w3c.dom.Element;
+ /**
+  * 
+  *         Container for data on one listing category.
+  * 			
+  * 
+  * <p>Java class for CategoryType complex type.
+  * 
+  * <p>The following schema fragment specifies the expected content contained within
this class.
+  * 
+  * <pre>
+  * &lt;complexType name="CategoryType">
+  *   &lt;complexContent>
+  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+  *       &lt;sequence>
+  *         &lt;element name="BestOfferEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean"
minOccurs="0"/>
+  *         &lt;any/>
+  *       &lt;/sequence>
+  *     &lt;/restriction>
+  *   &lt;/complexContent>
+  * &lt;/complexType>
+  * </pre>
+  * 
+  * 
+  */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "CategoryType", propOrder = {
+     "bestOfferEnabled"
+ })
+ public class CategoryType
+     implements Serializable
+ {
+ 
+     private final static long serialVersionUID = 12343L;
+     @XmlElement(name = "BestOfferEnabled")
+     protected Boolean bestOfferEnabled;
+ 
+     /**
+      * Gets the value of the bestOfferEnabled property.
+      * 
+      * @return
+      *     possible object is
+      *     {@link Boolean }
+      *     
+      */
+     public Boolean isBestOfferEnabled() {
+         return bestOfferEnabled;
+     }
+ 
+     /**
+      * Sets the value of the bestOfferEnabled property.
+      * 
+      * @param value
+      *     allowed object is
+      *     {@link Boolean }
+      *     
+      */
+     public void setBestOfferEnabled(Boolean value) {
+         this.bestOfferEnabled = value;
+     }
+ 
+ }
+ 
+ i run this mian method:
+ 	public static void main(String[] args){
+ 		CategoryType type = new CategoryType();
+ 		try{
+ 			System.out.println(BeanUtils.describe(type));
+ 		}catch(Exception e){
+ 			e.printStackTrace();
+ 		}
+ 		
+ 	}
+ 
+ get the result:
+ {class=class local.CategoryType}
+ 
+ it omits bestOfferEnabled property.
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message