de.micromata.opengis.kml.v_2_2_0.BooleanConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JavaAPIforKml Show documentation
Show all versions of JavaAPIforKml Show documentation
This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.
package de.micromata.opengis.kml.v_2_2_0;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
public final class BooleanConverter
extends XmlAdapter
{
@Override
public Boolean unmarshal(final Integer i)
throws Exception
{
return ((i == null)?null:(i == 1));
}
@Override
public Integer marshal(final Boolean b)
throws Exception
{
return ((b == null)?null:(b? 1 : 0));
}
}