if (pArgs.length > 0 && pArgs[0] != null) {
propName = pArgs[0];
}
System.out.println("Getting Property: " + propName);
List books = createBooks();
Iterator i = books.iterator();
while( i.hasNext() ) {
Book book = (Book) i.next();
Object propVal = null;
try {
propVal = PropertyUtils.getProperty(book, propName);
} catch (Exception e) {
System.out.println(
"Error getting property: "
+ propName
+ ", from book: "
+ book.getName()
+ ", exception: "
+ e.getMessage());
}
System.out.println("Property Value: " + propVal);
}