Search in sources :

Example 1 with SampleConverter

use of org.stepik.core.serialization.SampleConverter in project intellij-plugins by StepicOrg.

the class StepikProjectManager method getXStream.

@NotNull
public static XStream getXStream() {
    if (xStream == null) {
        xStream = new XStream(new DomDriver());
        xStream.alias("StepikProjectManager", StepikProjectManager.class);
        xStream.alias("CourseNode", CourseNode.class);
        xStream.alias("SectionNode", SectionNode.class);
        xStream.alias("LessonNode", LessonNode.class);
        xStream.alias("StepNode", StepNode.class);
        xStream.alias("Limit", Limit.class);
        xStream.alias("SupportedLanguages", SupportedLanguages.class);
        xStream.alias("VideoUrl", VideoUrl.class);
        xStream.alias("LinkedTreeMap", LinkedTreeMap.class);
        xStream.alias("Sample", Sample.class);
        xStream.alias("Course", Course.class);
        xStream.alias("Section", Section.class);
        xStream.alias("CompoundUnitLesson", CompoundUnitLesson.class);
        xStream.alias("Step", Step.class);
        xStream.alias("User", User.class);
        xStream.autodetectAnnotations(true);
        xStream.setClassLoader(StepikProjectManager.class.getClassLoader());
        xStream.registerConverter(new SupportedLanguagesConverter());
        xStream.registerConverter(new SampleConverter());
        xStream.ignoreUnknownElements();
        xStream.setMode(XStream.ID_REFERENCES);
    }
    return xStream;
}
Also used : DomDriver(com.thoughtworks.xstream.io.xml.DomDriver) SupportedLanguagesConverter(org.stepik.core.serialization.SupportedLanguagesConverter) XStream(com.thoughtworks.xstream.XStream) SampleConverter(org.stepik.core.serialization.SampleConverter) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

XStream (com.thoughtworks.xstream.XStream)1 DomDriver (com.thoughtworks.xstream.io.xml.DomDriver)1 NotNull (org.jetbrains.annotations.NotNull)1 SampleConverter (org.stepik.core.serialization.SampleConverter)1 SupportedLanguagesConverter (org.stepik.core.serialization.SupportedLanguagesConverter)1