langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java
changeset 14542 7062120649c2
parent 14260 727a84636f12
child 19667 fdfce85627a9
equal deleted inserted replaced
14541:36f9d11fc9aa 14542:7062120649c2
    53     /**
    53     /**
    54      * The map of XML elements that have been parsed.
    54      * The map of XML elements that have been parsed.
    55      */
    55      */
    56     private Map<String,XMLNode> xmlElementsMap;
    56     private Map<String,XMLNode> xmlElementsMap;
    57     private XMLNode currentNode;
    57     private XMLNode currentNode;
    58     private Configuration configuration;
    58     private final Configuration configuration;
    59     private static LayoutParser instance;
       
    60     private String currentRoot;
    59     private String currentRoot;
    61     private boolean isParsing;
    60     private boolean isParsing;
    62 
    61 
    63     /**
       
    64      * This class is a singleton.
       
    65      */
       
    66     private LayoutParser(Configuration configuration) {
    62     private LayoutParser(Configuration configuration) {
    67         xmlElementsMap = new HashMap<String,XMLNode>();
    63         xmlElementsMap = new HashMap<String,XMLNode>();
    68         this.configuration = configuration;
    64         this.configuration = configuration;
    69     }
    65     }
    70 
    66 
    73      *
    69      *
    74      * @param configuration the current configuration of the doclet.
    70      * @param configuration the current configuration of the doclet.
    75      * @return an instance of the BuilderXML.
    71      * @return an instance of the BuilderXML.
    76      */
    72      */
    77     public static LayoutParser getInstance(Configuration configuration) {
    73     public static LayoutParser getInstance(Configuration configuration) {
    78         if (instance == null) {
    74         return new LayoutParser(configuration);
    79             instance = new LayoutParser(configuration);
       
    80         }
       
    81         return instance;
       
    82     }
    75     }
    83 
    76 
    84     /**
    77     /**
    85      * Parse the XML specifying the layout of the documentation.
    78      * Parse the XML specifying the layout of the documentation.
    86      *
    79      *