|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pojomatic.formatter.DefaultPojoFormatter
public class DefaultPojoFormatter
Default formatter for classes that use Pojomatic. This implementation first presents
the class name, and then each property in turn, separated by commas, using braces to indicate
nesting.
For example, if a class Person has two properties, firstName and LastName, and these properties
are using DefaultPropertyFormatter, then the Person
instance representing Joe Blow would be represented as
"Person{firstName: {Joe}, lastName: {Blow}}"
| Constructor Summary | |
|---|---|
DefaultPojoFormatter()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getPropertyPrefix(PropertyElement property)
Get the String prefix for a given PropertyElement. |
java.lang.String |
getPropertySuffix(PropertyElement property)
Get the String suffix for a given PropertyElement. |
java.lang.String |
getToStringPrefix(java.lang.Class<?> pojoClass)
Get the String which should appear at the beginning of the result of
toString(). |
java.lang.String |
getToStringSuffix(java.lang.Class<?> pojoClass)
Get the String which should appear at the end of the result of
toString(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultPojoFormatter()
| Method Detail |
|---|
public java.lang.String getPropertyPrefix(PropertyElement property)
PojoFormatterString prefix for a given PropertyElement. 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.
getPropertyPrefix in interface PojoFormatterproperty - the property for which to generate a prefix
public java.lang.String getPropertySuffix(PropertyElement property)
PojoFormatterString suffix for a given PropertyElement. This method will be called
once after each call to PropertyFormatter.format(Object) for the property's value.
getPropertySuffix in interface PojoFormatterproperty - the property for which to generate a suffix
public java.lang.String getToStringPrefix(java.lang.Class<?> pojoClass)
PojoFormatterString which should appear at the beginning of the result of
toString().
getToStringPrefix in interface PojoFormatterpojoClass - the class for which toString() is being called
toString()Object.toString()public java.lang.String getToStringSuffix(java.lang.Class<?> pojoClass)
PojoFormatterString which should appear at the end of the result of
toString().
getToStringSuffix in interface PojoFormatterpojoClass - the class for which toString() is being called
toString()Object.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||