Interface NSXMLParserDelegate


  • public interface NSXMLParserDelegate
    The parser's delegate is informed of events through the methods in the NSXMLParserDelegateEventAdditions category.
    • Method Detail

      • parserDidEndElementNamespaceURIQualifiedName

        default void parserDidEndElementNamespaceURIQualifiedName​(@NotNull
                                                                  @NotNull NSXMLParser parser,
                                                                  @NotNull
                                                                  @NotNull java.lang.String elementName,
                                                                  @Nullable
                                                                  @Nullable java.lang.String namespaceURI,
                                                                  @Nullable
                                                                  @Nullable java.lang.String qName)
        sent when the parser finds an element start tag. In the case of the cvslog tag, the following is what the delegate receives: elementName == cvslog, namespaceURI == http://xml.apple.com/cvslog, qualifiedName == cvslog In the case of the radar tag, the following is what's passed in: elementName == radar, namespaceURI == http://xml.apple.com/radar, qualifiedName == radar:radar If namespace processing >isn't< on, the xmlns:radar="http://xml.apple.com/radar" is returned as an attribute pair, the elementName is 'radar:radar' and there is no qualifiedName.
      • parserDidEndMappingPrefix

        default void parserDidEndMappingPrefix​(@NotNull
                                               @NotNull NSXMLParser parser,
                                               @NotNull
                                               @NotNull java.lang.String prefix)
        sent when the parser first sees a namespace attribute. In the case of the cvslog tag, before the didStartElement:, you'd get one of these with prefix == @"" and namespaceURI == @"http://xml.apple.com/cvslog" (i.e. the default namespace) In the case of the radar:radar tag, before the didStartElement: you'd get one of these with prefix == @"radar" and namespaceURI == @"http://xml.apple.com/radar"
      • parserDidStartElementNamespaceURIQualifiedNameAttributes

        default void parserDidStartElementNamespaceURIQualifiedNameAttributes​(@NotNull
                                                                              @NotNull NSXMLParser parser,
                                                                              @NotNull
                                                                              @NotNull java.lang.String elementName,
                                                                              @Nullable
                                                                              @Nullable java.lang.String namespaceURI,
                                                                              @Nullable
                                                                              @Nullable java.lang.String qName,
                                                                              @NotNull
                                                                              @NotNull NSDictionary<java.lang.String,​java.lang.String> attributeDict)
      • parserDidStartMappingPrefixToURI

        default void parserDidStartMappingPrefixToURI​(@NotNull
                                                      @NotNull NSXMLParser parser,
                                                      @NotNull
                                                      @NotNull java.lang.String prefix,
                                                      @NotNull
                                                      @NotNull java.lang.String namespaceURI)
        sent when an end tag is encountered. The various parameters are supplied as above.
      • parserFoundAttributeDeclarationWithNameForElementTypeDefaultValue

        default void parserFoundAttributeDeclarationWithNameForElementTypeDefaultValue​(@NotNull
                                                                                       @NotNull NSXMLParser parser,
                                                                                       @NotNull
                                                                                       @NotNull java.lang.String attributeName,
                                                                                       @NotNull
                                                                                       @NotNull java.lang.String elementName,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String type,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String defaultValue)
      • parserFoundCDATA

        default void parserFoundCDATA​(@NotNull
                                      @NotNull NSXMLParser parser,
                                      @NotNull
                                      @NotNull NSData CDATABlock)
        A comment (Text in a block) is reported to the delegate as a single string
      • parserFoundCharacters

        default void parserFoundCharacters​(@NotNull
                                           @NotNull NSXMLParser parser,
                                           @NotNull
                                           @NotNull java.lang.String string)
        sent when the namespace prefix in question goes out of scope.
      • parserFoundComment

        default void parserFoundComment​(@NotNull
                                        @NotNull NSXMLParser parser,
                                        @NotNull
                                        @NotNull java.lang.String comment)
        The parser reports a processing instruction to you using this method. In the case above, target == @"xml-stylesheet" and data == @"type='text/css' href='cvslog.css'"
      • parserFoundElementDeclarationWithNameModel

        default void parserFoundElementDeclarationWithNameModel​(@NotNull
                                                                @NotNull NSXMLParser parser,
                                                                @NotNull
                                                                @NotNull java.lang.String elementName,
                                                                @NotNull
                                                                @NotNull java.lang.String model)
      • parserFoundExternalEntityDeclarationWithNamePublicIDSystemID

        default void parserFoundExternalEntityDeclarationWithNamePublicIDSystemID​(@NotNull
                                                                                  @NotNull NSXMLParser parser,
                                                                                  @NotNull
                                                                                  @NotNull java.lang.String name,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String publicID,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String systemID)
      • parserFoundIgnorableWhitespace

        default void parserFoundIgnorableWhitespace​(@NotNull
                                                    @NotNull NSXMLParser parser,
                                                    @NotNull
                                                    @NotNull java.lang.String whitespaceString)
        This returns the string of the characters encountered thus far. You may not necessarily get the longest character run. The parser reserves the right to hand these to the delegate as potentially many calls in a row to -parser:foundCharacters:
      • parserFoundInternalEntityDeclarationWithNameValue

        default void parserFoundInternalEntityDeclarationWithNameValue​(@NotNull
                                                                       @NotNull NSXMLParser parser,
                                                                       @NotNull
                                                                       @NotNull java.lang.String name,
                                                                       @Nullable
                                                                       @Nullable java.lang.String value)
      • parserFoundNotationDeclarationWithNamePublicIDSystemID

        default void parserFoundNotationDeclarationWithNamePublicIDSystemID​(@NotNull
                                                                            @NotNull NSXMLParser parser,
                                                                            @NotNull
                                                                            @NotNull java.lang.String name,
                                                                            @Nullable
                                                                            @Nullable java.lang.String publicID,
                                                                            @Nullable
                                                                            @Nullable java.lang.String systemID)
        DTD handling methods for various declarations.
      • parserFoundProcessingInstructionWithTargetData

        default void parserFoundProcessingInstructionWithTargetData​(@NotNull
                                                                    @NotNull NSXMLParser parser,
                                                                    @NotNull
                                                                    @NotNull java.lang.String target,
                                                                    @Nullable
                                                                    @Nullable java.lang.String data)
        The parser reports ignorable whitespace in the same way as characters it's found.
      • parserFoundUnparsedEntityDeclarationWithNamePublicIDSystemIDNotationName

        default void parserFoundUnparsedEntityDeclarationWithNamePublicIDSystemIDNotationName​(@NotNull
                                                                                              @NotNull NSXMLParser parser,
                                                                                              @NotNull
                                                                                              @NotNull java.lang.String name,
                                                                                              @Nullable
                                                                                              @Nullable java.lang.String publicID,
                                                                                              @Nullable
                                                                                              @Nullable java.lang.String systemID,
                                                                                              @Nullable
                                                                                              @Nullable java.lang.String notationName)
      • parserParseErrorOccurred

        default void parserParseErrorOccurred​(@NotNull
                                              @NotNull NSXMLParser parser,
                                              @NotNull
                                              @NotNull NSError parseError)
        this gives the delegate an opportunity to resolve an external entity itself and reply with the resulting data.
      • parserResolveExternalEntityNameSystemID

        @Nullable
        default @Nullable NSData parserResolveExternalEntityNameSystemID​(@NotNull
                                                                         @NotNull NSXMLParser parser,
                                                                         @NotNull
                                                                         @NotNull java.lang.String name,
                                                                         @Nullable
                                                                         @Nullable java.lang.String systemID)
        this reports a CDATA block to the delegate as an NSData.
      • parserValidationErrorOccurred

        default void parserValidationErrorOccurred​(@NotNull
                                                   @NotNull NSXMLParser parser,
                                                   @NotNull
                                                   @NotNull NSError validationError)
        ...and this reports a fatal error to the delegate. The parser will stop parsing.
      • parserDidEndDocument

        default void parserDidEndDocument​(@NotNull
                                          @NotNull NSXMLParser parser)
        sent when the parser begins parsing of the document.
      • parserDidStartDocument

        default void parserDidStartDocument​(@NotNull
                                            @NotNull NSXMLParser parser)
        Document handling methods