public class

MailcapTokenizer

extends Object
java.lang.Object
   ↳ com.sun.activation.registries.MailcapTokenizer

Class Overview

A tokenizer for strings in the form of "foo/bar; prop1=val1; ... ". Useful for parsing MIME content types.

Summary

Constants
int EOI_TOKEN
int EQUALS_TOKEN
int SEMICOLON_TOKEN
int SLASH_TOKEN
int START_TOKEN
int STRING_TOKEN
int UNKNOWN_TOKEN
Fields
private char autoquoteChar
private int currentToken
private String currentTokenValue
private String data
private int dataIndex
private int dataLength
private boolean isAutoquoting
Public Constructors
MailcapTokenizer(String inputString)
Constructor
Public Methods
int getCurrentToken()
Retrieve current token.
String getCurrentTokenValue()
static String nameForToken(int token)
int nextToken()
void setIsAutoquoting(boolean value)
Set whether auto-quoting is on or off.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int EOI_TOKEN

Constant Value: 5 (0x00000005)

public static final int EQUALS_TOKEN

Constant Value: 61 (0x0000003d)

public static final int SEMICOLON_TOKEN

Constant Value: 59 (0x0000003b)

public static final int SLASH_TOKEN

Constant Value: 47 (0x0000002f)

public static final int START_TOKEN

Constant Value: 1 (0x00000001)

public static final int STRING_TOKEN

Constant Value: 2 (0x00000002)

public static final int UNKNOWN_TOKEN

Constant Value: 0 (0x00000000)

Fields

private char autoquoteChar

private int currentToken

private String currentTokenValue

private String data

private int dataIndex

private int dataLength

private boolean isAutoquoting

Public Constructors

public MailcapTokenizer (String inputString)

Constructor

Parameters
inputString

Public Methods

public int getCurrentToken ()

Retrieve current token.

public String getCurrentTokenValue ()

public static String nameForToken (int token)

Parameters
token

public int nextToken ()

public void setIsAutoquoting (boolean value)

Set whether auto-quoting is on or off. Auto-quoting means that all characters after the first non-whitespace, non-control character up to the auto-quote terminator character or EOI (minus any whitespace immediatley preceeding it) is considered a token. This is required for handling command strings in a mailcap entry.

Parameters
value