01: /*
02: * Copyright 2002,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
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
35: + ";product=" + product + "]";
36: }
37:
38: /**
39: * Factory method to create a new Product
40: */
41: public Product createProduct() {
42: return new Product();
43: }
44:
45: /**
46: * Returns the amount.
47: * @return int
48: */
49: public int getAmount() {
50: return amount;
51: }
52:
53: /**
54: * Returns the price.
55: * @return double
56: */
57: public double getPrice() {
58: return price;
59: }
60:
61: /**
62: * Sets the amount.
63: * @param amount The amount to set
64: */
65: public void setAmount(int amount) {
66: this .amount = amount;
67: }
68:
69: /**
70: * Sets the price.
71: * @param price The price to set
72: */
73: public void setPrice(double price) {
74: this .price = price;
75: }
76:
77: /**
78: * Returns the product.
79: * @return Product
80: */
81: public Product getProduct() {
82: return product;
83: }
84:
85: /**
86: * Sets the product.
87: * @param product The product to set
88: */
89: public void setProduct(Product product) {
90: this.product = product;
91: }
92:
93: }
|