org.objectweb.kilim.description
Class Instance

java.lang.Object
  extended byorg.objectweb.kilim.description.TemplateElementImpl
      extended byorg.objectweb.kilim.description.Instance
All Implemented Interfaces:
java.lang.Cloneable, NamedElement, TemplateElement

public class Instance
extends TemplateElementImpl
implements NamedElement

Author:
horn

Field Summary
private  java.lang.String localName
           
private  int status
           
private  TemplateDescription template
           
 
Fields inherited from class org.objectweb.kilim.description.TemplateElementImpl
 
Constructor Summary
Instance(java.lang.String aName, int aStatus, TemplateDescription aTemplate, TemplateDescription aContain)
          Constructs a new Instance in a template
 
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.
 TemplateDescription getTemplate()
          returns the template describing the instance.
 void setLocalName(java.lang.String aName)
          sets a name to the element.
 void setStatus(int aStatus)
          sets the element status.
 void setTemplate(TemplateDescription aTemplate)
          set the template describing the instance.
 java.lang.String toString()
           
 
Methods inherited from class org.objectweb.kilim.description.TemplateElementImpl
clone, getContainingTemplate, getTemplateDefHierarchy, setContainingTemplate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.kilim.description.TemplateElement
clone, getContainingTemplate, getTemplateDefHierarchy, setContainingTemplate
 

Field Detail

localName

private java.lang.String localName

status

private int status

template

private TemplateDescription template
Constructor Detail

Instance

public Instance(java.lang.String aName,
                int aStatus,
                TemplateDescription aTemplate,
                TemplateDescription aContain)
         throws KilimException
Constructs a new Instance in a template

Parameters:
aName - identifies the Instance in its Template
aStatus - :indicates the status of the template (should be one of KILIM.PUBLIC, KILIM.PROTECTED, KILIM.PRIVATE)
aTemplate - :indicates the templates in which the template is defined.
aContain - :
Throws:
KilimException - : thrown when the name is null or the statu illegal.
Method Detail

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:
NamedElement.setLocalName(String)

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:
NamedElement.getLocalName()

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:
NamedElement.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)

getTemplate

public TemplateDescription getTemplate()
returns the template describing the instance.

Returns:
String

setTemplate

public void setTemplate(TemplateDescription aTemplate)
set the template describing the instance.

Parameters:
aTemplate - :

toString

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

checkStatus

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