org.apache.james.mime4j.message
Class DefaultBodyDescriptorBuilder

java.lang.Object
  extended by org.apache.james.mime4j.message.DefaultBodyDescriptorBuilder
All Implemented Interfaces:
BodyDescriptorBuilder

public class DefaultBodyDescriptorBuilder
extends java.lang.Object
implements BodyDescriptorBuilder

Default BodyDescriptorBuilder implementation.


Constructor Summary
DefaultBodyDescriptorBuilder()
          Creates a new root BodyDescriptor instance.
DefaultBodyDescriptorBuilder(java.lang.String parentMimeType)
           
DefaultBodyDescriptorBuilder(java.lang.String parentMimeType, FieldParser<? extends ParsedField> fieldParser, DecodeMonitor monitor)
          Creates a new BodyDescriptor instance.
 
Method Summary
 Field addField(RawField rawfield)
          Updates builder's internal state by adding a new field.
 BodyDescriptor build()
          Builds an instance of BodyDescriptor based on the internal state.
 BodyDescriptorBuilder newChild()
          Creates an instance of BodyDescriptorBuilder to be used for processing of an embedded content body.
 void reset()
          Resets the internal state of the builder making it ready to process new input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBodyDescriptorBuilder

public DefaultBodyDescriptorBuilder()
Creates a new root BodyDescriptor instance.


DefaultBodyDescriptorBuilder

public DefaultBodyDescriptorBuilder(java.lang.String parentMimeType)

DefaultBodyDescriptorBuilder

public DefaultBodyDescriptorBuilder(java.lang.String parentMimeType,
                                    FieldParser<? extends ParsedField> fieldParser,
                                    DecodeMonitor monitor)
Creates a new BodyDescriptor instance.

Method Detail

reset

public void reset()
Description copied from interface: BodyDescriptorBuilder
Resets the internal state of the builder making it ready to process new input.

Specified by:
reset in interface BodyDescriptorBuilder

addField

public Field addField(RawField rawfield)
               throws MimeException
Description copied from interface: BodyDescriptorBuilder
Updates builder's internal state by adding a new field. The builder can optionally transform the unstructured field given an an input into a structured one and return an instance Field that also implements a richer interface for a particular type of fields such as Content-Type. The builder can also return null if the field is to be ignored.

Specified by:
addField in interface BodyDescriptorBuilder
Throws:
MimeException

build

public BodyDescriptor build()
Description copied from interface: BodyDescriptorBuilder
Builds an instance of BodyDescriptor based on the internal state.

Specified by:
build in interface BodyDescriptorBuilder

newChild

public BodyDescriptorBuilder newChild()
Description copied from interface: BodyDescriptorBuilder
Creates an instance of BodyDescriptorBuilder to be used for processing of an embedded content body. Please the child instance can inherit some of its parent properties such as MIME type.

Specified by:
newChild in interface BodyDescriptorBuilder


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.