Validating a class model

Open ModelSphere has more flexibility in class modeling than what the Java language permits.
To ensure that the generated code is Java conform, the application has a validation function.
Use this powerful feature to monitor potential errors in your
Java code as you build your models. You can choose to validate a class, a group of
classes (package-level), or all the classes in a model (project-level).
Follow these
easy steps:
- Highlight the class model
- In the menu choose Tools > Validate for Java
- A report will appear indicating if and where the model is not valid. It is also
possible to save or print the report using the File menu.
Class/Exception/Interface (Abstract Data Type - adt)
Validations
- unicity of the nested/inner adt name inside the containment hierarchy
- unicity of the nested/inner adt name inside nested/inner adts at the same level
- unicity of the adt name inside the same package
- unicity of the compilation unit name inside the same package
- an interface member adt cannot be declared private, protected or package
- package adt cannot be declared static nested adt
- a class cannot be final and abstract adt inheritance
- accessibility to superclass/superinterface
- a superclass cannot be a final class
- an interface cannot inherit from a superclass
- a class cannot inherit from one of its nested/inner class adt superinterface
- an interface cannot inherit from one of its nested interface end enumeration of adt ancestors
- a class can only inherit from one direct superclass at a time
- a class/an interface cannot implement/extend the same direct superinterface more than one time
- abstract supermethods implement adt components declaration validations
- an adt cannot contain two fields with the same name
- an adt cannot contain two inner/nested adts at the same level with the same name
- an nested adt cannot contain a sister (at the same level ) inner/nested adt with the same name
- an adt cannot contain two operations (two methods or two constructors) with the same signature fields validations
Field Type Validations
- accessibility to type of field
Class Field Validations
- a field of a class cannot be declared final and volatile
- a field of an inner class cannot be declared static
Interface Field Validations
- a field of an interface cannot be declared private, protected or package.
- a field of an interface cannot be declared transient.
- a (final) field of an interface cannot be declared volatile.
Operations Method Parameters Validations
- parameters must be typed.
- accessibility to type of parameter.
- two parameters of an adt method cannot have the same class or exception name.
Class Method Validations
- a field of an inner class cannot be declared static
- an abstract method must appear within an abstract class
- a class method cannot be declared abstract and private
- a class method cannot be declared abstract and final
- a class method cannot be declared abstract and static
- a class method cannot be declared abstract and synchronized
- a class method cannot be declared abstract and native
- an abstract method cannot have body.
Interface Method Validations
- a method of an interface cannot be declared private, protected or package
- a (abstract) method of an interface cannot be declared final
- a (abstract) method of an interface cannot be declared static
- a (abstract) method of an interface cannot be declared synchronized
- a (abstract) method of an interface cannot be declared native
- a (abstract) method of an interface cannot have body
- an overriding or hiding method must have the same return type than overridden method
- a method cannot override or hide a method with weaker access privilege
- a final method of a class cannot be hidden or overridden
- a static method of a class cannot hide an instance method
- a instance method cannot override a static method of a class
- an overriding or hiding method may not be declared to throw more checked exceptions than overridden or hidden method.