(Writer writer, XMLFormat format)
| 868 | } |
| 869 | |
| 870 | @Override |
| 871 | public final void formatXML(Writer writer, XMLFormat format) { |
| 872 | format = format.mutable(true); |
| 873 | |
| 874 | String newline = format.newline(); |
| 875 | int recordLevel = format.header() ? 2 : 1; |
| 876 | ConverterContext cc = converterContext(this); |
| 877 | |
| 878 | try { |
| 879 | writer.append("<result"); |
| 880 | if (format.xmlns()) { |
| 881 | format = format.xmlns(false); |
| 882 | writer.append(" xmlns=\"" + Constants.NS_EXPORT + "\""); |
| 883 | |
| 884 | if (format.nullFormat() == XSI_NIL) |
| 885 | writer.append(" xsi:xmlns=\"" + XSI_SCHEMA + "\""); |
| 886 | } |
| 887 | |
| 888 | writer.append(">"); |
| 889 | |
| 890 | if (format.header()) { |
| 891 | writer.append(newline).append(format.indentString(1)).append("<fields>"); |
| 892 | |
| 893 | for (Field<?> field : fields.fields.fields) { |
| 894 | writer.append(newline).append(format.indentString(2)).append("<field"); |
| 895 | |
| 896 | if (field instanceof TableField<?, ?> f) { |
| 897 | Table<?> table = f.getTable(); |
| 898 | |
| 899 | if (table != null) { |
| 900 | Schema schema = table.getSchema(); |
| 901 | |
| 902 | if (schema != null) { |
| 903 | writer.append(" schema=\""); |
| 904 | writer.append(escapeXML(schema.getName())); |
| 905 | writer.append("\""); |
| 906 | } |
| 907 | |
| 908 | writer.append(" table=\""); |
| 909 | writer.append(escapeXML(table.getName())); |
| 910 | writer.append("\""); |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | writer.append(" name=\""); |
| 915 | writer.append(escapeXML(field.getName())); |
| 916 | writer.append("\""); |
| 917 | |
| 918 | if (!field.getDataType().getQualifiedName().empty()) { |
| 919 | writer.append(" type=\""); |
| 920 | writer.append(escapeXML(formatTypeName(field))); |
| 921 | writer.append("\""); |
| 922 | } |
| 923 | |
| 924 | writer.append("/>"); |
| 925 | } |
| 926 | |
| 927 | writer.append(newline).append(format.indentString(1)).append("</fields>"); |
nothing calls this directly
no test coverage detected