<commit_before>package org.citygml4j.builder.json.marshal.citygml;

import java.util.Collections;
import java.util.List;

import org.citygml4j.builder.json.marshal.CityJSONMarshaller;
import org.citygml4j.builder.json.marshal.citygml.appearance.AppearanceMarshaller;
import org.citygml4j.builder.json.marshal.citygml.building.BuildingMarshaller;
import org.citygml4j.builder.json.marshal.citygml.cityfurniture.CityFurnitureMarshaller;
import org.citygml4j.builder.json.marshal.citygml.core.CoreMarshaller;
import org.citygml4j.builder.json.marshal.citygml.generics.GenericsMarshaller;
import org.citygml4j.builder.json.marshal.citygml.landuse.LandUseMarshaller;
import org.citygml4j.builder.json.marshal.citygml.relief.ReliefMarshaller;
import org.citygml4j.builder.json.marshal.citygml.transportation.TransportationMarshaller;
import org.citygml4j.builder.json.marshal.citygml.vegetation.VegetationMarshaller;
import org.citygml4j.builder.json.marshal.citygml.waterbody.WaterBodyMarshaller;
import org.citygml4j.builder.json.objects.feature.AbstractCityObjectType;
import org.citygml4j.builder.json.objects.geometry.SemanticsType;
import org.citygml4j.model.citygml.building.BuildingModuleComponent;
import org.citygml4j.model.citygml.cityfurniture.CityFurnitureModuleComponent;
import org.citygml4j.model.citygml.core.AbstractCityObject;
import org.citygml4j.model.citygml.core.CoreModuleComponent;
import org.citygml4j.model.citygml.generics.GenericsModuleComponent;
import org.citygml4j.model.citygml.relief.ReliefModuleComponent;
import org.citygml4j.model.citygml.transportation.TransportationModuleComponent;
import org.citygml4j.model.citygml.vegetation.VegetationModuleComponent;
import org.citygml4j.model.citygml.waterbody.WaterBodyModuleComponent;
import org.citygml4j.model.common.base.ModelObject;

public class CityGMLMarshaller {
	private final CityJSONMarshaller json;
	
	private final AppearanceMarshaller app;
	private final BuildingMarshaller bldg;
	private final CityFurnitureMarshaller frn;
	private final CoreMarshaller core;
	private final GenericsMarshaller gen;
	private final LandUseMarshaller luse;
	private final ReliefMarshaller dem;
	private final TransportationMarshaller tran;
	private final VegetationMarshaller veg;
	private final WaterBodyMarshaller wtr;
	
	public CityGMLMarshaller(CityJSONMarshaller json) {
		this.json = json;
		
		app = new AppearanceMarshaller(this);
		bldg = new BuildingMarshaller(this);
		frn = new CityFurnitureMarshaller(this);
		core = new CoreMarshaller(this);
		gen = new GenericsMarshaller(this);
		luse = new LandUseMarshaller(this);
		dem = new ReliefMarshaller(this);
		tran = new TransportationMarshaller(this);
		veg = new VegetationMarshaller(this);
		wtr = new WaterBodyMarshaller(this);
	}
	
