langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
271 * |
271 * |
272 * @param typeElement the class being checked. |
272 * @param typeElement the class being checked. |
273 * @return true if the given package has constant fields to document. |
273 * @return true if the given package has constant fields to document. |
274 */ |
274 */ |
275 private boolean hasConstantField (TypeElement typeElement) { |
275 private boolean hasConstantField (TypeElement typeElement) { |
276 VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(typeElement, |
276 VisibleMemberMap visibleMemberMapFields = configuration.getVisibleMemberMap(typeElement, |
277 VisibleMemberMap.Kind.FIELDS, configuration); |
277 VisibleMemberMap.Kind.FIELDS); |
278 List<Element> fields = visibleMemberMapFields.getLeafMembers(); |
278 List<Element> fields = visibleMemberMapFields.getLeafMembers(); |
279 for (Element f : fields) { |
279 for (Element f : fields) { |
280 VariableElement field = (VariableElement)f; |
280 VariableElement field = (VariableElement)f; |
281 if (field.getConstantValue() != null) { |
281 if (field.getConstantValue() != null) { |
282 typeElementsWithConstFields.add(typeElement); |
282 typeElementsWithConstFields.add(typeElement); |
327 * Construct a ConstantFieldSubWriter. |
327 * Construct a ConstantFieldSubWriter. |
328 * @param typeElement the typeElement that we are examining constants for. |
328 * @param typeElement the typeElement that we are examining constants for. |
329 */ |
329 */ |
330 public ConstantFieldBuilder(TypeElement typeElement) { |
330 public ConstantFieldBuilder(TypeElement typeElement) { |
331 this.typeElement = typeElement; |
331 this.typeElement = typeElement; |
332 visibleMemberMapFields = new VisibleMemberMap(typeElement, |
332 visibleMemberMapFields = configuration.getVisibleMemberMap(typeElement, |
333 VisibleMemberMap.Kind.FIELDS, configuration); |
333 VisibleMemberMap.Kind.FIELDS); |
334 visibleMemberMapEnumConst = new VisibleMemberMap(typeElement, |
334 visibleMemberMapEnumConst = configuration.getVisibleMemberMap(typeElement, |
335 VisibleMemberMap.Kind.ENUM_CONSTANTS, configuration); |
335 VisibleMemberMap.Kind.ENUM_CONSTANTS); |
336 } |
336 } |
337 |
337 |
338 /** |
338 /** |
339 * Builds the table of constants for a given class. |
339 * Builds the table of constants for a given class. |
340 * |
340 * |