Class StructuredFieldParser
java.lang.Object
org.apache.james.mime4j.field.structured.parser.StructuredFieldParser
- All Implemented Interfaces:
StructuredFieldParserConstants
Parses generic structure fields.
Unfolds and removes comments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<int[]> private int[]private int(package private) SimpleCharStreamprivate intprivate final int[]private static int[]Next token.private intprivate booleanCurrent token.Generated Token Manager.private booleanFields inherited from interface StructuredFieldParserConstants
ANY, CONTENT, DEFAULT, EOF, FOLD, INCOMMENT, INQUOTEDSTRING, NESTED_COMMENT, QUOTEDPAIR, QUOTEDSTRING, STRING_CONTENT, tokenImage, WS -
Constructor Summary
ConstructorsConstructorDescriptionStructuredFieldParser(InputStream stream) Constructor with InputStream.StructuredFieldParser(InputStream stream, String encoding) Constructor with InputStream and supplied encodingStructuredFieldParser(Reader stream) Constructor.Constructor with generated Token Manager. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidDisable tracing.private final StringdoParse()final voidEnable tracing.Generate ParseException.final TokenGet the next Token.final TokengetToken(int index) Get the specific Token.booleanShould the \r\n folding sequence be preserved?private Tokenjj_consume_token(int kind) private static voidprivate intjj_ntk_f()parse()Unfolds the input and removes comments.voidReInit(InputStream stream) Reinitialise.voidReInit(InputStream stream, String encoding) Reinitialise.voidReinitialise.voidReinitialise.voidsetFoldingPreserved(boolean preserveFolding) Sets whether the \r\n folding sequence should be preserved.final booleanTrace enabled.
-
Field Details
-
preserveFolding
private boolean preserveFolding -
token_source
Generated Token Manager. -
jj_input_stream
SimpleCharStream jj_input_stream -
token
Current token. -
jj_nt
Next token. -
jj_ntk
private int jj_ntk -
jj_gen
private int jj_gen -
jj_la1
private final int[] jj_la1 -
jj_la1_0
private static int[] jj_la1_0 -
jj_expentries
-
jj_expentry
private int[] jj_expentry -
jj_kind
private int jj_kind -
trace_enabled
private boolean trace_enabled
-
-
Constructor Details
-
StructuredFieldParser
Constructor with InputStream. -
StructuredFieldParser
Constructor with InputStream and supplied encoding -
StructuredFieldParser
Constructor. -
StructuredFieldParser
Constructor with generated Token Manager.
-
-
Method Details
-
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
Unfolds the input and removes comments.- Returns:
- unfolded header value with comments removed
- Throws:
ParseException
-
doParse
- Throws:
ParseException
-
jj_la1_init_0
private static void jj_la1_init_0() -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
jj_consume_token
- Throws:
ParseException
-
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
jj_ntk_f
private int jj_ntk_f() -
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.
-