• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ModuleContext类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.citygml4j.model.module.ModuleContext的典型用法代码示例。如果您正苦于以下问题:Java ModuleContext类的具体用法?Java ModuleContext怎么用?Java ModuleContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ModuleContext类属于org.citygml4j.model.module包,在下文中一共展示了ModuleContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: JAXBModelWriter

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public JAXBModelWriter(SAXWriter writer, 
		JAXBOutputFactory factory, 
		ModuleContext moduleContext) throws CityGMLWriteException {
	super(writer, factory, moduleContext);

	initModuleCtx = new ModuleContext(moduleContext);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:8,
代码来源:JAXBModelWriter.java

示例2: JAXBOutputFactory

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public JAXBOutputFactory(CityGMLBuilder builder, ModuleContext moduleContext, SchemaHandler schemaHandler) {
	this.builder = builder;
	this.schemaHandler = schemaHandler;
	this.moduleContext = moduleContext;

	gmlIdManager = DefaultGMLIdManager.getInstance();
	featureWriteMode = FeatureWriteMode.NO_SPLIT;
	excludes = new HashSet<>();
	keepInlineAppearance = true;
	splitCopy = true;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:12,
代码来源:JAXBOutputFactory.java

示例3: createCityGMLWriter

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public CityGMLWriter createCityGMLWriter(File file, ModuleContext moduleContext) throws CityGMLWriteException {
	try {
		createParentDirectories(file.toPath());
		return new JAXBSimpleWriter(
				new SAXWriter(new OutputStreamWriter(new FileOutputStream(file))), 
				this, 
				moduleContext);
	} catch (IOException e) {
		throw new CityGMLWriteException("Caused by: ", e);
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:12,
代码来源:JAXBOutputFactory.java

示例4: createCityModelWriter

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public CityModelWriter createCityModelWriter(File file, ModuleContext moduleContext) throws CityGMLWriteException {
	try {
		createParentDirectories(file.toPath());
		return new JAXBModelWriter(
				new SAXWriter(new OutputStreamWriter(new FileOutputStream(file))), 
				this, 
				moduleContext);
	} catch (IOException e) {
		throw new CityGMLWriteException("Caused by: ", e);
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:12,
代码来源:JAXBOutputFactory.java

示例5: AbstractJAXBWriter

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public AbstractJAXBWriter(SAXWriter writer, JAXBOutputFactory factory, ModuleContext moduleContext) throws CityGMLWriteException {
	this.writer = writer;

	jaxbMarshaller = factory.builder.createJAXBMarshaller(new ModuleContext(moduleContext));
	jaxbContext = factory.builder.getJAXBContext();
	schemaHandler = factory.getSchemaHandler();
	transformerChainFactory = factory.getTransformerChainFactory();

	featureWriteMode = (FeatureWriteMode)factory.getProperty(CityGMLOutputFactory.FEATURE_WRITE_MODE);
	useValidation = (Boolean)factory.getProperty(CityGMLOutputFactory.USE_VALIDATION);

	if (featureWriteMode == FeatureWriteMode.SPLIT_PER_COLLECTION_MEMBER) {
		featureSplitter = new FeatureSplitter()
				.setSchemaHandler(schemaHandler)
				.setGMLIdManager(factory.getGMLIdManager())
				.setSplitMode(FeatureSplitMode.SPLIT_PER_COLLECTION_MEMBER)
				.keepInlineAppearance((Boolean)factory.getProperty(CityGMLOutputFactory.KEEP_INLINE_APPEARANCE))
				.splitCopy((Boolean)factory.getProperty(CityGMLOutputFactory.SPLIT_COPY))
				.exclude((Set<Class<? extends CityGML>>)factory.getProperty(CityGMLOutputFactory.EXCLUDE_FROM_SPLITTING));
	}

	if (useValidation) {
		if (schemaHandler == null) {
			try {
				schemaHandler = factory.builder.getDefaultSchemaHandler();
			} catch (CityGMLBuilderException e) {
				throw new CityGMLWriteException("Caused by: ", e);
			}
		}

		validationSchemaHandler = new ValidationSchemaHandler(schemaHandler);
		validationEventHandler = factory.getValidationEventHandler();
	}		
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:36,
代码来源:AbstractJAXBWriter.java

示例6: setSchemaLocations

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public void setSchemaLocations(ModuleContext moduleContext) {
	for (CityGMLModule module : moduleContext.getCityGMLModules()) {
		if (module instanceof CoreModule)
			continue;

		setSchemaLocation(module);
	}

	for (ADEModule adeModule : moduleContext.getADEModules())
		setSchemaLocation(adeModule);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:12,
代码来源:AbstractJAXBWriter.java

示例7: JAXBMarshaller

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public JAXBMarshaller(CityGMLBuilder builder, ModuleContext moduleContext) {
	this.builder = builder;
	this.moduleContext = moduleContext;

	citygml = new CityGMLMarshaller(this);
	gml = new GMLMarshaller(this);
	xal = new XALMarshaller();
	ade = new ADEMarshaller(this);
	
	try {
		dataTypeFactory = DatatypeFactory.newInstance();
	} catch (DatatypeConfigurationException e) {
		throw new RuntimeException("Failed to create DatatypeFactory.", e);
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:16,
代码来源:JAXBMarshaller.java

示例8: setContext

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
private static void setContext(AbstractCityGMLWriter writer, 
		ModuleContext moduleContext, 
		FeatureWriteMode writeMode,
		boolean splitOnCopy) {
	writer.setPrefixes(moduleContext);
	writer.setPrefix("noise", "http://www.citygml.org/ade/noise_de/2.0");
	writer.setDefaultNamespace(moduleContext.getModule(CityGMLModuleType.CORE));
	writer.setSchemaLocation("http://www.citygml.org/ade/noise_de/2.0", "../datasets/schemas/CityGML-NoiseADE-2_0_0.xsd");
	writer.setIndentString("  ");
	writer.setHeaderComment("written by citygml4j", 
			"using a CityGMLWriter instance", 
			"Split mode: " + writeMode, 
			"Split on copy: " + splitOnCopy);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:15,
代码来源:WritingCityGML.java

示例9: setPrefixes

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public void setPrefixes(ModuleContext moduleContext) {
	for (Module module : moduleContext.getModules())
		setPrefix(module);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:5,
代码来源:CityGMLNamespaceContext.java

示例10: createJAXBMarshaller

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public JAXBMarshaller createJAXBMarshaller(ModuleContext moduleContext) {
	return new JAXBMarshaller(this, moduleContext);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:CityGMLBuilder.java

示例11: createCityGMLOutputFactory

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public CityGMLOutputFactory createCityGMLOutputFactory(ModuleContext moduleContext) {
	return new JAXBOutputFactory(this, moduleContext);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:CityGMLBuilder.java

示例12: validate

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public void validate(Object object, CityGMLVersion version) throws CityGMLValidateException {
	validate(object, new ModuleContext(version));
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:JAXBValidator.java

示例13: writeEndDocument

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public void writeEndDocument() throws CityGMLWriteException {
	switch (documentState) {
	case END_DOCUMENT:
		throw new IllegalStateException("CityModel end element can only be written once.");
	case INITIAL:
		writeStartDocument();
	case START_DOCUMENT:
		break;
	default:
		throw new IllegalStateException("Unknown document state '" + documentState + "'");
	}

	try {
		CityModel cityModel = new CityModel();

		if (cityModelInfo != null) {
			if (cityModelInfo.isSetGenericApplicationPropertyOfCityModel())
				cityModel.setGenericApplicationPropertyOfCityModel(
						cityModelInfo.getGenericApplicationPropertyOfCityModel());

			if (cityModelInfo.isSetGenericADEElement())
				cityModel.setGenericADEElement(
						cityModelInfo.getGenericADEElement());
		}		

		ModuleContext tmp = jaxbMarshaller.getModuleContext();
		jaxbMarshaller.setModuleContext(initModuleCtx);

		JAXBElement<?> jaxbElement = jaxbMarshaller.marshalJAXBElement(cityModel);
		if (jaxbElement != null) {
			SAXFragmentWriter fragmentWriter = new SAXFragmentWriter(
					new QName(jaxbMarshaller.getModuleContext().getModule(CityGMLModuleType.CORE).getNamespaceURI(), "CityModel"), writer, WriteMode.TAIL);
			createMarshaller(true).marshal(jaxbElement, fragmentWriter);
		}

		jaxbMarshaller.setModuleContext(tmp);
		documentState = DocumentState.END_DOCUMENT;

	} catch (JAXBException e) {
		throw new CityGMLWriteException("Caused by: ", e);
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:43,
代码来源:JAXBModelWriter.java

示例14: getModuleContext

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public ModuleContext getModuleContext() {
	return moduleContext;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:JAXBOutputFactory.java

示例15: setModuleContext

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public void setModuleContext(ModuleContext moduleContext) {
	if (moduleContext == null)
		throw new IllegalArgumentException("module context may not be null.");

	this.moduleContext = moduleContext;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:7,
代码来源:JAXBOutputFactory.java

示例16: setCityGMLVersion

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public void setCityGMLVersion(CityGMLVersion version) {
	if (version == null)
		throw new IllegalArgumentException("CityGML version may not be null.");

	moduleContext = new ModuleContext(version);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:7,
代码来源:JAXBOutputFactory.java

示例17: JAXBSimpleWriter

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public JAXBSimpleWriter(SAXWriter writer, JAXBOutputFactory factory, ModuleContext moduleContext) throws CityGMLWriteException {
	super(writer, factory, moduleContext);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:JAXBSimpleWriter.java

示例18: getModuleContext

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public ModuleContext getModuleContext() {
	return jaxbMarshaller.getModuleContext();
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:AbstractJAXBWriter.java

示例19: setModuleContext

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
public void setModuleContext(ModuleContext moduleContext) {
	jaxbMarshaller.setModuleContext(moduleContext);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:AbstractJAXBWriter.java

示例20: getCityGMLModule

点赞 2

import org.citygml4j.model.module.ModuleContext; //导入依赖的package包/类
private CityGMLModule getCityGMLModule(Object src) {

		if (src instanceof ModelObject) {
			ModuleContext moduleContext = jaxb.getModuleContext();

			if (src instanceof AppearanceModuleComponent)
				return (AppearanceModule)moduleContext.getModule(CityGMLModuleType.APPEARANCE);
			else if (src instanceof BridgeModuleComponent)
				return (BridgeModule)moduleContext.getModule(CityGMLModuleType.BRIDGE);
			else if (src instanceof BuildingModuleComponent)
				return (BuildingModule)moduleContext.getModule(CityGMLModuleType.BUILDING);
			else if (src instanceof CityFurnitureModuleComponent)
				return (CityFurnitureModule)moduleContext.getModule(CityGMLModuleType.CITY_FURNITURE);
			else if (src instanceof CityObjectGroupModuleComponent)
				return (CityObjectGroupModule)moduleContext.getModule(CityGMLModuleType.CITY_OBJECT_GROUP);
			else if (src instanceof GenericsModuleComponent)
				return (GenericsModule)moduleContext.getModule(CityGMLModuleType.GENERICS);
			else if (src instanceof LandUseModuleComponent)
				return (LandUseModule)moduleContext.getModule(CityGMLModuleType.LAND_USE);
			else if (src instanceof ReliefModuleComponent)
				return (ReliefModule)moduleContext.getModule(CityGMLModuleType.RELIEF);
			else if (src instanceof TexturedSurfaceModuleComponent)
				return (TexturedSurfaceModule)moduleContext.getModule(CityGMLModuleType.TEXTURED_SURFACE);
			else if (src instanceof TransportationModuleComponent)
				return (TransportationModule)moduleContext.getModule(CityGMLModuleType.TRANSPORTATION);
			else if (src instanceof TunnelModuleComponent)
				return (TunnelModule)moduleContext.getModule(CityGMLModuleType.TUNNEL);
			else if (src instanceof VegetationModuleComponent)
				return (VegetationModule)moduleContext.getModule(CityGMLModuleType.VEGETATION);
			else if (src instanceof WaterBodyModuleComponent)
				return (WaterBodyModule)moduleContext.getModule(CityGMLModuleType.WATER_BODY);
			else
				return (CoreModule)moduleContext.getModule(CityGMLModuleType.CORE);		
		}

		else if (src != null) {
			moduleMatcher.reset(src.getClass().getPackage().getName());

			if (moduleMatcher.matches()) {
				String moduleString = moduleMatcher.group(1);
				if (moduleString == null)
					moduleString = "core";

				CityGMLModuleVersion version = moduleMatcher.group(2).equals("_2") ? CityGMLModuleVersion.v2_0_0 : CityGMLModuleVersion.v1_0_0;
				for (CityGMLModule module : Modules.getCityGMLModules()) {
					if (module.getVersion() == version && module.getType().toString().toLowerCase().equals(moduleString))
						return module;
				}	
			}		
		}

		return null;
	}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:54,
代码来源:CityGMLMarshaller.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)