An XML formatting type, which can be used to configure XML imports / exports. The type is immutable, meaning calls to setters like #header(boolean) do not modify the original reference, but return a new one instead. @author Lukas Eder
| 56 | * @author Lukas Eder |
| 57 | */ |
| 58 | public final class XMLFormat { |
| 59 | |
| 60 | public final static XMLFormat DEFAULT_FOR_RESULTS = new XMLFormat(); |
| 61 | public final static XMLFormat DEFAULT_FOR_RECORDS = new XMLFormat().header(false).xmlns(false); |
| 62 | |
| 63 | final boolean mutable; |
| 64 | |
| 65 | |
| 66 | |
| 67 | boolean xmlns; |
| 68 | boolean format; |
| 69 | String newline; |
| 70 | int globalIndent; |
| 71 | int indent; |
| 72 | String[] indented; |
| 73 | boolean header; |
| 74 | ValueFormat valueFormat; |
| 75 | RecordFormat recordFormat; |
| 76 | boolean quoteNested; |
| 77 | NullFormat nullFormat; |
| 78 | ArrayFormat arrayFormat; |
| 79 | BinaryFormat binaryFormat; |
| 80 | |
| 81 | public XMLFormat() { |
| 82 | this( |
| 83 | false, |
| 84 | |
| 85 | |
| 86 | |
| 87 | true, |
| 88 | false, |
| 89 | "\n", |
| 90 | 0, |
| 91 | 2, |
| 92 | null, |
| 93 | true, |
| 94 | ValueFormat.TO_TYPE, |
| 95 | RecordFormat.VALUE_ELEMENTS_WITH_FIELD_ATTRIBUTE, |
| 96 | false, |
| 97 | NullFormat.EMPTY_ELEMENT, |
| 98 | ArrayFormat.STRING, |
| 99 | BinaryFormat.BASE64 |
| 100 | ); |
| 101 | } |
| 102 | |
| 103 | private XMLFormat( |
| 104 | boolean mutable, |
| 105 | |
| 106 | |
| 107 | |
| 108 | boolean xmlns, |
| 109 | boolean format, |
| 110 | String newline, |
| 111 | int globalIndent, |
| 112 | int indent, |
| 113 | String[] indented, |
| 114 | boolean header, |
| 115 | ValueFormat valueFormat, |