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 Token
jj_nt
Next token.Token
token
Current token.StructuredFieldParserTokenManager
token_source
Generated 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 void
disable_tracing()
Disable tracing.void
enable_tracing()
Enable tracing.ParseException
generateParseException()
Generate ParseException.Token
getNextToken()
Get the next Token.Token
getToken(int index)
Get the specific Token.boolean
isFoldingPreserved()
Should the \r\n folding sequence be preserved?String
parse()
Unfolds the input and removes comments.void
ReInit(InputStream stream)
Reinitialise.void
ReInit(InputStream stream, String encoding)
Reinitialise.void
ReInit(Reader stream)
Reinitialise.void
ReInit(StructuredFieldParserTokenManager tm)
Reinitialise.void
setFoldingPreserved(boolean preserveFolding)
Sets whether the \r\n folding sequence should be preserved.boolean
trace_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.
-
-