Class DefaultFieldBuilder
java.lang.Object
org.apache.james.mime4j.stream.DefaultFieldBuilder
- All Implemented Interfaces:
FieldBuilder
Default implementation of
FieldBuilder.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ThreadLocal<SoftReference<BufferRecycler>> private final RecycledByteArrayBufferprivate static final BitSetprivate final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(ByteArrayBuffer line) Updates builder's internal state by adding a new line of text.build()Builds an instance ofRawFieldbased on the internal state.static BufferRecyclergetRaw()Returns combined content of all lines processed so far ornullif the builder does not retain original raw content.voidrelease()voidreset()Resets the internal state of the builder making it ready to process new input.
-
Field Details
-
_recyclerRef
-
FIELD_CHARS
-
buf
-
maxlen
private final int maxlen
-
-
Constructor Details
-
DefaultFieldBuilder
public DefaultFieldBuilder(int maxlen)
-
-
Method Details
-
getBufferRecycler
-
reset
public void reset()Description copied from interface:FieldBuilderResets the internal state of the builder making it ready to process new input.- Specified by:
resetin interfaceFieldBuilder
-
append
Description copied from interface:FieldBuilderUpdates builder's internal state by adding a new line of text.- Specified by:
appendin interfaceFieldBuilder- Throws:
MaxHeaderLengthLimitException
-
build
Description copied from interface:FieldBuilderBuilds an instance ofRawFieldbased on the internal state.- Specified by:
buildin interfaceFieldBuilder- Throws:
MimeException
-
getRaw
Description copied from interface:FieldBuilderReturns combined content of all lines processed so far ornullif the builder does not retain original raw content.- Specified by:
getRawin interfaceFieldBuilder
-
release
public void release()- Specified by:
releasein interfaceFieldBuilder
-