PojoFormatter
DefaultEnhancedPojoFormatter
, EnhancedPojoFormatterWrapper
public interface EnhancedPojoFormatter extends PojoFormatter
String
representation of a POJO.
Any implementation of EnhancedPojoFormatter
must have a public no-argument constructor. A new instance will
be created for each time that Pojomator.doToString(Object)
is called. Consequently, implementations do
not need to be thread safe.DefaultEnhancedPojoFormatter
Modifier and Type | Method | Description |
---|---|---|
void |
appendPropertyPrefix(StringBuilder builder,
PropertyElement property) |
Append the
String prefix for a given PropertyElement to the supplied
StringBuilder. |
void |
appendPropertySuffix(StringBuilder builder,
PropertyElement property) |
Append the
String suffix for a given PropertyElement to the supplied
StringBuilder. |
void |
appendToStringPrefix(StringBuilder builder,
Class<?> pojoClass) |
Append the
String which should appear at the beginning of the result of
toString() to the supplied StringBuilder. |
void |
appendToStringSuffix(StringBuilder builder,
Class<?> pojoClass) |
Append the
String which should appear at the end of the result of
toString() to the supplied StringBuilder. |
getPropertyPrefix, getPropertySuffix, getToStringPrefix, getToStringSuffix
void appendToStringPrefix(StringBuilder builder, Class<?> pojoClass)
String
which should appear at the beginning of the result of
toString()
to the supplied StringBuilder.builder
- the builder to append to.pojoClass
- the class for which toString()
is being calledObject.toString()
void appendToStringSuffix(StringBuilder builder, Class<?> pojoClass)
String
which should appear at the end of the result of
toString()
to the supplied StringBuilder.builder
- the builder to append to.pojoClass
- the class for which toString()
is being calledObject.toString()
void appendPropertyPrefix(StringBuilder builder, PropertyElement property)
String
prefix for a given PropertyElement
to the supplied
StringBuilder. This method will be called once for each property used in the result of
toString()
, in the order in which those properties will appear in that result,
and before the call to PropertyFormatter.format(Object)
for the property's value.builder
- the builder to append to.property
- the property for which to generate a prefixvoid appendPropertySuffix(StringBuilder builder, PropertyElement property)
String
suffix for a given PropertyElement
to the supplied
StringBuilder. This method will be called once after each call to
PropertyFormatter.format(Object)
for the property's value.builder
- the builder to append to.property
- the property for which to generate a suffixCopyright © 2008–2018. All rights reserved.