FileDocCategorySizeDatePackage
DelegatingFieldParser.javaAPI DocAndroid 1.5 API1685Wed May 06 22:42:46 BST 2009org.apache.james.mime4j.field

DelegatingFieldParser

public class DelegatingFieldParser extends Object implements FieldParser

Fields Summary
private Map
parsers
private FieldParser
defaultParser
Constructors Summary
Methods Summary
public FieldParsergetParser(java.lang.String name)

        final FieldParser field = (FieldParser) parsers.get(name.toLowerCase());
        if(field==null) {
            return defaultParser;
        }
        return field;
    
public Fieldparse(java.lang.String name, java.lang.String body, java.lang.String raw)

        final FieldParser parser = getParser(name);
        return parser.parse(name, body, raw);
    
public voidsetFieldParser(java.lang.String name, FieldParser parser)
Sets the parser used for the field named name.

param
name the name of the field
param
parser the parser for fields named name

    
                                 
            
        parsers.put(name.toLowerCase(), parser);