KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > kilim > description > InlinedElement


1 /**
2  * Copyright (C) 2002 Kelua SA
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package org.objectweb.kilim.description;
20
21 import org.objectweb.kilim.KilimException;
22
23 /**
24  * @author horn
25  * Superinterface of all of {@link Template}-contained constructs.
26  * {@see Template}
27  */

28 public abstract class InlinedElement extends TemplateElementImpl implements BasicElement {
29     //private TemplateDescription containingTemplate;
30
private boolean isProvider;
31     private boolean isTransformer;
32     private String JavaDoc name;
33         
34     /**
35      * The protected constructor of an inlined element.
36      * @param isP : is true when element is a provider
37      * @param isT : is true when the element is a transformer
38      * @param aTemplate : the templatye in which the element is defined.
39      * @throws KilimException :
40      */

41     protected InlinedElement(boolean isP, boolean isT, TemplateDescription aTemplate) throws KilimException {
42         isProvider = isP;
43         isTransformer = isT;
44         setContainingTemplate(aTemplate);
45         name = "%inlined" + KILIM.getUniqueIndex();
46     }
47     
48     /**
49      * Every Kilim element has a name (for debugging purposes). This method sets the local name of an inlined element.
50      * @return String
51      */

52     public String JavaDoc getLocalName() {
53         return name;
54     }
55     
56     /**
57      * sets the local name of an inlined element. This name is for debugging purpouse only.
58      * @param aName : the local name
59      * @throws KilimException : never generated.
60      */

61     public void setLocalName(String JavaDoc aName) throws KilimException {
62         name = aName;
63     }
64     
65     /**
66      * @see org.objectweb.kilim.description.TemplateElement#setStatus(int)
67      */

68     public void setStatus(int aStatus) throws KilimException {
69         throw new KilimException("attempt to set a status to an inlined element in template " + getContainingTemplate().getName());
70     }
71     
72     /**
73      * @see org.objectweb.kilim.description.TemplateElement#getStatus()
74      */

75     public int getStatus() throws KilimException {
76         throw new KilimException("attempt to get the status of an inlined element in template " + getContainingTemplate().getName());
77     }
78             
79     /**
80      * @see org.objectweb.kilim.description.TemplateElement#providesValue()
81      */

82     public boolean providesValue() {
83         return isProvider;
84     }
85     
86     /**
87      * @see org.objectweb.kilim.description.TemplateElement#performsAction()
88      */

89     public boolean performsAction() {
90         return isTransformer;
91     }
92     
93     /**
94      * @see org.objectweb.kilim.description.TemplateElement#isEventSource()
95      */

96     public boolean isEventSource() {
97         return false;
98     }
99 }
Popular Tags