5.2.4.2 Implements Directive

 implements-directive = "Implements" class-type-name 

Static Semantics.

  • An <implements-directive> cannot occur within an extension module.

  • The specified class of the <class-type-name> is called the interface class.

  • The interface class can’t be the class defined by the class module containing the <implements-directive>

  • A specific class can’t be identified as an interface class in more than one <implements-directive> in the same class module.

  • The unqualified class names of all the interface classes in the same class module MUST be distinct from each other.

  • The name value of the interface class’s class name with an appended underscore character (Unicode u+005F) is an implemented interface name prefix within the class module containing this directive.

  • If a class module contains more than one <implements-directive> then none of its implemented interface name prefixes can be occur as the initial text of any other of its implemented name prefix.

  • A class can’t be used as an interface class if the names of any of its public variable or method methods contain an underscore character (Unicode u+005F).

  • A class module containing an <implements-directive> MUST contain an implemented name declaration corresponding to each public method declaration contained within the interface class’ class module.

  • A class module containing an <implements-directive> MUST contain an implemented name declaration corresponding to each public variable declaration contained within the interface class’ class module. The set of required implemented name declarations depends upon of the declared type of the public variable as follows:

    • If the declared type of the variable is Variant there MUST be three corresponding implemented name declarations including a <property-get-declaration> and a <property-lhs-declaration>.

    • If the declared type of the variable is Object or a named class there MUST be two corresponding implemented name declarations including a <property-get-declaration> and a <property-lhs-declaration>.

    • If the declared type of the variable is anything else, there MUST be two corresponding implemented name declarations including a <property-get-declaration> and a <property-lhs-declaration>.