FileDocCategorySizeDatePackage
UMLElement.javaAPI DocExample13843Tue Dec 08 01:21:00 GMT 1998oisoft.togetherx.scriptapi.UML

UMLElement.java

/*----------------------------------------------------------------------------
Copyright © 1998 Object International Software GmbH
----------------------------------------------------------------------------*/
package oisoft.togetherx.scriptapi.UML;

import java.util.Properties;
import oisoft.togetherx.scriptapi.UML.enums.*;
import java.io.File;

//------------------------------------------------------------------------------
/**                                                              
 ** <i>UMLElement</i> is an atomic constituent of the model.     
 ** It defines common functionality for all the model elements.  
 ** It is the top interface in the inheritance hierarchy of      
 ** UML interfaces.                                              
 ** @version  2.1.05  14.07.1998                                   
 ** @author   Andrei Ivanov                                      
 ** @see UMLModel                                                
*/
public interface UMLElement
{
  /** One of the visibility constants returned by <i>getVisibility()</i> method.
   *  @see UMLElement#getVisibility
   */
  public static final String  PUBLIC      = "Public";
  /** One of the visibility constants returned by <i>getVisibility()</i> method.
   *  @see UMLElement#getVisibility 
   */
  public static final String  PRIVATE     = "Private";
  /** One of the visibility constants returned by <i>getVisibility()</i> method.
   *  @see UMLElement#getVisibility
   */
  public static final String  PROTECTED   = "Protected";
  /** One of the visibility constants returned by <i>getVisibility()</i> method.
    * @see UMLElement#getVisibility
    */
  public static final String  PACKAGE     = "Package";

  /** One of the language constants returned by <i>getLanguage()</i> method.
    * @see UMLElement#getLanguage
    */
  public static final String  JAVA        = "Java";
  /** One of the language constants returned by <i>getLanguage()</i> method.
    * @see UMLElement#getLanguage
    */
  public static final String  CPP         = "C++";
  /** One of the language constants returned by <i>getLanguage()</i> method.
    * @see UMLElement#getLanguage
    */
  public static final String  OCOBOL      = "ObjectCobol";


  /**Getting element's name.
   * You can get element's name using 4 kinds of
   * string descriptions returned by the following 4 functions:<br>
   *   getName() - short name;<br>
   *   getQualifiedName() - full qualified name;<br>
   *   toLongString() -  long description of element;<br>
   *   toShortString() - short description of element;<br>
   * 
   * This method <i>getName()</i> returns the short name of element.
   * For example, for interface
   * <i>oisoft.togetherx.UML.UMLElement</i> it returns
   * "UMLElement"
   *
   * @return Short name of the element
   * @see UMLElement#getQualifiedName
   * @see UMLElement#toLongString
   * @see UMLElement#toShortString
   */
  String getName();

  /**Getting element's full qualified name.
   * For example, for interface 
   * <i>oisoft.togetherx.UML.UMLElement</i> it returns  
   * "oisoft.togetherx.UML.UMLElement"
   *
   * @return Full qualified name of the element
   * @see UMLElement#getName
   * @see UMLElement#toLongString
   * @see UMLElement#toShortString
   */
  String getQualifiedName();

  /**Getting element's long description.
   * Use this method when you wish, for instance,
   * insert element's description (declaration) in documentation.
   * For example, for <i>oisoft.togetherx.UML.UMLElement</i>
   * it  returns
   * "public interface UMLElement"
   * @return Description string of the element
   * @see UMLElement#getName
   * @see UMLElement#getQualifiedName
   * @see UMLElement#toShortString
   */
  String toLongString();

  /**Getting element's short description.
   * @deprecated In current implementation it returns the same
   * string as <i>getName()</i>.
   * @return Short description of the element
   * @see UMLElement#getName
   * @see UMLElement#getQualifiedName
   * @see UMLElement#toLongString
   */
  String toShortString();

  /**Returns element's visibility.
   * If visibility semantic is not defined for the element,
   * it returns UMLElement.PUBLIC.
   * @return Visibility of the element, one of the 4 possible constants:<br>
   * UMLElement.PUBLIC,<br>
   * UMLElement.PRIVATE,<br>
   * UMLElement.PROTECTED,<br>
   * UMLElement.PACKAGE
   *
   * @see UMLElement#PUBLIC
   * @see UMLElement#PRIVATE
   * @see UMLElement#PROTECTED
   * @see UMLElement#PACKAGE
   */
  String getVisibility();

