
The Method-ID Paragraph
The Method-ID paragraph indicates that this Identification Division
introduces a method definition, specifies the name that identifies the method
or method prototype, and assigns method attributes to the method.
General Format

Syntax Rules
- Literal-1 must be an alphanumeric literal and must not be a
figurative constant.
- 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.
- 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.
- 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.
- The OVERRIDE phrase must not be specified in a method prototype.
- 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.
- If the OVERRIDE phrase is not specified:
- 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
- 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.
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.
- The FINAL clause must not be specified in a method prototype.
- 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.
If the ABSTRACT phrase is specified, the ABSTRACT phrase
must also be specified in the CLASS-ID paragraph of the containing
class.
If the
ABSTRACT phrase is specified, the Procedure Division of this method must be
empty.
The ABSTRACT phrase must not be specified in a static
method.
If the PROTECTED phrase is specified, the ABSTRACT phrase
must not be specified.
The FOR clause may only be specified for instance
methods.
Interface-name-1 must be the name of an interface, which
is implemented by the current class.
This interface must include a method with the same
signature as the current method.
General Rules
- The name of the method declared by this method definition is
determined as follows:
- If the PROPERTY clause is specified, the name is formed as
follows:
- If the GET phrase is specified, the characters "GET" are
concatenated to property-name-1 folded to upper case.
- If the SET phrase is specified, the characters "SET" are
concatenated to property-name-1 folded to upper case.
- 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.
- The OVERRIDE phrase indicates that this method overrides the
inherited method.
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.
- The FINAL clause indicates that this method must not be
overridden in any subclasses
, but it can be
redefined
.
- 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.
- 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.
- If the GET phrase is specified, this method is a get property
method for property-name-1.
- If the SET phrase is specified, this method is a set property
method for property-name-1.
If the PUBLIC phrase is specified or implied, this method
may be invoked from any runtime element.
If the PRIVATE phrase is specified, this method may be
invoked only from within the containing class.
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.
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.
If the INTERNAL phrase is specified without the PROTECTED
phrase, this method may be invoked only from within the current compilation
unit.
If the ABSTRACT phrase is specified, this method must be
overridden in every derived class that is not itself ABSTRACT.
The CUSTOM-ATTRIBUTE phrase associates the specified
custom attributes with this method.
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.