
org.carrot2.util.simplexml.ListSimpleXmlWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of carrot2-mini Show documentation
Show all versions of carrot2-mini Show documentation
Carrot2 search results clustering framework. Minimal functional subset
(core algorithms and infrastructure, no document sources).
/*
* Carrot2 project.
*
* Copyright (C) 2002-2015, Dawid Weiss, Stanisław Osiński.
* All rights reserved.
*
* Refer to the full license file "carrot2.LICENSE"
* in the root folder of the repository checkout or at:
* http://www.carrot2.org/carrot2.LICENSE
*/
package org.carrot2.util.simplexml;
import java.util.ArrayList;
import java.util.List;
import org.carrot2.util.ListUtils;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.core.Commit;
import org.simpleframework.xml.core.Persist;
@Root(name = "list")
@SuppressWarnings(
{
"unchecked", "unused", "rawtypes"
})
class ListSimpleXmlWrapper implements ISimpleXmlWrapper
{
private List values;
@ElementList(name = "list")
private ArrayList forSerialization;
public List getValue()
{
return values;
}
public void setValue(List value)
{
values = ListUtils.asArrayList(value);
}
@Persist
private void beforeSerialization()
{
forSerialization = ListUtils.asArrayList(SimpleXmlWrappers.wrap(values));
}
@Commit
private void afterSerialization()
{
values = SimpleXmlWrappers.unwrap(forSerialization);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy