Class AddressFormatter
java.lang.Object
org.apache.james.mime4j.field.address.AddressFormatter
Default formatter for
Address
and its subclasses.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(StringBuilder sb, Address address) Returns a string representation of this address that can be used for transport purposes.void
encode
(StringBuilder sb, Group group) void
encode
(StringBuilder sb, Mailbox mailbox) void
format
(StringBuilder sb, Address address, boolean includeRoute) Formats the address as a human readable string, not including the route.void
format
(StringBuilder sb, Group group, boolean includeRoute) void
format
(StringBuilder sb, Mailbox mailbox, boolean includeRoute)
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
AddressFormatter
protected AddressFormatter()
-
-
Method Details
-
format
Formats the address as a human readable string, not including the route. The resulting string is intended for display purposes only and cannot be used for transport purposes.
For example, if the unparsed address was
<"Joe Cheng"@joecheng.com>
this method would return
<Joe Cheng@joecheng.com>
which is not valid for transport; the local part would need to be re-quoted.- Parameters:
includeRoute
-true
if the route should be included if it exists,false
otherwise.
-
encode
Returns a string representation of this address that can be used for transport purposes. The route is never included in this representation because routes are obsolete and RFC 5322 states that obsolete syntactic forms MUST NOT be generated. -
format
-
format
-
encode
-
encode
-
format
-
format
-
encode
-
encode
-