org.objectweb.kilim.description
Class BasicNamedElementImpl

java.lang.Object
  extended byorg.objectweb.kilim.description.TemplateElementImpl
      extended byorg.objectweb.kilim.description.BasicNamedElementImpl
All Implemented Interfaces:
BasicElement, BasicNamedElement, java.lang.Cloneable, NamedElement, TemplateElement
Direct Known Subclasses:
Port, Property, Provider, Transformer

public abstract class BasicNamedElementImpl
extends TemplateElementImpl
implements BasicNamedElement

Author:
horn

Field Summary
private  boolean isProvider
           
private  boolean isTransformer
           
private  java.lang.String localName
           
private  int status
           
 
Fields inherited from class org.objectweb.kilim.description.TemplateElementImpl
 
Constructor Summary
protected BasicNamedElementImpl(java.lang.String aName, int aStatus, boolean isP, boolean isT)
          This constructor is used internally by the kilim infrastructure.
protected BasicNamedElementImpl(java.lang.String aName, int aStatus, boolean isP, boolean isT, TemplateDescription aTemplate)
          This constructor is used internally by the kilim infrastructure.
 
Method Summary
private  void checkStatus(int aStatus)
           
 java.lang.String getLocalName()
          returns the name of the element.
 int getStatus()
          returns the status of the element.
 boolean isEventSource()
          indicates whether the element is an event source or not.
 boolean performsAction()
          Basic elements either provide values or exceute actions that complete the instatiation process This method.
 boolean providesValue()
          Basic elements either provide values or exceute actions that complete the instatiation process This method.
 void setContainingTemplate(TemplateDescription aTemplate)
          sets the template in which the element is defined.
 void setLocalName(java.lang.String aName)
          sets a name to the element.
 void setStatus(int aStatus)
          sets the element status.
 java.lang.String toString()
           
 
Methods inherited from class org.objectweb.kilim.description.TemplateElementImpl
clone, getContainingTemplate, getTemplateDefHierarchy
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.kilim.description.BasicElement
getKind
 
Methods inherited from interface org.objectweb.kilim.description.TemplateElement
clone, getContainingTemplate, getTemplateDefHierarchy
 

Field Detail

localName

private java.lang.String localName

status

private int status

isProvider

private boolean isProvider

isTransformer

private boolean isTransformer
Constructor Detail

BasicNamedElementImpl

protected BasicNamedElementImpl(java.lang.String aName,
                                int aStatus,
                                boolean isP,
                                boolean isT,
                                TemplateDescription aTemplate)
                         throws KilimException
This constructor is used internally by the kilim infrastructure.

Parameters:
aName - : the name of the basic element.
aStatus - : an int representing the status : should be one of KILIM.PRIVATE, KILIM.PROTECTED, KILIM.PUBLIC.
isP - :is true when the element provides a value (i.e. act as a provider).
isT - : is true when the element performs an action (i.e. act as a transformer).
aTemplate - : the template containing the element.
Throws:
KilimException - : generatyed when the name reference is null, when the template reference is null, when the status value is illegal.

BasicNamedElementImpl

protected BasicNamedElementImpl(java.lang.String aName,
                                int aStatus,
                                boolean isP,
                                boolean isT)
This constructor is used internally by the kilim infrastructure. No check is performed.

Parameters:
aName - : the name of the basic element.
aStatus - : an int representing the status : should be one of KILIM.PRIVATE, KILIM.PROTECTED, KILIM.PUBLIC.
isP - :is true when the element provides a value (i.e. act as a provider).
isT - : is true when the element performs an action (i.e. act as a transformer).
Method Detail

getLocalName

public java.lang.String getLocalName()
Description copied from interface: NamedElement
returns the name of the element.

Specified by:
getLocalName in interface NamedElement
Returns:
String
See Also:
org.objectweb.kilim.description.TemplateElement#getLocalName()

setLocalName

public void setLocalName(java.lang.String aName)
                  throws KilimException
Description copied from interface: NamedElement
sets a name to the element.

Specified by:
setLocalName in interface NamedElement
Parameters:
aName - : the name to be set
Throws:
KilimException - : generated when aName is null.
See Also:
org.objectweb.kilim.description.TemplateElement#setLocalName(String)

getStatus

public int getStatus()
Description copied from interface: NamedElement
returns the status of the element.

Specified by:
getStatus in interface NamedElement
Returns:
int. The value is one of KILIM.PRIVATE, KILIM.PROTECTED, KILIM.PUBLIC.
See Also:
org.objectweb.kilim.description.TemplateElement#getStatus()

setStatus

public void setStatus(int aStatus)
               throws KilimException
Description copied from interface: NamedElement
sets the element status.

Specified by:
setStatus in interface NamedElement
Parameters:
aStatus - : The value must be one of KILIM.PRIVATE, KILIM.PROTECTED, KILIM.PUBLIC.
Throws:
KilimException - generated if the value for aStatus is not valid.
See Also:
org.objectweb.kilim.description.TemplateElement#setStatus(int)

providesValue

public boolean providesValue()
Description copied from interface: BasicElement
Basic elements either provide values or exceute actions that complete the instatiation process This method. indicates whether the element returns a value in the Kilim model. The result is true for providers, ports, properties, inlined getters inlined news, constructors, methods which do not return void. It also return true for references to the elements previously defined (i.e. ports, properties, .).

Specified by:
providesValue in interface BasicElement
Returns:
boolean
See Also:
org.objectweb.kilim.description.TemplateElement#providesValue()

performsAction

public boolean performsAction()
Description copied from interface: BasicElement
Basic elements either provide values or exceute actions that complete the instatiation process This method. indicates whether the element performs an action and can therefore been used in a trigger. The result is true for transformers, inlined setter, inlined news, methods, and constructors. It also return true for references to the elements previously defined (setters, methods, ...).

Specified by:
performsAction in interface BasicElement
Returns:
boolean
See Also:
org.objectweb.kilim.description.TemplateElement#performsAction()

isEventSource

public boolean isEventSource()
Description copied from interface: BasicElement
indicates whether the element is an event source or not.

Specified by:
isEventSource in interface BasicElement
Returns:
boolean
See Also:
BasicElement.isEventSource()

setContainingTemplate

public void setContainingTemplate(TemplateDescription aTemplate)
                           throws KilimException
Description copied from interface: TemplateElement
sets the template in which the element is defined.

Specified by:
setContainingTemplate in interface TemplateElement
Overrides:
setContainingTemplate in class TemplateElementImpl
Throws:
KilimException
See Also:
TemplateElement.setContainingTemplate(TemplateDescription)

toString

public java.lang.String toString()
See Also:
Object.toString()

checkStatus

private void checkStatus(int aStatus)
                  throws KilimException
Throws:
KilimException