KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > layout > impl > CopletLayout


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.layout.impl;
17
18 import org.apache.cocoon.portal.coplet.CopletInstanceData;
19 import org.apache.cocoon.portal.layout.AbstractLayout;
20 import org.apache.cocoon.portal.layout.Layout;
21
22 /**
23  * A coplet layout holds a coplet.
24  *
25  *
26  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
27  * @author <a HREF="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
28  *
29  * @version CVS $Id: CopletLayout.java 158045 2005-03-18 09:33:36Z cziegeler $
30  */

31 public final class CopletLayout extends AbstractLayout {
32     
33     private CopletInstanceData copletInstanceData;
34     
35     public void setCopletInstanceData(CopletInstanceData cid) {
36         this.copletInstanceData = cid;
37         if ( this.getId() == null ) {
38             this.setId(cid.getId());
39         }
40     }
41     
42     public CopletInstanceData getCopletInstanceData() {
43         return this.copletInstanceData;
44     }
45
46     /* (non-Javadoc)
47      * @see java.lang.Object#clone()
48      */

49     protected Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
50         CopletLayout clone = (CopletLayout)super.clone();
51         
52         clone.copletInstanceData = null;
53         
54         return clone;
55     }
56     
57     /* (non-Javadoc)
58      * @see org.apache.cocoon.portal.layout.Layout#copy()
59      */

60     public Layout copy() {
61         CopletLayout clone = (CopletLayout)super.copy();
62
63         if ( this.copletInstanceData != null ) {
64             clone.copletInstanceData = this.copletInstanceData.copy();
65         }
66             
67         return clone;
68     }
69 }
70
Popular Tags