1 package org.pojomatic.formatter;
2
3 import org.pojomatic.Pojomatic;
4 import org.pojomatic.PropertyElement;
5
6
7
8
9
10
11
12
13
14
15
16
17
18 @Deprecated
19 public class DefaultPojoFormatter implements PojoFormatter {
20 private boolean firstPropertyPrinted = false;
21
22 @Override
23 public String getPropertyPrefix(PropertyElement property) {
24 StringBuilder result = new StringBuilder();
25 if (firstPropertyPrinted) {
26 result.append(", ");
27 }
28 else {
29 firstPropertyPrinted = true;
30 }
31 return result.append(property.getName()).append(": {").toString();
32 }
33
34 @Override
35 public String getPropertySuffix(PropertyElement property) {
36 return "}";
37 }
38
39 @Override
40 public String getToStringPrefix(Class<?> pojoClass) {
41 return pojoClass.getSimpleName() + "{";
42 }
43
44 @Override
45 public String getToStringSuffix(Class<?> pojoClass) {
46 return "}";
47 }
48 }