  /** Getting properties associated with the element.
   * These cover only design properties, not language-specific properties. 
   * For programming language elements the properties are collected from 
   * the element's Java-style design comment.
   *
   * See <i>Tags</i> interface for list of predefined Together/J tags.
   *
   * @see UMLProperty
   * @see Tags
   * @see UMLElement#hasProperty
   * @see UMLElement#getProperty
   * @return Property Enumerator of tagged values associated with the element.
   * It can be empty; it cannot be null.
   */
  UMLPropertyEnumeration getDocProperties();

  /** Indicates whether the element has specified property.
   * @param property The name of the property. 
   * See <i>Tags</i> interface for list of predefined Together/J tags.
   * @return <b>true</b> if the element has the property with the name passed.
   * @see UMLElement#getProperty
   * @see Tags
   */
  boolean hasProperty(String property);

  /** Getting the value of element's property by name.
   * To get all the properties, use <i>getDocProperties()</i> method.
   * @param property The name of the property. 
   * See <i>Tags</i> interface for list of predefined Together/J tags.
   * @return The string value of the property with the name passed, or
   * null - if the element does not contain this property.
   * @see Tags
   * @see UMLElement#hasProperty
   * @see UMLElement#getDocProperties
   */
  String  getProperty(String property);

  /** Getting all incoming links for the element. 
   * These cover all kinds of links.
   * See <i>UMLLink</i> interface for the list of possible link kinds.
   *
   * @see UMLElement#getOutgoingLinks
   * @see UMLElement#getIncomingLinksByKind
   * @see UMLLink
   * @return Link Enumerator of all the links incoming to the element.
   * It can be empty; it cannot be null.
   */
  UMLLinkEnumeration    getIncomingLinks();

  /** Getting all outgoing links for the element. 
   * These cover all kinds of links.
   * See <i>UMLLink</i> interface for the list of possible link kinds.
   * @see UMLElement#getIncomingLinks
   * @see UMLElement#getOutgoingLinksByKind
   * @see UMLLink
   * @return Link Enumerator of all the links outgoing from the element.
   * It can be empty; it cannot be null.
   */
  UMLLinkEnumeration    getOutgoingLinks();

  /** Getting all the incoming links of the specified kind.
   * See <i>UMLLink</i> interface for the list of possible link kinds.
   * @see UMLElement#getIncomingLinks
   * @see UMLLink
   * @see UMLLink#getLinkKind
   * @param kind The kind of links as defined by <i>UMLLink.getLinkKind()</i>
   * @return Link Enumerator of all the links of the kind passed and 
   * incoming to the element.
   * It can be empty; it cannot be null.
   */
  UMLLinkEnumeration    getIncomingLinksByKind(String kind);

  /** Getting all the outgoing links of the specified kind.
   * See <i>UMLLink</i> interface for the list of possible link kinds.
   * @see UMLElement#getOutgoingLinks
   * @see UMLElement#getIncomingLinksByKind
   * @see UMLLink
   * @see UMLLink#getLinkKind
   * @param kind The kind of links as defined by <i>UMLLink.getLinkKind()</i>
   * @return Link Enumerator of all the links of the kind passed and
   * outgoing from the element.
   * It can be empty; it cannot be null.
   */
  UMLLinkEnumeration    getOutgoingLinksByKind(String kind);

  /** Getting all the elements linked with this by hyperlinks.
   * You can hyperlink elements using the "Hyperlink To" page in
   * the Inspector.
   * @return Element Enumerator of all the elements hyperlinked to this element.
   * It can be empty; it cannot be null.
   */
  UMLElementEnumeration getHyperlinks();

  /** Getting all the file names linked with this by hyperlinks.
   * You can hyperlink files using the "Hyperlink To" page in
   * the Inspector.
   * @return String Enumerator of all the elements hyperlinked to this element.
   * It can be empty; it cannot be null.
   * @since 345
   */
  UMLStringEnumeration getHyperlinkedFiles();

  /** Getting links-attachments to Notes.
   * A Note is a rectangular node in the diagram with text. It can be linked
   * with any other diagram element with a Note link.
   * A note captures the assumptions and decisions applied during
   * analysis and design. Notes may contain any information,
   * including plain text, fragments of code, or references to other
   * documents. A note holds an unlimited amount of text and can be
   * sized accordingly.
   * @see UMLNoteLink
   * @return Note Link Enumerator of all the Note links attaching some notes
   * to the element.
   */
  UMLNoteLinkEnumeration getNoteLinks();

  /** Returns the note text associated with the element
   * This method uses the "@note" comment property.
   * @see UMLElement#getNoteLinks
   * @see UMLNoteLink
   * @see UMLElement#getNoteLinks
   */
  UMLStringEnumeration  getNote();

  /** <i>accept()</i> operation initiates visiting process
   * using the Visitor solution pattern. The classes derived from
   * <i>UMLElement</i> should implement this operation to call the appropriate
   * method of <i>UMLVisitor</i> class, which can be extended by the user
   * with desired functionality.
   * For example, implementation of <i>UMLClass.accept()</i> can look like this:
   * <br><tt>
   * UMLClassImp.accept(UMLVisitor visitor) { <br>
   *   visitor.visitClass(); <br>
   * }
   * <br></tt>
   *
   * @see UMLVisitor
   * @param visitor Visitor that access the element
   */
  void accept(UMLVisitor visitor);

  /** Some physical classes can be presented in the model in a number of instances
   * by importing into logical packages. For all these instances this method 
   * returns the same value.
   * @deprecated Use directly <i>UMLElement.equals()</i> instead
   * @return java.lang.Object, which can be compared 
   */
  Object getIdentityObject();

  /** Returns language identifier of the element. 
   * For the elements not associated with any language
   * constructions, e.g. design elements, it returns UMLElement.JAVA.
   * @return Language identifier of the element, one of the 3 possible 
   * constants:<br>
   * UMLElement.JAVA   - for Java elements <br>
   * UMLElement.CPP    - for C++  elements <br>
   * UMLElement.OCOBOL - for Object COBOL elements <br>
   * @see UMLElement#JAVA
   * @see UMLElement#CPP
   * @see UMLElement#OCOBOL
   */
  String getLanguage();

  /** Getting the file where the element is created, usually declared.
   * The model provides that such a file is unique. To access other files
   * related to the element, e.g. for operation's definition, 
   * use <getFiles()</i> method.
   * Language dependent:<br>
   * For Java and OCOBOL - the file with source code;<br>
   * For C++ - declaration file;<br>
   * For the elements not associated with any language - 
   *   containing diagram file (.vf*).
   * @return  The file of the element. It can be null.
   */
  File getFile();

  /** Getting all files associated with the element.
   * The parameter specifies the kind of files.  
   * Language dependent, different kinds are appropriate for different languages.
   *
   * @deprecated Not implemented yet.
   * @see UMLElement#getFile
   * @param kindOfFile The kind of files being extracted. 
   * Possible values are:<br>
   * "Doc" for Java or C++ element - to get documentation files;<br>
   * "Implementation" for C++ element - to get definition (.cpp) files;<br>
   * ...<i>can be extended</i>...
   * @return File Enumerator of the files of the element. 
   * It can be empty; it cannot be null.
   */
  UMLFileEnumeration getFiles(String kindOfFile);

  /** Indicates whether the element is visible on the diagram.
   *
   * Some elements in diagram can be hidden using "Hide"
   * command of the context menu or using filters
   * in the diagram's Display tab.
   * @return <b>true</b> if the element is not hidden.
   */
  boolean  isVisible();

  /** Indicates whether the element is not imported.
   *
   * Some elements in diagram are physically contained,
   * for example, classes of the package displayed
   * in the physical package diagram.
   * Others are imported, for example, classes from another package
   * imported to a physical package diagram or all classes in
   * a logical package diagram and logical package diagram itself.
   *
   * @return <b>true</b> if the element is not imported.
   *
   */
  boolean  isModelElement();

  /** Indicates whether the element is defined, not only "referenced".
   *
   * Some elements can be referenced with links to it, but are not defined,
   * e.g. have not declaration. For example, you have a class that
   * extends some other class and for the latter class any information are
   * absent. Such classes are called "referenced".
   * @return <b>true</b> if the element is defined in the model.
   */
  boolean  isFullDefined();
}
//------------------------------------------------------------------------------