< prev index next >
src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
Print this page
*** 199,226 ****
interface DirectiveVisitor<R, P> {
/**
* Visits any directive as if by passing itself to that
* directive's {@link Directive#accept accept} method and passing
* {@code null} for the additional parameter.
! * The invocation {@code v.visit(d)} is equivalent to
! * {@code d.accept(v, null)}.
* @param d the directive to visit
* @return a visitor-specified result
! * @implSpec This implementation is {@code visit(d, null)}
*/
default R visit(Directive d) {
return d.accept(this, null);
}
/**
* Visits any directive as if by passing itself to that
* directive's {@link Directive#accept accept} method.
! * The invocation {@code v.visit(d, p)} is equivalent to
! * {@code d.accept(v, p)}.
* @param d the directive to visit
* @param p a visitor-specified parameter
* @return a visitor-specified result
*/
default R visit(Directive d, P p) {
return d.accept(this, p);
}
--- 199,225 ----
interface DirectiveVisitor<R, P> {
/**
* Visits any directive as if by passing itself to that
* directive's {@link Directive#accept accept} method and passing
* {@code null} for the additional parameter.
! *
* @param d the directive to visit
* @return a visitor-specified result
! * @implSpec The default implementation is {@code d.accept(v, null)}.
*/
default R visit(Directive d) {
return d.accept(this, null);
}
/**
* Visits any directive as if by passing itself to that
* directive's {@link Directive#accept accept} method.
! *
* @param d the directive to visit
* @param p a visitor-specified parameter
* @return a visitor-specified result
+ * @implSpec The default implementation is {@code d.accept(v, p)}.
*/
default R visit(Directive d, P p) {
return d.accept(this, p);
}
*** 269,279 ****
* This can occur if the language evolves and new kinds of directive are added.
* @param d the directive to visit
* @param p a visitor-specified parameter
* @return a visitor-specified result
* @throws UnknownDirectiveException a visitor implementation may optionally throw this exception
! * @implSpec This implementation throws {@code new UnknownDirectiveException(d, p)}.
*/
default R visitUnknown(Directive d, P p) {
throw new UnknownDirectiveException(d, p);
}
}
--- 268,278 ----
* This can occur if the language evolves and new kinds of directive are added.
* @param d the directive to visit
* @param p a visitor-specified parameter
* @return a visitor-specified result
* @throws UnknownDirectiveException a visitor implementation may optionally throw this exception
! * @implSpec The default implementation throws {@code new UnknownDirectiveException(d, p)}.
*/
default R visitUnknown(Directive d, P p) {
throw new UnknownDirectiveException(d, p);
}
}
< prev index next >