src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java
changeset 49879 601277b1d582
parent 47216 71c04702a3d5
child 54060 53a95878619f
equal deleted inserted replaced
49878:2422d4e027b0 49879:601277b1d582
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, 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
    33 
    33 
    34 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
    34 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
    35 import jdk.javadoc.internal.doclets.toolkit.Content;
    35 import jdk.javadoc.internal.doclets.toolkit.Content;
    36 import jdk.javadoc.internal.doclets.toolkit.DocletException;
    36 import jdk.javadoc.internal.doclets.toolkit.DocletException;
    37 import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
    37 import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
    38 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    38 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
    39 
    39 
       
    40 import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*;
    40 
    41 
    41 /**
    42 /**
    42  * Builds documentation for a property.
    43  * Builds documentation for a property.
    43  *
    44  *
    44  *  <p><b>This is NOT part of any supported API.
    45  *  <p><b>This is NOT part of any supported API.
    50  * @author Bhavesh Patel (Modified)
    51  * @author Bhavesh Patel (Modified)
    51  */
    52  */
    52 public class PropertyBuilder extends AbstractMemberBuilder {
    53 public class PropertyBuilder extends AbstractMemberBuilder {
    53 
    54 
    54     /**
    55     /**
    55      * The class whose properties are being documented.
       
    56      */
       
    57     private final TypeElement typeElement;
       
    58 
       
    59     /**
       
    60      * The visible properties for the given class.
       
    61      */
       
    62     private final VisibleMemberMap visibleMemberMap;
       
    63 
       
    64     /**
       
    65      * The writer to output the property documentation.
    56      * The writer to output the property documentation.
    66      */
    57      */
    67     private final PropertyWriter writer;
    58     private final PropertyWriter writer;
    68 
    59 
    69     /**
    60     /**
    70      * The list of properties being documented.
    61      * The list of properties being documented.
    71      */
    62      */
    72     private final List<Element> properties;
    63     private final List<? extends Element> properties;
    73 
    64 
    74     /**
    65     /**
    75      * The index of the current property that is being documented at this point
    66      * The index of the current property that is being documented at this point
    76      * in time.
    67      * in time.
    77      */
    68      */
    85      * @param writer the doclet specific writer.
    76      * @param writer the doclet specific writer.
    86      */
    77      */
    87     private PropertyBuilder(Context context,
    78     private PropertyBuilder(Context context,
    88             TypeElement typeElement,
    79             TypeElement typeElement,
    89             PropertyWriter writer) {
    80             PropertyWriter writer) {
    90         super(context);
    81         super(context, typeElement);
    91         this.typeElement = typeElement;
       
    92         this.writer = writer;
    82         this.writer = writer;
    93         visibleMemberMap = configuration.getVisibleMemberMap(typeElement,
    83         properties = getVisibleMembers(PROPERTIES);
    94                 VisibleMemberMap.Kind.PROPERTIES);
       
    95         properties = visibleMemberMap.getMembers(typeElement);
       
    96     }
    84     }
    97 
    85 
    98     /**
    86     /**
    99      * Construct a new PropertyBuilder.
    87      * Construct a new PropertyBuilder.
   100      *
    88      *