Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: FAQ is not the place to ask questions, that is the user's list for.

...

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>
  • <complexType name="CategoryType">
  • <complexContent>
  • <restriction base="{http://www.w3.org/2001/XMLSchema\}anyType">
  • <sequence>
  • <element name="BestOfferEnabled" type="{http://www.w3.org/2001/XMLSchema\}boolean" minOccurs="0"/>
  • <any/>
  • </sequence>
  • </restriction>
  • </complexContent>
  • </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;
    }

}

Wiki Markup
I run this main method:
	public static void main(String\[\] args)\{
		[CategoryType] type = new [CategoryType]();
		try\{
			System.out.println(BeanUtils.describe(type));
		\}catch(Exception e)\{
			e.printStackTrace();
		\}

}

get this result:
{class=class local.CategoryType}

it omits bestOfferEnabled property.