1 /* |
1 /* |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2013, 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 |
263 * @param classDoc the class being checked. |
263 * @param classDoc the class being checked. |
264 * @return true if the given package has constant fields to document. |
264 * @return true if the given package has constant fields to document. |
265 */ |
265 */ |
266 private boolean hasConstantField (ClassDoc classDoc) { |
266 private boolean hasConstantField (ClassDoc classDoc) { |
267 VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, |
267 VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, |
268 VisibleMemberMap.FIELDS, configuration.nodeprecated); |
268 VisibleMemberMap.FIELDS, configuration); |
269 List<?> fields = visibleMemberMapFields.getLeafClassMembers(configuration); |
269 List<?> fields = visibleMemberMapFields.getLeafClassMembers(configuration); |
270 for (Iterator<?> iter = fields.iterator(); iter.hasNext(); ) { |
270 for (Iterator<?> iter = fields.iterator(); iter.hasNext(); ) { |
271 FieldDoc field = (FieldDoc) iter.next(); |
271 FieldDoc field = (FieldDoc) iter.next(); |
272 if (field.constantValueExpression() != null) { |
272 if (field.constantValueExpression() != null) { |
273 classDocsWithConstFields.add(classDoc); |
273 classDocsWithConstFields.add(classDoc); |
321 * @param classdoc the classdoc that we are examining constants for. |
321 * @param classdoc the classdoc that we are examining constants for. |
322 */ |
322 */ |
323 public ConstantFieldBuilder(ClassDoc classdoc) { |
323 public ConstantFieldBuilder(ClassDoc classdoc) { |
324 this.classdoc = classdoc; |
324 this.classdoc = classdoc; |
325 visibleMemberMapFields = new VisibleMemberMap(classdoc, |
325 visibleMemberMapFields = new VisibleMemberMap(classdoc, |
326 VisibleMemberMap.FIELDS, configuration.nodeprecated); |
326 VisibleMemberMap.FIELDS, configuration); |
327 visibleMemberMapEnumConst = new VisibleMemberMap(classdoc, |
327 visibleMemberMapEnumConst = new VisibleMemberMap(classdoc, |
328 VisibleMemberMap.ENUM_CONSTANTS, configuration.nodeprecated); |
328 VisibleMemberMap.ENUM_CONSTANTS, configuration); |
329 } |
329 } |
330 |
330 |
331 /** |
331 /** |
332 * Builds the table of constants for a given class. |
332 * Builds the table of constants for a given class. |
333 * |
333 * |