com.sun.tools.doclets.internal.toolkit.builders
Class LayoutParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.sun.tools.doclets.internal.toolkit.builders.LayoutParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class LayoutParser
extends org.xml.sax.helpers.DefaultHandler

Parse the XML that specified the order of operation for the builders. This Parser uses SAX parsing.

Since:
1.5
See Also:
SAXParser

Field Summary
private  Configuration configuration
           
private  java.lang.String currentRoot
           
private static LayoutParser instance
           
private  boolean isParsing
           
private  java.util.Map<java.lang.String,java.util.List<java.lang.Object>> xmlElementsMap
          The map of XML elements that have been parsed.
 
Constructor Summary
private LayoutParser(Configuration configuration)
          This class is a singleton.
 
Method Summary
 void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
          
static LayoutParser getInstance(Configuration configuration)
          Return an instance of the BuilderXML.
 java.util.List<?> parseXML(java.lang.String root)
          Parse the XML specifying the layout of the documentation.
 void startElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName, org.xml.sax.Attributes attrs)
          
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlElementsMap

private java.util.Map<java.lang.String,java.util.List<java.lang.Object>> xmlElementsMap
The map of XML elements that have been parsed.


configuration

private Configuration configuration

instance

private static LayoutParser instance

currentRoot

private java.lang.String currentRoot

isParsing

private boolean isParsing
Constructor Detail

LayoutParser

private LayoutParser(Configuration configuration)
This class is a singleton.

Method Detail

getInstance

public static LayoutParser getInstance(Configuration configuration)
Return an instance of the BuilderXML.

Parameters:
configuration - the current configuration of the doclet.
Returns:
an instance of the BuilderXML.

parseXML

public java.util.List<?> parseXML(java.lang.String root)
Parse the XML specifying the layout of the documentation.

Returns:
List the list of XML elements parsed.

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String sName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String sName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException