Class ContentLanguageParser
- java.lang.Object
-
- org.apache.james.mime4j.field.language.parser.ContentLanguageParser
-
- All Implemented Interfaces:
ContentLanguageParserConstants
public class ContentLanguageParser extends Object implements ContentLanguageParserConstants
-
-
Field Summary
Fields Modifier and Type Field Description Token
jj_nt
Next token.Token
token
Current token.ContentLanguageParserTokenManager
token_source
Generated Token Manager.-
Fields inherited from interface org.apache.james.mime4j.field.language.parser.ContentLanguageParserConstants
ALPHA, ALPHANUM, ANY, COMMENT, DEFAULT, DIGITS, DOT, EOF, INCOMMENT, INQUOTEDSTRING, NESTED_COMMENT, QUOTEDPAIR, QUOTEDSTRING, tokenImage, WS
-
-
Constructor Summary
Constructors Constructor Description ContentLanguageParser(InputStream stream)
Constructor with InputStream.ContentLanguageParser(InputStream stream, String encoding)
Constructor with InputStream and supplied encodingContentLanguageParser(Reader stream)
Constructor.ContentLanguageParser(ContentLanguageParserTokenManager 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.String
language()
List<String>
parse()
Parses the input into a list of language tags.void
ReInit(InputStream stream)
Reinitialise.void
ReInit(InputStream stream, String encoding)
Reinitialise.void
ReInit(Reader stream)
Reinitialise.void
ReInit(ContentLanguageParserTokenManager tm)
Reinitialise.boolean
trace_enabled()
Trace enabled.
-
-
-
Field Detail
-
token_source
public ContentLanguageParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
ContentLanguageParser
public ContentLanguageParser(InputStream stream)
Constructor with InputStream.
-
ContentLanguageParser
public ContentLanguageParser(InputStream stream, String encoding)
Constructor with InputStream and supplied encoding
-
ContentLanguageParser
public ContentLanguageParser(Reader stream)
Constructor.
-
ContentLanguageParser
public ContentLanguageParser(ContentLanguageParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
parse
public List<String> parse() throws ParseException
Parses the input into a list of language tags.- Returns:
- list of language tag Strings
- Throws:
ParseException
-
language
public final String language() throws ParseException
- 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(ContentLanguageParserTokenManager 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.
-
-