public class RawFieldParser
extends java.lang.Object
Description:
Title:首亨软件 - TSS/CRM等
限定符和类型 | 字段和说明 |
---|---|
static RawFieldParser |
DEFAULT |
构造器和说明 |
---|
RawFieldParser() |
限定符和类型 | 方法和说明 |
---|---|
void |
copyContent(ByteSequence buf,
ParserCursor cursor,
java.util.BitSet delimiters,
java.lang.StringBuilder dst)
Transfers content into the destination buffer until a whitespace character, a comment,
or any of the given delimiters is encountered.
|
void |
copyQuotedContent(ByteSequence buf,
ParserCursor cursor,
java.lang.StringBuilder dst)
Transfers content enclosed with quote marks into the destination buffer.
|
static java.util.BitSet |
INIT_BITSET(int... b) |
RawField |
parseField(ByteSequence raw)
Parses the sequence of bytes into
RawField . |
NameValuePair |
parseParameter(ByteSequence buf,
ParserCursor cursor)
Parses the sequence of bytes containing a field parameter delimited with semicolon into
NameValuePair . |
java.util.List<NameValuePair> |
parseParameters(ByteSequence buf,
ParserCursor cursor)
Parses the sequence of bytes containing field parameters delimited with semicolon into
a list of
NameValuePair s. |
RawBody |
parseRawBody(ByteSequence buf,
ParserCursor cursor)
Parses the sequence of bytes containing a value with parameters into
RawBody . |
RawBody |
parseRawBody(RawField field)
Parses the field body containing a value with parameters into
RawBody . |
java.lang.String |
parseToken(ByteSequence buf,
ParserCursor cursor,
java.util.BitSet delimiters)
Extracts from the sequence of bytes a token terminated with any of the given delimiters
discarding semantically insignificant whitespace characters and comments.
|
java.lang.String |
parseValue(ByteSequence buf,
ParserCursor cursor,
java.util.BitSet delimiters)
Extracts from the sequence of bytes a value which can be enclosed in quote marks and
terminated with any of the given delimiters discarding semantically insignificant
whitespace characters and comments.
|
void |
skipAllWhiteSpace(ByteSequence buf,
ParserCursor cursor)
Skips semantically insignificant whitespace characters and comments and moves the cursor
to the closest semantically significant non-whitespace character.
|
void |
skipComment(ByteSequence buf,
ParserCursor cursor)
Skips semantically insignificant content if the current position is positioned at the
beginning of a comment and moves the cursor past the end of the comment.
|
void |
skipWhiteSpace(ByteSequence buf,
ParserCursor cursor)
Skips semantically insignificant whitespace characters and moves the cursor to the closest
non-whitespace character.
|
public static final RawFieldParser DEFAULT
public static java.util.BitSet INIT_BITSET(int... b)
public RawField parseField(ByteSequence raw) throws MimeException
RawField
.raw
- ByteSequenceMimeException
- if the input data does not contain a valid MIME field.public RawBody parseRawBody(RawField field)
RawBody
.field
- unstructured (raw) fieldpublic RawBody parseRawBody(ByteSequence buf, ParserCursor cursor)
RawBody
.buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferpublic java.util.List<NameValuePair> parseParameters(ByteSequence buf, ParserCursor cursor)
NameValuePair
s.buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferpublic NameValuePair parseParameter(ByteSequence buf, ParserCursor cursor)
NameValuePair
.buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferpublic java.lang.String parseToken(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferdelimiters
- set of delimiting characters. Can be null
if the token
is not delimited by any character.public java.lang.String parseValue(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferdelimiters
- set of delimiting characters. Can be null
if the value
is not delimited by any character.public void skipWhiteSpace(ByteSequence buf, ParserCursor cursor)
buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferpublic void skipComment(ByteSequence buf, ParserCursor cursor)
buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferpublic void skipAllWhiteSpace(ByteSequence buf, ParserCursor cursor)
buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferpublic void copyContent(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters, java.lang.StringBuilder dst)
buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferdelimiters
- set of delimiting characters. Can be null
if the value
is delimited by a whitespace or a comment only.dst
- destination bufferpublic void copyQuotedContent(ByteSequence buf, ParserCursor cursor, java.lang.StringBuilder dst)
buf
- buffer with the sequence of bytes to be parsedcursor
- defines the bounds and current position of the bufferdst
- destination buffer