SettingsState () { SettingsState settingsState = new SettingsState(); settingsState.setDataViewSettings(myDataViewSettings); settingsState.setGeneralSettings(myGeneralSettings); SETTINGS_EP.forEachExtensionSafe(settings -> { Object subState = settings.getState(); if (subState != null) { Element serializedState = XmlSerializer.serialize(subState); if (serializedState != null) { SpecificSettingsState state = new SpecificSettingsState(); state.id = settings.getId(); state.configuration = serializedState; settingsState.specificStates.add(state); } } }); return settingsState; }