[an error occurred while processing this directive]

JavaClass Class Client Specifications


Purpose

A JavaClass object contains documentation, package and file information, and feature definitions for a Java class. These objects represent Java classes in a CASE tool for developing software in Java.

Superclasses and Interfaces

Superclass: Object

Importing Information

import javacase.JavaClass;

Client Data Model

A JavaClass manages the following types of information about a Java class: Methods are provided for setting and getting all information for a JavaClass, except that some information cannot be set for data integrity reasons described below. Features can be accessed individually by name (variables) or signature (methods). Features can also be accessed as collections using traversals.

Documentation about features of a Java class is not maintained directly by JavaClass objects. This documentation can be accessed through the features of the class.

Data Integrity
The most important data integrity consideration concerns the parent of a JavaClass. Since the graph of the parent relationship cannot contain cycles, assigning class A as a parent of class B is not permitted when B is an ancestor of A. The ancestral relationship is defined recursively as follows. B is an ancestor of A if either B is the same as A or if B is the parent of C, where C is an ancestor of A.

Data integrity could also be corrupted by inconsistency between package location and importing information. To avoid this problem, there is no provision for setting the importing information. The importing information text is constructed from the package information of the JavaClass. This is set when the class is added to a JavaPackage.

Finally, there are data integrity requirements imposed by the Java language definition with regard to source code file names. The language requires that code for a public class be located in a file whose name is the class name with a .java suffix. Thus a public Java class cannot be moved to a different source code file.

Method Preconditions
Some of the JavaClass methods have preconditions. Methods are provided for checking these preconditions prior to executing the method. If the check fails then the program is terminated with a IllegalArgumentException exception.

Public Methods

Constructors
Source Code Information
Inheritance Information
Documentation
Individual Feature Information
Feature Traversal
[an error occurred while processing this directive]