Package org.apache.ivy.osgi.core
Class ManifestHeaderValue.ManifestHeaderParser
- java.lang.Object
-
- org.apache.ivy.osgi.core.ManifestHeaderValue.ManifestHeaderParser
-
- Enclosing class:
- ManifestHeaderValue
class ManifestHeaderValue.ManifestHeaderParser extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringBuilderbufferbufferprivate charclast read characterprivate ManifestHeaderElementelemthe header element being buildprivate java.lang.Stringheaderheader to parseprivate booleanisDirectivetrue if the last parsed parameter is a directive (assigned via :=)private intlengththe length of the sourceprivate java.lang.StringparamNamethe last parsed parameter nameprivate intposposition in the sourceprivate booleanvaluesParsedOnce at true (at the first attribute parsed), only parameters are allowed
-
Constructor Summary
Constructors Constructor Description ManifestHeaderParser(java.lang.String header)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappendEscaped()private voidappendQuoted(boolean doubleQuoted)private voidendParameterName()private voidendParameterValue()private voidendValue()private voiderror(java.lang.String message)private voiderror(java.lang.String message, int p)(package private) voidparse()Do the parsingprivate voidparseElement()private voidparseParameterValue()private voidparseSeparator()private voidparseValueOrParameter()private charreadNext()
-
-
-
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
-
elem
private ManifestHeaderElement elem
the header element being build
-
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 :=)
-
-
Method Detail
-
parse
void parse() throws java.text.ParseExceptionDo 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()
-
-