src/share/classes/javax/lang/model/element/ElementVisitor.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 50,59 **** --- 50,71 ---- * abstract visitor class that implements this interface. However, an * API should generally use this visitor interface as the type for * parameters, return type, etc. rather than one of the abstract * classes. * + * <p>Note that methods to accommodate new language constructs could + * be added in a source <em>compatible</em> way if they were added as + * <em>default methods</em>. However, default methods are only + * available on Java SE 8 and higher releases and the {@code + * javax.lang.model.*} packages bundled in Java SE 8 are required to + * also be runnable on Java SE 7. Therefore, default methods + * <em>cannot</em> be used when extending {@code javax.lang.model.*} + * to cover Java SE 8 language features. However, default methods may + * be used in subsequent revisions of the {@code javax.lang.model.*} + * packages that are only required to run on Java SE 8 and higher + * platform versions. + * * @param <R> the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param <P> the type of the additional parameter to this visitor's * methods. Use {@code Void} for visitors that do not need an * additional parameter.