Class StructuredFieldParser
- java.lang.Object
-
- org.apache.james.mime4j.field.structured.parser.StructuredFieldParser
-
- All Implemented Interfaces:
StructuredFieldParserConstants
public class StructuredFieldParser extends Object implements StructuredFieldParserConstants
Parses generic structure fields. Unfolds and removes comments.
-
-
Field Summary
Fields Modifier and Type Field Description Tokenjj_ntNext token.TokentokenCurrent token.StructuredFieldParserTokenManagertoken_sourceGenerated Token Manager.-
Fields inherited from interface org.apache.james.mime4j.field.structured.parser.StructuredFieldParserConstants
ANY, CONTENT, DEFAULT, EOF, FOLD, INCOMMENT, INQUOTEDSTRING, NESTED_COMMENT, QUOTEDPAIR, QUOTEDSTRING, STRING_CONTENT, tokenImage, WS
-
-
Constructor Summary
Constructors Constructor Description StructuredFieldParser(InputStream stream)Constructor with InputStream.StructuredFieldParser(InputStream stream, String encoding)Constructor with InputStream and supplied encodingStructuredFieldParser(Reader stream)Constructor.StructuredFieldParser(StructuredFieldParserTokenManager tm)Constructor with generated Token Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable_tracing()Disable tracing.voidenable_tracing()Enable tracing.ParseExceptiongenerateParseException()Generate ParseException.TokengetNextToken()Get the next Token.TokengetToken(int index)Get the specific Token.booleanisFoldingPreserved()Should the \r\n folding sequence be preserved?Stringparse()Unfolds the input and removes comments.voidReInit(InputStream stream)Reinitialise.voidReInit(InputStream stream, String encoding)Reinitialise.voidReInit(Reader stream)Reinitialise.voidReInit(StructuredFieldParserTokenManager tm)Reinitialise.voidsetFoldingPreserved(boolean preserveFolding)Sets whether the \r\n folding sequence should be preserved.booleantrace_enabled()Trace enabled.
-
-
-
Field Detail
-
token_source
public StructuredFieldParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
StructuredFieldParser
public StructuredFieldParser(InputStream stream)
Constructor with InputStream.
-
StructuredFieldParser
public StructuredFieldParser(InputStream stream, String encoding)
Constructor with InputStream and supplied encoding
-
StructuredFieldParser
public StructuredFieldParser(Reader stream)
Constructor.
-
StructuredFieldParser
public StructuredFieldParser(StructuredFieldParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
isFoldingPreserved
public boolean isFoldingPreserved()
Should the \r\n folding sequence be preserved?
-
setFoldingPreserved
public void setFoldingPreserved(boolean preserveFolding)
Sets whether the \r\n folding sequence should be preserved.
-
parse
public String parse() throws ParseException
Unfolds the input and removes comments.- Returns:
- unfolded header value with comments removed
- Throws:
ParseException
-
ReInit
public void ReInit(InputStream stream)
Reinitialise.
-
ReInit
public void ReInit(InputStream stream, String encoding)
Reinitialise.
-
ReInit
public void ReInit(Reader stream)
Reinitialise.
-
ReInit
public void ReInit(StructuredFieldParserTokenManager tm)
Reinitialise.
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
trace_enabled
public final boolean trace_enabled()
Trace enabled.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-