14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package jdk.javadoc.internal.doclets.toolkit; 27 28 import java.util.regex.Pattern; 29 import javax.lang.model.element.ExecutableElement; 30 import javax.lang.model.type.TypeKind; 31 import javax.lang.model.type.TypeMirror; 32 import javax.lang.model.util.Types; 33 34 /** 35 * This class provides basic JavaFX property related utility methods. 36 * Refer to the JavaFX conventions in the VisibleMemberTable comments. 37 */ 38 public class PropertyUtils { 39 40 final TypeMirror jbObservableType; 41 42 final Pattern fxMethodPatterns; 43 44 final boolean javafx; 45 46 final Types typeUtils; 47 48 PropertyUtils(BaseConfiguration configuration) { 49 50 javafx = configuration.javafx; 51 52 typeUtils = configuration.docEnv.getTypeUtils(); 53 54 // Disable strict check for JDK's without FX. 55 TypeMirror jboType = configuration.disableJavaFxStrictChecks 56 ? null 57 : configuration.utils.getSymbol("javafx.beans.Observable"); 58 59 jbObservableType = jboType != null 60 ? configuration.docEnv.getTypeUtils().erasure(jboType) 61 : null; 62 63 fxMethodPatterns = javafx 64 ? Pattern.compile("[sg]et\\p{Upper}.*||is\\p{Upper}.*") 65 : null; 66 } 67 68 /** 69 * Returns a base name for a property method. Supposing we 70 * have {@code BooleanProperty acmeProperty()}, then "acme" 71 * will be returned. 72 * @param propertyMethod 73 * @return the base name of a property method. 74 */ 75 public String getBaseName(ExecutableElement propertyMethod) { | 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package jdk.javadoc.internal.doclets.toolkit; 27 28 import java.util.regex.Pattern; 29 import javax.lang.model.element.ExecutableElement; 30 import javax.lang.model.type.TypeKind; 31 import javax.lang.model.type.TypeMirror; 32 import javax.lang.model.util.Types; 33 34 import jdk.javadoc.internal.doclets.formats.html.HtmlOptions; 35 36 /** 37 * This class provides basic JavaFX property related utility methods. 38 * Refer to the JavaFX conventions in the VisibleMemberTable comments. 39 */ 40 public class PropertyUtils { 41 42 final TypeMirror jbObservableType; 43 44 final Pattern fxMethodPatterns; 45 46 final boolean javafx; 47 48 final Types typeUtils; 49 50 PropertyUtils(BaseConfiguration configuration) { 51 BaseOptions options = configuration.getOptions(); 52 javafx = options.javafx; 53 54 typeUtils = configuration.docEnv.getTypeUtils(); 55 56 // Disable strict check for JDK's without FX. 57 TypeMirror jboType = options.disableJavaFxStrictChecks 58 ? null 59 : configuration.utils.getSymbol("javafx.beans.Observable"); 60 61 jbObservableType = jboType != null 62 ? configuration.docEnv.getTypeUtils().erasure(jboType) 63 : null; 64 65 fxMethodPatterns = javafx 66 ? Pattern.compile("[sg]et\\p{Upper}.*||is\\p{Upper}.*") 67 : null; 68 } 69 70 /** 71 * Returns a base name for a property method. Supposing we 72 * have {@code BooleanProperty acmeProperty()}, then "acme" 73 * will be returned. 74 * @param propertyMethod 75 * @return the base name of a property method. 76 */ 77 public String getBaseName(ExecutableElement propertyMethod) { |