Class XMLLightweightParser


  • public class XMLLightweightParser
    extends Object
    This is a Light-Weight XML Parser. It read data from a channel and collect data until data are available in the channel. When a message is complete you can retrieve messages invoking the method getMsgs() and you can invoke the method areThereMsgs() to know if at least an message is presents.
    Author:
    Daniele Piras, Gaston Dombiak
    • Constructor Detail

      • XMLLightweightParser

        public XMLLightweightParser()
    • Method Detail

      • areThereMsgs

        public boolean areThereMsgs()
      • getMsgs

        public String[] getMsgs()
      • invalidateBuffer

        protected void invalidateBuffer()
      • isMaxBufferSizeExceeded

        public boolean isMaxBufferSizeExceeded()
      • read

        public void read​(io.netty.buffer.ByteBuf in)
                  throws Exception
        Throws:
        Exception
      • hasIllegalCharacterReferences

        public static boolean hasIllegalCharacterReferences​(String string)
        This method verifies if the provided argument contains at least one numeric character reference ( CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';) for which the decimal or hexidecimal character value refers to an invalid XML 1.0 character.
        Parameters:
        string - The input string
        Returns:
        true if the input string contains an invalid numeric character reference, false otherwise.
        See Also:
        Definition of a character reference
      • isLegalXmlCharacter

        public static boolean isLegalXmlCharacter​(int value)
        Verifies if the codepoint value represents a valid character as defined in paragraph 2.2 of "Extensible Markup Language (XML) 1.0 (Fifth Edition)"
        Parameters:
        value - the codepoint
        Returns:
        true if the codepoint is a valid character per XML 1.0 definition, false otherwise.
        See Also:
        Definition of a characters range