KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > jelly > core > Order


1 /*
2  * Copyright 2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 JavaDoc 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 }
93
Popular Tags