src/main/java/de/blau/android/presets/PresetItem.java
/**
     * Output the preset fields to XML Will add optional tags where necessary
     * 
     * @param fields a map containing the fields
     * @param s the serializer
     * @throws IOException
     */
Output the preset fields to XML Will add optional tags where necessary

@param fields a map containing the fields
@param s the serializer
@throws IOException
Output the preset fields to XML Will add optional tags where necessary @param fields a map containing the fields @param s the serializer @throws IOException
private void fieldsToXml(@NonNull XmlSerializer s, @NonNull Map<String, PresetField> fields) throws IOException {
        boolean inOptional = false;
        for (Entry<String, PresetField> entry : fields.entrySet()) {
            PresetField field = entry.getValue();
            if (field instanceof PresetFixedField) {
                continue;
            }
            if (!inOptional && field.isOptional()) {
                s.startTag("", Preset.OPTIONAL);
                inOptional = true;
            }
            if (inOptional && !field.isOptional()) {
                s.endTag("", Preset.OPTIONAL);
                inOptional = false;
            }
            field.toXml(s);
        }
        if (inOptional) {
            s.endTag("", Preset.OPTIONAL);
        }
    }
private void fieldsToXml ( @ NonNull XmlSerializer s , @ NonNull Map < String , PresetField > fields ) throws IOException { boolean inOptional = false ; for ( Entry < String , PresetField > entry : fields . entrySet ( ) ) { PresetField field = entry . getValue ( ) ; if ( field instanceof PresetFixedField ) { continue ; } if ( ! inOptional && field . isOptional ( ) ) { s . startTag ( "" , Preset . OPTIONAL ) ; inOptional = true ; } if ( inOptional && ! field . isOptional ( ) ) { s . endTag ( "" , Preset . OPTIONAL ) ; inOptional = false ; } field . toXml ( s ) ; } if ( inOptional ) { s . endTag ( "" , Preset . OPTIONAL ) ; } }
Output the preset fields to XML Will add optional tags where necessary
Output the preset fields to XML Will add optional tags where necessary