|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.syncml.pim.VParser
public abstract class VParser
This interface is used to parse the V format files, such as VCard & VCal
| Field Summary | |
|---|---|
protected String |
mBuffer
The buffer used to store input stream |
protected VBuilder |
mBuilder
The builder to build parsed data |
protected String |
mDefaultEncoding
|
protected String |
mEncoding
The encoding type |
protected int |
PARSE_ERROR
|
| Constructor Summary | |
|---|---|
VParser()
|
|
| Method Summary | |
|---|---|
protected String |
getWord(int offset)
Get a word from current position. |
protected boolean |
isLetter(char ch)
If it is a letter. |
protected boolean |
isLetterOrDigit(char ch)
If it is a letter or digit. |
protected boolean |
isPrintable(char ch)
If it is printable in ASCII |
boolean |
parse(InputStream is,
String encoding,
VBuilder builder)
Parse the given stream |
protected int |
parse8bit(int offset)
Refer to RFC 1521, 8bit text |
protected int |
parseBase64(int offset)
Refer to RFC 1521, base64 text The end of the text is marked with two CRLF sequences |
protected int |
parseCharsetVal(int offset)
Refer to RFC1521, section 7.1 If is: "us-ascii" / "iso-8859-xxx" / "X-" word |
protected int |
parseCrlf(int offset)
If offset reach '\r\n' return 2. |
protected int |
parseLangVal(int offset)
Refer to RFC 1766 like: XXX(sequence letters)-XXX(sequence letters) |
protected int |
parseOctet(int offset)
start with "=" two of (DIGIT / "A" / "B" / "C" / "D" / "E" / "F") So maybe return 3. |
protected int |
parsePEncodingVal(int offset)
If is: "7BIT" / "8BIT" / "QUOTED-PRINTABLE" / "BASE64" / "X-" word and set mEncoding. |
protected int |
parsePtext(int offset)
return 1 or 3 |
protected int |
parsePValueVal(int offset)
If is: "INLINE" / "URL" / "CONTENT-ID" / "CID" / "X-" word |
protected int |
parseQuotedPrintable(int offset)
Refer to RFC 1521, quoted printable text ([*(ptext / SPACE / TAB) ptext] ["="] CRLF) |
protected int |
parseString(int offset,
String tar,
boolean ignoreCase)
To determine if the given string equals to the start of the current string. |
protected int |
parseTag(int offset)
From first 8 position, is sequence LETTER. |
protected int |
parseValue(int offset)
From offset, parse as :mEncoding ?= 7bit / 8bit / quoted-printable / base64 |
protected abstract int |
parseVFile(int offset)
abstract function, waiting implement. analyse from offset, return the length of consumed property. |
protected int |
parseWord(int offset)
Any printable ASCII sequence except [ ]=:.,; |
protected int |
parseWsls(int offset)
From offset, jump ' ', '\t', '\r\n' sequence, return the length of jump. 1 * (SPACE / HTAB / CRLF) |
protected int |
parseXWord(int offset)
"X-" word, and its value. |
protected int |
removeWs(int offset)
Skip the white space in string. |
protected void |
setInputStream(InputStream is,
String encoding)
Copy the content of input stream and filter the "folding" |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String mBuffer
protected VBuilder mBuilder
protected String mEncoding
protected final int PARSE_ERROR
protected final String mDefaultEncoding
| Constructor Detail |
|---|
public VParser()
| Method Detail |
|---|
protected int parseCrlf(int offset)
public boolean parse(InputStream is,
String encoding,
VBuilder builder)
throws IOException
is - The source to parse.encoding - The encoding type.builder - The v builder which used to construct data.
IOException
protected void setInputStream(InputStream is,
String encoding)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected abstract int parseVFile(int offset)
protected int parseWsls(int offset)
protected int parseString(int offset,
String tar,
boolean ignoreCase)
offset - The offset in buffer of current stringtar - The given string.ignoreCase - To determine case sensitive or not.
protected int removeWs(int offset)
protected int parseXWord(int offset)
protected int parseValue(int offset)
protected int parse8bit(int offset)
protected int parseQuotedPrintable(int offset)
protected int parsePtext(int offset)
protected int parseOctet(int offset)
protected int parseBase64(int offset)
protected int parseWord(int offset)
protected boolean isLetterOrDigit(char ch)
protected boolean isPrintable(char ch)
protected boolean isLetter(char ch)
protected String getWord(int offset)
protected int parsePValueVal(int offset)
protected int parsePEncodingVal(int offset)
protected int parseCharsetVal(int offset)
protected int parseLangVal(int offset)
protected int parseTag(int offset)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||