Package org.apache.james.mime4j.stream
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 RecycledByteArrayBuffer
private static final BitSet
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(ByteArrayBuffer line) Updates builder's internal state by adding a new line of text.build()
Builds an instance ofRawField
based on the internal state.static BufferRecycler
getRaw()
Returns combined content of all lines processed so far ornull
if the builder does not retain original raw content.void
release()
void
reset()
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:FieldBuilder
Resets the internal state of the builder making it ready to process new input.- Specified by:
reset
in interfaceFieldBuilder
-
append
Description copied from interface:FieldBuilder
Updates builder's internal state by adding a new line of text.- Specified by:
append
in interfaceFieldBuilder
- Throws:
MaxHeaderLengthLimitException
-
build
Description copied from interface:FieldBuilder
Builds an instance ofRawField
based on the internal state.- Specified by:
build
in interfaceFieldBuilder
- Throws:
MimeException
-
getRaw
Description copied from interface:FieldBuilder
Returns combined content of all lines processed so far ornull
if the builder does not retain original raw content.- Specified by:
getRaw
in interfaceFieldBuilder
-
release
public void release()- Specified by:
release
in interfaceFieldBuilder
-