Search in sources :

Example 1 with JpsModulePropertiesSerializer

use of org.jetbrains.jps.model.serialization.module.JpsModulePropertiesSerializer in project intellij-plugins by JetBrains.

the class JpsFlexModuleType method createModulePropertiesSerializer.

public static JpsModulePropertiesSerializer<JpsFlexBuildConfigurationManager> createModulePropertiesSerializer() {
    return new JpsModulePropertiesSerializer<JpsFlexBuildConfigurationManager>(INSTANCE, ID, "FlexBuildConfigurationManager") {

        @Override
        public JpsFlexBuildConfigurationManager loadProperties(@Nullable final Element componentElement) {
            final JpsFlexBuildConfigurationManagerImpl manager = new JpsFlexBuildConfigurationManagerImpl();
            manager.loadState(XmlSerializer.deserialize(componentElement, JpsFlexBuildConfigurationManagerImpl.State.class));
            return manager;
        }

        @Override
        public void saveProperties(@NotNull final JpsFlexBuildConfigurationManager manager, @NotNull final Element componentElement) {
            final JpsFlexBuildConfigurationManagerImpl.State state = ((JpsFlexBuildConfigurationManagerImpl) manager).getState();
            XmlSerializer.serializeInto(state, componentElement);
        }
    };
}
Also used : Element(org.jdom.Element) JpsFlexBuildConfigurationManagerImpl(com.intellij.flex.model.bc.impl.JpsFlexBuildConfigurationManagerImpl) JpsFlexBuildConfigurationManager(com.intellij.flex.model.bc.JpsFlexBuildConfigurationManager) JpsModulePropertiesSerializer(org.jetbrains.jps.model.serialization.module.JpsModulePropertiesSerializer) NotNull(org.jetbrains.annotations.NotNull) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

JpsFlexBuildConfigurationManager (com.intellij.flex.model.bc.JpsFlexBuildConfigurationManager)1 JpsFlexBuildConfigurationManagerImpl (com.intellij.flex.model.bc.impl.JpsFlexBuildConfigurationManagerImpl)1 Element (org.jdom.Element)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1 JpsModulePropertiesSerializer (org.jetbrains.jps.model.serialization.module.JpsModulePropertiesSerializer)1