	public List<AbstractCityObjectType> marshal(ModelObject src) {
		List<AbstractCityObjectType> dest = null;
		
		if (src instanceof BuildingModuleComponent)
			dest = bldg.marshal(src);		
		else if (src instanceof CityFurnitureModuleComponent)
			dest = frn.marshal(src);		
		else if (src instanceof GenericsModuleComponent)
			dest = gen.marshal(src);		
		else if (src instanceof ReliefModuleComponent)
			dest = dem.marshal(src);
		else if (src instanceof TransportationModuleComponent)
			dest = tran.marshal(src);
		else if (src instanceof VegetationModuleComponent)
			dest = veg.marshal(src);
		else if (src instanceof WaterBodyModuleComponent)<commit_msg>added support for LandUse<commit_after>package org.citygml4j.builder.json.marshal.citygml;

import java.util.Collections;
import java.util.List;

import org.citygml4j.builder.json.marshal.CityJSONMarshaller;
import org.citygml4j.builder.json.marshal.citygml.appearance.AppearanceMarshaller;
import org.citygml4j.builder.json.marshal.citygml.building.BuildingMarshaller;
import org.citygml4j.builder.json.marshal.citygml.cityfurniture.CityFurnitureMarshaller;
import org.citygml4j.builder.json.marshal.citygml.core.CoreMarshaller;
import org.citygml4j.builder.json.marshal.citygml.generics.GenericsMarshaller;
import org.citygml4j.builder.json.marshal.citygml.landuse.LandUseMarshaller;
import org.citygml4j.builder.json.marshal.citygml.relief.ReliefMarshaller;
import org.citygml4j.builder.json.marshal.citygml.transportation.TransportationMarshaller;
import org.citygml4j.builder.json.marshal.citygml.vegetation.VegetationMarshaller;
import org.citygml4j.builder.json.marshal.citygml.waterbody.WaterBodyMarshaller;
import org.citygml4j.builder.json.objects.feature.AbstractCityObjectType;
import org.citygml4j.builder.json.objects.geometry.SemanticsType;
import org.citygml4j.model.citygml.building.BuildingModuleComponent;
import org.citygml4j.model.citygml.cityfurniture.CityFurnitureModuleComponent;
import org.citygml4j.model.citygml.core.AbstractCityObject;
import org.citygml4j.model.citygml.core.CoreModuleComponent;
import org.citygml4j.model.citygml.generics.GenericsModuleComponent;
import org.citygml4j.model.citygml.landuse.LandUseModuleComponent;
import org.citygml4j.model.citygml.relief.ReliefModuleComponent;
import org.citygml4j.model.citygml.transportation.TransportationModuleComponent;
import org.citygml4j.model.citygml.vegetation.VegetationModuleComponent;
import org.citygml4j.model.citygml.waterbody.WaterBodyModuleComponent;
import org.citygml4j.model.common.base.ModelObject;

public class CityGMLMarshaller {
	private final CityJSONMarshaller json;
	
	private final AppearanceMarshaller app;
	private final BuildingMarshaller bldg;
	private final CityFurnitureMarshaller frn;
	private final CoreMarshaller core;
	private final GenericsMarshaller gen;
	private final LandUseMarshaller luse;
	private final ReliefMarshaller dem;
	private final TransportationMarshaller tran;
	private final VegetationMarshaller veg;
	private final WaterBodyMarshaller wtr;
	
	public CityGMLMarshaller(CityJSONMarshaller json) {
		this.json = json;
		
		app = new AppearanceMarshaller(this);
		bldg = new BuildingMarshaller(this);
		frn = new CityFurnitureMarshaller(this);
		core = new CoreMarshaller(this);
		gen = new GenericsMarshaller(this);
		luse = new LandUseMarshaller(this);
		dem = new ReliefMarshaller(this);
		tran = new TransportationMarshaller(this);
		veg = new VegetationMarshaller(this);
		wtr = new WaterBodyMarshaller(this);
	}
	
	public List<AbstractCityObjectType> marshal(ModelObject src) {
		List<AbstractCityObjectType> dest = null;
		
		if (src instanceof BuildingModuleComponent)
			dest = bldg.marshal(src);		
		else if (src instanceof CityFurnitureModuleComponent)
			dest = frn.marshal(src);		
		else if (src instanceof GenericsModuleComponent)
			dest = gen.marshal(src);
		else if (src instanceof LandUseModuleComponent)
			dest = luse.marshal(src);
		else if (src instanceof ReliefModuleComponent)
			dest = dem.marshal(src);
		else if (src instanceof TransportationModuleComponent)
			dest = tran.marshal(src);
		else if (src instanceof VegetationModuleComponent)
			dest = veg.marshal(src);
		else if (src instanceof WaterBodyModuleComponent)
{'fraction_non_alphanumeric': 0.08368976333048189, 'fraction_numerical': 0.006986027944111776, 'mean_word_length': 6.567421790722761, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4671095', 'n_tokens_mistral': 2380, 'n_tokens_neox': 2287, 'n_words': 385}