Class ManifestHeaderValue.ManifestHeaderParser

  • Enclosing class:
    ManifestHeaderValue

    class ManifestHeaderValue.ManifestHeaderParser
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.StringBuilder buffer
      buffer
      private char c
      last read character
      private ManifestHeaderElement elem
      the header element being build
      private java.lang.String header
      header to parse
      private boolean isDirective
      true if the last parsed parameter is a directive (assigned via :=)
      private int length
      the length of the source
      private java.lang.String paramName
      the last parsed parameter name
      private int pos
      position in the source
      private boolean valuesParsed
      Once at true (at the first attribute parsed), only parameters are allowed
    • Constructor Summary

      Constructors 
      Constructor Description
      ManifestHeaderParser​(java.lang.String header)
      Default constructor
    • Field Detail

      • header

        private final java.lang.String header
        header to parse
      • length

        private int length
        the length of the source
      • buffer

        private java.lang.StringBuilder buffer
        buffer
      • pos

        private int pos
        position in the source
      • c

        private char c
        last read character
      • valuesParsed

        private boolean valuesParsed
        Once at true (at the first attribute parsed), only parameters are allowed
      • paramName

        private java.lang.String paramName
        the last parsed parameter name
      • isDirective

        private boolean isDirective
        true if the last parsed parameter is a directive (assigned via :=)
    • Constructor Detail

      • ManifestHeaderParser

        ManifestHeaderParser​(java.lang.String header)
        Default constructor
        Parameters:
        header - the header to parse
    • Method Detail

      • parse

        void parse()
            throws java.text.ParseException
        Do the parsing
        Throws:
        java.text.ParseException - if something goes wrong
      • readNext

        private char readNext()
      • error

        private void error​(java.lang.String message)
                    throws java.text.ParseException
        Throws:
        java.text.ParseException
      • error

        private void error​(java.lang.String message,
                           int p)
                    throws java.text.ParseException
        Throws:
        java.text.ParseException
      • parseElement

        private void parseElement()
                           throws java.text.ParseException
        Throws:
        java.text.ParseException
      • parseValueOrParameter

        private void parseValueOrParameter()
                                    throws java.text.ParseException
        Throws:
        java.text.ParseException
      • endValue

        private void endValue()
                       throws java.text.ParseException
        Throws:
        java.text.ParseException
      • endParameterName

        private void endParameterName()
                               throws java.text.ParseException
        Throws:
        java.text.ParseException
      • parseSeparator

        private void parseSeparator()
                             throws java.text.ParseException
        Throws:
        java.text.ParseException
      • parseParameterValue

        private void parseParameterValue()
                                  throws java.text.ParseException
        Throws:
        java.text.ParseException
      • endParameterValue

        private void endParameterValue()
                                throws java.text.ParseException
        Throws:
        java.text.ParseException
      • appendQuoted

        private void appendQuoted​(boolean doubleQuoted)
      • appendEscaped

        private void appendEscaped()