KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > factory > impl > AbstractProducible


1 /*
2  * Copyright 1999-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.cocoon.portal.factory.impl;
17
18 import org.apache.cocoon.portal.aspect.impl.AbstractAspectalizable;
19 import org.apache.cocoon.portal.factory.Producible;
20 import org.apache.cocoon.portal.factory.ProducibleDescription;
21
22
23
24 /**
25  * This interface marks an object that can be created by a factory.
26  *
27  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
28  *
29  * @version CVS $Id: AbstractProducible.java 37334 2004-09-01 11:29:10Z cziegeler $
30  */

31 public abstract class AbstractProducible
32     extends AbstractAspectalizable
33     implements Producible {
34     
35     protected String JavaDoc name;
36
37     protected String JavaDoc id;
38     
39     transient protected ProducibleDescription description;
40     
41     /**
42      * @return The configured name
43      */

44     public String JavaDoc getName() {
45         return name;
46     }
47
48     /**
49      * @param string
50      */

51     public void setName(String JavaDoc string) {
52         name = string;
53     }
54
55     /**
56      * Set the layout description
57      */

58     public void setDescription(ProducibleDescription description) {
59         this.description = description;
60     }
61
62     /**
63      * Get the unique id of this object
64      * @return String Unique id
65      */

66     public String JavaDoc getId() {
67         return this.id;
68     }
69
70     /**
71      * Set the unique id of this object
72      */

73     public void setId(String JavaDoc id) {
74         this.id = id;
75     }
76
77     /**
78      * Initialize the object. This should only be called once directly
79      * after the creation
80      */

81     public void initialize(String JavaDoc name, String JavaDoc id) {
82         this.name = name;
83         this.id = id;
84     }
85
86     /* (non-Javadoc)
87      * @see java.lang.Object#clone()
88      */

89     protected Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
90         AbstractProducible clone = (AbstractProducible)super.clone();
91         
92         clone.name = this.name;
93         clone.id = this.id;
94         clone.description = this.description;
95         
96         return clone;
97     }
98     
99 }
100
Popular Tags