1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.jelly.core;
17
18 /***
19 * A sample bean that we can construct via Jelly tags
20 *
21 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
22 * @version $Revision: 155420 $
23 */
24 public class Order {
25
26 private Product product;
27 private int amount;
28 private double price;
29
30 public Order() {
31 }
32
33 public String toString() {
34 return "Order[amount=" + amount + ";price=" + price + ";product=" + product + "]";
35 }
36
37 /***
38 * Factory method to create a new Product
39 */
40 public Product createProduct() {
41 return new Product();
42 }
43
44 /***
45 * Returns the amount.
46 * @return int
47 */
48 public int getAmount() {
49 return amount;
50 }
51
52 /***
53 * Returns the price.
54 * @return double
55 */
56 public double getPrice() {
57 return price;
58 }
59
60 /***
61 * Sets the amount.
62 * @param amount The amount to set
63 */
64 public void setAmount(int amount) {
65 this.amount = amount;
66 }
67
68 /***
69 * Sets the price.
70 * @param price The price to set
71 */
72 public void setPrice(double price) {
73 this.price = price;
74 }
75
76 /***
77 * Returns the product.
78 * @return Product
79 */
80 public Product getProduct() {
81 return product;
82 }
83
84 /***
85 * Sets the product.
86 * @param product The product to set
87 */
88 public void setProduct(Product product) {
89 this.product = product;
90 }
91
92 }