The Method-ID Paragraph

General Format


*

Syntax Rules

  1. Literal-1 must be an alphanumeric literal and must not be a figurative constant.
  2. If property-name-1 is specified as a data-name in the Working-Storage Section of the containing object or factory definition, the PROPERTY clause must not be specified in the data description entry of that data-name.
  3. If the GET phrase is specified, then the method must have no USING phrase parameters specified in the PROCEDURE DIVISION header and must have a single RETURNING phrase.
  4. If the SET phrase is specified, then the method must have a single USING parameter specified in the PROCEDURE DIVISION header and no RETURNING phrase.
  5. The OVERRIDE phrase must not be specified in a method prototype.
  6. If the OVERRIDE phrase is specified, there must be a method with the same name as the method declared by this method definition defined in a superclass. The method in the superclass must not be defined with the FINAL clause.
  7. If the OVERRIDE phrase is not specified:
    1. If this method definition is contained in a class definition, no inherited method may have the same name as the method declared by this method definition
    2. If this method definition is contained in an interface definition, no inherited method prototype may have the same name as the method prototype declared by this method definition.
  8. If the REDEFINE phrase is specified, there must be a method with the same name as the method declared by this method definition defined in a superclass.
  9. The FINAL clause must not be specified in a method prototype.
  10. If method-name-1 or literal-1 is the same as a method-name inherited by the containing definition, the parameter declarations and returning item in the PROCEDURE DIVISION header must obey the rules of conformance to ensure that the definition that contains this method definition conforms to every inherited definition according to the section Conformance for Parameters and Returning Items in the chapter Procedure Division.
  11. If the ABSTRACT phrase is specified, the ABSTRACT phrase must also be specified in the CLASS-ID paragraph of the containing class.
  12. If the ABSTRACT phrase is specified, the Procedure Division of this method must be empty.
  13. The ABSTRACT phrase must not be specified in a static method.
  14. If the PROTECTED phrase is specified, the ABSTRACT phrase must not be specified.
  15. The FOR clause may only be specified for instance methods.
  16. Interface-name-1 must be the name of an interface, which is implemented by the current class.
  17. This interface must include a method with the same signature as the current method.

General Rules

  1. The name of the method declared by this method definition is determined as follows:
    1. If the PROPERTY clause is specified, the name is formed as follows:
      1. If the GET phrase is specified, the characters "GET" are concatenated to property-name-1 folded to upper case.
      2. If the SET phrase is specified, the characters "SET" are concatenated to property-name-1 folded to upper case.
    2. If the PROPERTY clause is not specified, the name is method-name-1. However, literal-1, if specified, is the name of the method that is externalized to the operating environment.
  2. The OVERRIDE phrase indicates that this method overrides the inherited method.
  3. The REDEFINE phrase indicates that this method creates a new method with the same name that hides the parent method. Hiding is the same as overriding the inherited method when an object is described as being of an inherited class, however, when an object is described as being of a particular class, but actually contains an instance of a derived class, the method in the class referenced in the description of the object is executed.
  4. The FINAL clause indicates that this method must not be overridden in any subclasses, but it can be redefined.
  5. The name of this method can be referenced in the invocation of a method for an object of the class in which this method is defined.
  6. If a given user-defined word is defined in the Data Division of this method definition and in the Data Division of the containing factory definition or object definition, the use of that word in this method refers to the declaration in this method. The declaration in the containing factory object or object definition is inaccessible to this method.
  7. If the GET phrase is specified, this method is a get property method for property-name-1.
  8. If the SET phrase is specified, this method is a set property method for property-name-1.
  9. If the PUBLIC phrase is specified or implied, this method may be invoked from any runtime element.
  10. If the PRIVATE phrase is specified, this method may be invoked only from within the containing class.
  11. If the PROTECTED phrase is specified without the INTERNAL phrase, this method may be invoked only from within the containing class or a class that inherits from the containing class.
  12. If the PROTECTED phrase is specified with the INTERNAL phrase, this method may be invoked only from within the containing class, a class that inherits from the containing class, or from within the current compilation unit.
  13. If the INTERNAL phrase is specified without the PROTECTED phrase, this method may be invoked only from within the current compilation unit.
  14. If the ABSTRACT phrase is specified, this method must be overridden in every derived class that is not itself ABSTRACT.
  15. The CUSTOM-ATTRIBUTE phrase associates the specified custom attributes with this method.
  16. If the FOR clause is specified, this method is an Explicit Interface Member Implementation. The method may not be invoked explicitly. It will be invoked implicitly when the corresponding method is invoked on an instance of this class which has been cast to the interface type.