Search in sources :

Example 11 with SkipDefaultValuesSerializationFilters

use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-plugins by JetBrains.

the class ConversionHelper method serialize.

//public static ModifiableFlexBuildConfiguration createConfigInstance(String name) {
//  FlexBuildConfigurationImpl c = new FlexBuildConfigurationImpl();
//  c.setName(name);
//  return c;
//}
//
public static Element serialize(PersistentStateComponent c) {
    Element element = XmlSerializer.serialize(c.getState(), new SkipDefaultValuesSerializationFilters());
    collapsePaths(element);
    return element;
}
Also used : SkipDefaultValuesSerializationFilters(com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters) Element(org.jdom.Element)

Example 12 with SkipDefaultValuesSerializationFilters

use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.

the class NamedScopeManager method getState.

@Override
public Element getState() {
    Element state = super.getState();
    XmlSerializer.serializeInto(myOrderState, state, new SkipDefaultValuesSerializationFilters());
    return state;
}
Also used : SkipDefaultValuesSerializationFilters(com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters) Element(org.jdom.Element)

Example 13 with SkipDefaultValuesSerializationFilters

use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.

the class MultilanguageDuplocatorSettings method getState.

@Override
public Element getState() {
    synchronized (mySettingsMap) {
        Element state = new Element("state");
        if (mySettingsMap.isEmpty()) {
            return state;
        }
        SkipDefaultValuesSerializationFilters filter = new SkipDefaultValuesSerializationFilters();
        for (String name : mySettingsMap.keySet()) {
            Element child = XmlSerializer.serializeIfNotDefault(mySettingsMap.get(name), filter);
            if (child != null) {
                child.setName("object");
                child.setAttribute("language", name);
                state.addContent(child);
            }
        }
        return state;
    }
}
Also used : SkipDefaultValuesSerializationFilters(com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters) Element(org.jdom.Element)

Example 14 with SkipDefaultValuesSerializationFilters

use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.

the class JpsFacetSerializer method saveFacets.

public static void saveFacets(JpsModule module, @NotNull Element facetManagerElement) {
    FacetManagerState managerState = new FacetManagerState();
    for (JpsModelSerializerExtension extension : JpsModelSerializerExtension.getExtensions()) {
        for (JpsFacetConfigurationSerializer<?> serializer : extension.getFacetConfigurationSerializers()) {
            if (serializer.hasExtension(module)) {
                serializer.saveExtension(module, managerState.getFacets());
            }
        }
    }
    XmlSerializer.serializeInto(managerState, facetManagerElement, new SkipDefaultValuesSerializationFilters());
}
Also used : SkipDefaultValuesSerializationFilters(com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters) JpsModelSerializerExtension(org.jetbrains.jps.model.serialization.JpsModelSerializerExtension)

Example 15 with SkipDefaultValuesSerializationFilters

use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.

the class WebBrowserManager method getState.

@Override
public Element getState() {
    Element state = new Element("state");
    if (defaultBrowserPolicy != DefaultBrowserPolicy.SYSTEM) {
        state.setAttribute("default", defaultBrowserPolicy.name().toLowerCase(Locale.ENGLISH));
    }
    if (!myShowBrowserHover) {
        state.setAttribute("showHover", "false");
    }
    if (!browsers.equals(PREDEFINED_BROWSERS)) {
        for (ConfigurableWebBrowser browser : browsers) {
            Element entry = new Element("browser");
            entry.setAttribute("id", browser.getId().toString());
            entry.setAttribute("name", browser.getName());
            entry.setAttribute("family", browser.getFamily().name());
            String path = browser.getPath();
            if (path != null && !path.equals(browser.getFamily().getExecutionPath())) {
                entry.setAttribute("path", path);
            }
            if (!browser.isActive()) {
                entry.setAttribute("active", "false");
            }
            BrowserSpecificSettings specificSettings = browser.getSpecificSettings();
            if (specificSettings != null) {
                Element settingsElement = new Element("settings");
                XmlSerializer.serializeInto(specificSettings, settingsElement, new SkipDefaultValuesSerializationFilters());
                if (!JDOMUtil.isEmpty(settingsElement)) {
                    entry.addContent(settingsElement);
                }
            }
            state.addContent(entry);
        }
    }
    return state;
}
Also used : SkipDefaultValuesSerializationFilters(com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters) Element(org.jdom.Element)

Aggregations

SkipDefaultValuesSerializationFilters (com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters)15 Element (org.jdom.Element)10 PersistentStateComponent (com.intellij.openapi.components.PersistentStateComponent)1 Accessor (com.intellij.util.xmlb.Accessor)1 XExpression (com.intellij.xdebugger.XExpression)1 XExpressionState (com.intellij.xdebugger.impl.breakpoints.XExpressionState)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1 ProcessorConfigProfile (org.jetbrains.jps.model.java.compiler.ProcessorConfigProfile)1 JpsModelSerializerExtension (org.jetbrains.jps.model.serialization.JpsModelSerializerExtension)1 ArtifactPropertiesState (org.jetbrains.jps.model.serialization.artifact.ArtifactPropertiesState)1