01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.portal.factory.impl;
18:
19: import org.apache.cocoon.portal.aspect.impl.AbstractAspectalizable;
20: import org.apache.cocoon.portal.factory.Producible;
21: import org.apache.cocoon.portal.factory.ProducibleDescription;
22:
23: /**
24: * This interface marks an object that can be created by a factory.
25: *
26: * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
27: *
28: * @version CVS $Id: AbstractProducible.java 433543 2006-08-22 06:22:54Z crossley $
29: */
30: public abstract class AbstractProducible extends AbstractAspectalizable
31: implements Producible {
32:
33: protected String name;
34:
35: protected String id;
36:
37: transient protected ProducibleDescription description;
38:
39: /**
40: * @return The configured name
41: */
42: public String getName() {
43: return name;
44: }
45:
46: /**
47: * @param string
48: */
49: public void setName(String string) {
50: name = string;
51: }
52:
53: /**
54: * Set the layout description
55: */
56: public void setDescription(ProducibleDescription description) {
57: this .description = description;
58: }
59:
60: /**
61: * Get the unique id of this object
62: * @return String Unique id
63: */
64: public String getId() {
65: return this .id;
66: }
67:
68: /**
69: * Set the unique id of this object
70: */
71: public void setId(String id) {
72: this .id = id;
73: }
74:
75: /**
76: * Initialize the object. This should only be called once directly
77: * after the creation
78: */
79: public void initialize(String name, String id) {
80: this .name = name;
81: this .id = id;
82: }
83:
84: /* (non-Javadoc)
85: * @see java.lang.Object#clone()
86: */
87: protected Object clone() throws CloneNotSupportedException {
88: AbstractProducible clone = (AbstractProducible) super.clone();
89:
90: clone.name = this.name;
91: clone.id = this.id;
92: clone.description = this.description;
93:
94: return clone;
95: }
96:
97: }
|