| << §A.2 Modifiers | ↑ Table of Contents ↑ | §A.4 Parameter mappings >> |
§A.3 Method bindings
The rule of items declarable in a class body is augmented by method bindings:
| § A.3.1 | ClassBodyDeclaration ... CalloutBinding CallinBinding |
| § A.3.2 | CalloutBinding [Modifier] [TypeArguments] MethodSpec CalloutKind MethodSpec CalloutParameterMappings [Modifier] [TypeArguments] MethodSpec CalloutKind CalloutModifier FieldSpec |
| § A.3.3 | Callin binding [ Identifier : ] [TypeArguments] MethodSpec <- CallinModifier MethodSpecs [Guard] CallinParameterMappings |
| § A.3.4 | MethodSpec Identifier ResultType MethodDeclarator ConstructorDeclarator |
Note, that ResultType, MethodDeclarator and ConstructorDeclarator are not explicit in the
overall syntax of the Java language specification. For convenience we refer to the definition in
sections 8.4. Method Declarations
and 8.8. Constructor Declarations
of the Java language specification.
| § A.3.5 | MethodSpecs MethodSpec [, MethodSpecs] |
| § A.3.6 | CalloutKind -> => |
| § A.3.7 | CallinModifier before after replace |
| § A.3.8 | CalloutModifier get set |
| § A.3.9 | FieldSpec [Type] Identifier |
Contextual constraints:
CalloutBindings andCallinBindings may occur only in bound role classes.- A
CalloutBindingorCallinBindingmay not mix identifiers and full signatures (MethodDeclarationHead) for its method specifiers (MethodSpec).
Binding a full method signature to a field requires theFieldSpecto include theType. - The method specifier at the left hand side of a
CallinBindingwhich has thereplacemodifier must refer to a method that has thecallinmodifier. - The
Modifierof a callout binding can only be one of the visility modifierspublic,protectedorprivate. A short callout binding (i.e., without signatures) must not specify a visibility modifier. - A
MethodSpecof the shapeConstructorDeclaratoris legal only on the right hand side of a callin after binding (see §4.1.(i)).
| << §A.2 Modifiers | ↑ Table of Contents ↑ | §A.4 Parameter mappings >> |