Class WadlRepresentation.ContentReader

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler
    Enclosing class:
    WadlRepresentation

    private static class WadlRepresentation.ContentReader
    extends org.xml.sax.helpers.DefaultHandler
    implements org.xml.sax.ext.LexicalHandler
    • Field Detail

      • currentApplication

        private ApplicationInfo currentApplication
        The current parsed "application" tag.
      • currentDocumentation

        private DocumentationInfo currentDocumentation
        The current parsed "documentation" tag.
      • currentGrammars

        private GrammarsInfo currentGrammars
        The current parsed "grammars" tag.
      • currentInclude

        private IncludeInfo currentInclude
        The current parsed "include" tag.
      • currentLink

        private LinkInfo currentLink
        The current parsed "link" tag.
      • currentMethod

        private MethodInfo currentMethod
        The current parsed "method" tag.
      • currentMixedContentCDataSection

        private org.w3c.dom.CDATASection currentMixedContentCDataSection
        The current mixed content CDataSection.
      • currentMixedContentNode

        private org.w3c.dom.Node currentMixedContentNode
        The current mixed content node.
      • currentOption

        private OptionInfo currentOption
        The current parsed "option" tag.
      • currentParameter

        private ParameterInfo currentParameter
        The current parsed "param" tag.
      • currentRepresentation

        private RepresentationInfo currentRepresentation
        The current parsed "representation" tag.
      • currentRequest

        private RequestInfo currentRequest
        The current parsed "request" tag.
      • currentResources

        private ResourcesInfo currentResources
        The current parsed "resources" tag.
      • currentResourcesList

        private final java.util.List<ResourceInfo> currentResourcesList
        The list of the current parsed "resource" tags.
      • currentResourceType

        private ResourceTypeInfo currentResourceType
        The current parsed "resource_type" tag.
      • currentResponse

        private ResponseInfo currentResponse
        The current parsed "response" tag.
      • mixedContentDocument

        private org.w3c.dom.Document mixedContentDocument
        The document used to create the mixed content.
      • mixedContentTopNode

        private org.w3c.dom.Node mixedContentTopNode
        The top node of mixed content nodes.
      • namespaces

        private java.util.Map<java.lang.String,​java.lang.String> namespaces
        Map of namespaces used in the WADL document. The key is the URI of the namespace and the value, the prefix.
      • wadlRepresentation

        private final WadlRepresentation wadlRepresentation
        The WadlRepresentation instance that represents the parsed document.
    • Constructor Detail

      • ContentReader

        public ContentReader​(WadlRepresentation wadlRepresentation)
        Constructor
        Parameters:
        wadlRepresentation - The WadlRepresentation instance that represents the parsed document.
    • Method Detail

      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Receive notification of character data.
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        ch - The characters from the XML document.
        start - The start position in the array.
        length - The number of characters to read from the array.
        Throws:
        org.xml.sax.SAXException
      • comment

        public void comment​(char[] ch,
                            int start,
                            int length)
                     throws org.xml.sax.SAXException
        Receive notification of a comment section.
        Specified by:
        comment in interface org.xml.sax.ext.LexicalHandler
        Parameters:
        ch - The characters from the XML document.
        start - The start position in the array.
        length - The number of characters to read from the array.
        Throws:
        org.xml.sax.SAXException
      • endCDATA

        public void endCDATA()
                      throws org.xml.sax.SAXException
        Receive notification of the end of a CDATA sectionn.
        Specified by:
        endCDATA in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Receive notification of the end of a document.
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endDTD

        public void endDTD()
                    throws org.xml.sax.SAXException
        Specified by:
        endDTD in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Receive notification of the end of an element.
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        qName - The qualified XML name (with prefix), or the empty string if qualified names are not available.
        Throws:
        org.xml.sax.SAXException
      • endEntity

        public void endEntity​(java.lang.String name)
                       throws org.xml.sax.SAXException
        Receive notification of the end of an entity section.
        Specified by:
        endEntity in interface org.xml.sax.ext.LexicalHandler
        Parameters:
        name - The name of the entity.
        Throws:
        org.xml.sax.SAXException
      • getParameterStyle

        public ParameterStyle getParameterStyle​(java.lang.String parameterStyle)
        Returns a parameterStyle value according to the given string or null.
        Parameters:
        parameterStyle - The given string.
        Returns:
        The parameterStyle value that corresponds to the given style name, or null otherwise.
      • getState

        private WadlRepresentation.ContentReader.State getState()
        Returns the current state when processing the WADL document.
        Returns:
        the current state when processing the WADL document.
      • popState

        private WadlRepresentation.ContentReader.State popState()
        Drops the current state from the stack and returns it. This state becomes the former current state.
        Returns:
        the former current state.
      • startCDATA

        public void startCDATA()
                        throws org.xml.sax.SAXException
        Receive notification of the beginning of a CDATA section.
        Specified by:
        startCDATA in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Receive notification of the beginning of a document.
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Overrides:
        startDocument in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • startDTD

        public void startDTD​(java.lang.String name,
                             java.lang.String publicId,
                             java.lang.String systemId)
                      throws org.xml.sax.SAXException
        Specified by:
        startDTD in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes attrs)
                          throws org.xml.sax.SAXException
        Receive notification of the beginning of an element.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        qName - The qualified name (with prefix), or the empty string if qualified names are not available.
        attrs - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined.
        Throws:
        org.xml.sax.SAXException
      • startEntity

        public void startEntity​(java.lang.String name)
                         throws org.xml.sax.SAXException
        Receive notification of the beginning of an entity.
        Specified by:
        startEntity in interface org.xml.sax.ext.LexicalHandler
        Parameters:
        name - The name of the entity.
        Throws:
        org.xml.sax.SAXException
      • startPrefixMapping

        public void startPrefixMapping​(java.lang.String arg0,
                                       java.lang.String arg1)
                                throws org.xml.sax.SAXException
        Receive notification of the beginning of a prefix-URI Namespace mapping.
        Specified by:
        startPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        name - The name of the entity.
        Throws:
        org.xml.sax.SAXException