R
- the return type of this visitor's methods. Use Void
for visitors that do not need to return results.P
- the type of the additional parameter to this visitor's methods. Use Void
for visitors that do not need an additional parameter.ModuleElement
public static interface ModuleElement.DirectiveVisitor<R,P>
accept
method, the visitXyz
method applicable to that directive is invoked. Classes implementing this interface may or may not throw a NullPointerException
if the additional parameter p
is null
; see documentation of the implementing class for details.
WARNING: It is possible that methods will be added to this interface to accommodate new, currently unknown, language structures added to future versions of the Java programming language. Methods to accommodate new language constructs will be added in a source compatible way using default methods.
Modifier and Type | Method | Description |
---|---|---|
default R |
visit |
Visits any directive as if by passing itself to that directive's accept method and passing null for the additional parameter. |
default R |
visit |
Visits any directive as if by passing itself to that directive's accept method. |
R |
visitExports |
Visits an exports directive. |
R |
visitOpens |
Visits an opens directive. |
R |
visitProvides |
Visits a provides directive. |
R |
visitRequires |
Visits a requires directive. |
default R |
visitUnknown |
Visits an unknown directive. |
R |
visitUses |
Visits a uses directive. |
default R visit(ModuleElement.Directive d)
accept
method and passing null
for the additional parameter.d.accept(v, null)
.d
- the directive to visitdefault R visit(ModuleElement.Directive d, P p)
accept
method.d.accept(v, p)
.d
- the directive to visitp
- a visitor-specified parameterR visitRequires(ModuleElement.RequiresDirective d, P p)
requires
directive.d
- the directive to visitp
- a visitor-specified parameterR visitExports(ModuleElement.ExportsDirective d, P p)
exports
directive.d
- the directive to visitp
- a visitor-specified parameterR visitOpens(ModuleElement.OpensDirective d, P p)
opens
directive.d
- the directive to visitp
- a visitor-specified parameterR visitUses(ModuleElement.UsesDirective d, P p)
uses
directive.d
- the directive to visitp
- a visitor-specified parameterR visitProvides(ModuleElement.ProvidesDirective d, P p)
provides
directive.d
- the directive to visitp
- a visitor-specified parameterdefault R visitUnknown(ModuleElement.Directive d, P p)
new UnknownDirectiveException(d, p)
.d
- the directive to visitp
- a visitor-specified parameterUnknownDirectiveException
- a visitor implementation may optionally throw this exception
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.compiler/javax/lang/model/element/ModuleElement.DirectiveVisitor.html