当前位置: 首页>>代码示例>>Java>>正文


Java SAXEventBuffer类代码示例

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

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

示例1: writeFeatureCollection

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
private void writeFeatureCollection(long matchNo, boolean withMemberProperty) throws JAXBException, SAXException {
	JAXBElement<?> output = null;

	FeatureCollectionType featureCollection = new FeatureCollectionType();
	featureCollection.setTimeStamp(getTimeStamp());
	featureCollection.setNumberMatched(String.valueOf(matchNo));
	featureCollection.setNumberReturned(BigInteger.valueOf(0));

	if (withMemberProperty) {
		MemberPropertyType member = new MemberPropertyType();
		member.getContent().add(wfsFactory.createFeatureCollection(featureCollection));
		output = wfsFactory.createMember(member);
	} else
		output = wfsFactory.createFeatureCollection(featureCollection);

	SAXEventBuffer buffer = new SAXEventBuffer();
	marshaller.marshal(output, buffer);
	writerPool.addWork(buffer);
}
 
开发者ID:3dcitydb,项目名称:web-feature-service,代码行数:20,代码来源:QueryExecuter.java


示例2: FeatureMemberWriter

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public FeatureMemberWriter(SingleWorkerPool<SAXEventBuffer> writerPool, 
		UIDCacheManager lookupServerManager, 
		JAXBBuilder jaxbBuilder, 
		WFSConfig wfsConfig,
		Config exporterConfig) {
	this.writerPool = writerPool;
	this.lookupServerManager = lookupServerManager;
	this.jaxbBuilder = jaxbBuilder;
	this.exporterConfig = exporterConfig;
	
	geometryStripper = wfsConfig.getSecurity().isStripGeometry() ? new GeometryStripper() : null;			

	wfsFactory = new ObjectFactory();		
	CityGMLVersion version = Util.toCityGMLVersion(exporterConfig.getProject().getExporter().getCityGMLVersion());
	jaxbMarshaller = jaxbBuilder.createJAXBMarshaller(version);
}
 
开发者ID:3dcitydb,项目名称:web-feature-service,代码行数:17,代码来源:FeatureMemberWriter.java


示例3: KmlExportWorkerFactory

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public KmlExportWorkerFactory(
		JAXBContext jaxbKmlContext,
		JAXBContext jaxbColladaContext,
		SchemaMapping schemaMapping,
		WorkerPool<SAXEventBuffer> writerPool,
		ExportTracker tracker,
		Query query,
		ObjectFactory kmlFactory,
		Config config,
		EventDispatcher eventDispatcher) {
	this.jaxbKmlContext = jaxbKmlContext;
	this.jaxbColladaContext = jaxbColladaContext;
	this.schemaMapping = schemaMapping;
	this.writerPool = writerPool;
	this.tracker = tracker;
	this.query = query;
	this.kmlFactory = kmlFactory;
	this.config = config;
	this.eventDispatcher = eventDispatcher;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:21,代码来源:KmlExportWorkerFactory.java


示例4: run

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
@Override
public void run() {
	if (firstWork != null) {
		doWork(firstWork);
		firstWork = null;
	}

	while (shouldRun) {
		try {
			SAXEventBuffer work = workQueue.take();
			doWork(work);
		} catch (InterruptedException ie) {
			// re-check state
		}
	}
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:17,代码来源:XMLWriterWorker.java


示例5: doWork

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
private void doWork(SAXEventBuffer work) {
	final ReentrantLock runLock = this.runLock;
	runLock.lock();

	try {
		if (!shouldWork)
			return;
		
		work.send(saxWriter, true);
	} catch (SAXException e) {
		eventDispatcher.triggerSyncEvent(new InterruptEvent("Failed to write XML content.", LogLevel.ERROR, e, eventChannel, this));
		shouldWork = false;
	} finally {
		runLock.unlock();
	}
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:17,代码来源:XMLWriterWorker.java


示例6: DBExportWorkerFactory

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public DBExportWorkerFactory(
		DatabaseConnectionPool dbConnectionPool,
		JAXBBuilder jaxbBuilder,
		WorkerPool<SAXEventBuffer> ioWriterPool,
		WorkerPool<DBXlink> xlinkExporterPool,
		DBGmlIdLookupServerManager lookupServerManager,
		CacheManager cacheManager,
		ExportFilter exportFilter,
		Config config,
		EventDispatcher eventDispatcher) {
	this.dbConnectionPool = dbConnectionPool;
	this.jaxbBuilder = jaxbBuilder;
	this.ioWriterPool = ioWriterPool;
	this.xlinkExporterPool = xlinkExporterPool;
	this.lookupServerManager = lookupServerManager;
	this.cacheManager = cacheManager;
	this.exportFilter = exportFilter;
	this.config = config;
	this.eventDispatcher = eventDispatcher;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:21,代码来源:DBExportWorkerFactory.java


示例7: DBExportWorker

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public DBExportWorker(DatabaseConnectionPool dbConnectionPool,
		JAXBBuilder jaxbBuilder,
		WorkerPool<SAXEventBuffer> ioWriterPool,
		WorkerPool<DBXlink> xlinkExporterPool,
		DBGmlIdLookupServerManager lookupServerManager,
		CacheManager cacheManager,
		ExportFilter exportFilter,
		Config config,
		EventDispatcher eventDispatcher) throws SQLException, SAXException {
	this.dbConnectionPool = dbConnectionPool;
	this.jaxbBuilder = jaxbBuilder;
	this.ioWriterPool = ioWriterPool;
	this.xlinkExporterPool = xlinkExporterPool;
	this.lookupServerManager = lookupServerManager;
	this.cacheManager = cacheManager;
	this.exportFilter = exportFilter;
	this.config = config;
	this.eventDispatcher = eventDispatcher;
	init();
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:21,代码来源:DBExportWorker.java


示例8: KmlExportWorkerFactory

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public KmlExportWorkerFactory(
		JAXBContext jaxbKmlContext,
		JAXBContext jaxbColladaContext,
		DatabaseConnectionPool dbConnectionPool,
		WorkerPool<SAXEventBuffer> ioWriterPool,
		ObjectFactory kmlFactory,
		CityGMLFactory cityGMLFactory,
		Config config,
		EventDispatcher eventDispatcher) {
	this.jaxbKmlContext = jaxbKmlContext;
	this.jaxbColladaContext = jaxbColladaContext;
	this.dbConnectionPool = dbConnectionPool;
	this.ioWriterPool = ioWriterPool;
	this.kmlFactory = kmlFactory;
	this.cityGMLFactory = cityGMLFactory;
	this.config = config;
	this.eventDispatcher = eventDispatcher;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:19,代码来源:KmlExportWorkerFactory.java


示例9: run

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
@Override
public void run() {
   	if (firstWork != null && shouldRun) {
   		doWork(firstWork);
   		firstWork = null;
   	}

   	while (shouldRun) {
		try {
			SAXEventBuffer work = workQueue.take();
			doWork(work);
		} catch (InterruptedException ie) {
			// re-check state
		}
   	}
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:17,代码来源:IOWriterWorker.java


示例10: doWork

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
private void doWork(SAXEventBuffer work) {
	final ReentrantLock runLock = this.runLock;
       runLock.lock();

       try {
       	SAXEvent event = work.getFirstEvent();
       	while (event != null) {
			event.send(saxWriter);
			work.removeFirstEvent();
			event = event.next();
       	}

       	saxWriter.flush();
       } catch (SAXException e) {
       	LOG.error("XML error: " + e.getMessage());
       } finally {
       	runLock.unlock();
       }
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:20,代码来源:IOWriterWorker.java


示例11: QueryExecuter

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public QueryExecuter(GetFeatureType wfsRequest,
		List<QueryExpression> queryExpressions, 
		FeatureMemberWriterFactory writerFactory,
		WorkerPool<DBSplittingResult> databaseWorkerPool,
		SingleWorkerPool<SAXEventBuffer> writerPool,
		DatabaseConnectionPool connectionPool,
		JAXBBuilder jaxbBuilder,
		ExportFilter exportFilter,
		WFSConfig wfsConfig,
		Config exporterConfig) throws JAXBException, DatatypeConfigurationException {
	this.queryExpressions = queryExpressions;
	this.writerFactory = writerFactory;
	this.databaseWorkerPool = databaseWorkerPool;
	this.writerPool = writerPool;
	this.connectionPool = connectionPool;
	this.exportFilter = exportFilter;
	this.exporterConfig = exporterConfig;

	// get standard request parameters
	long maxFeatureCount = wfsConfig.getSecurity().getMaxFeatureCount();
	count = wfsRequest.isSetCount() && wfsRequest.getCount().longValue() < maxFeatureCount ? wfsRequest.getCount().longValue() : maxFeatureCount;		
	resultType = wfsRequest.getResultType();

	queryBuilder = new QueryBuilder();
	marshaller = jaxbBuilder.getJAXBContext().createMarshaller();
	datatypeFactory = DatatypeFactory.newInstance();
	wfsFactory = new ObjectFactory();		
}
 
开发者ID:3dcitydb,项目名称:web-feature-service,代码行数:29,代码来源:QueryExecuter.java


示例12: FeatureMemberWriterFactory

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public FeatureMemberWriterFactory(SingleWorkerPool<SAXEventBuffer> writerPool, 
		UIDCacheManager lookupServerManager, 
		JAXBBuilder jaxbBuilder, 
		WFSConfig wfsConfig,
		Config exporterConfig) {
	this.writerPool = writerPool;
	this.lookupServerManager = lookupServerManager;
	this.jaxbBuilder = jaxbBuilder;
	this.wfsConfig = wfsConfig;
	this.exporterConfig = exporterConfig;
	
	writers = new WeakHashMap<FeatureMemberWriter, Void>();
}
 
开发者ID:3dcitydb,项目名称:web-feature-service,代码行数:14,代码来源:FeatureMemberWriterFactory.java


示例13: KmlExporterManager

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public KmlExporterManager(JAXBContext jaxbKmlContext,
		JAXBContext jaxbColladaContext,
		AbstractDatabaseAdapter databaseAdapter,
		WorkerPool<SAXEventBuffer> writerPool,
		ExportTracker tracker,
		Query query,
		ObjectFactory kmlFactory,
		BlobExportAdapter textureExportAdapter,
		EventDispatcher eventDispatcher,
		Config config) {
	this.jaxbKmlContext = jaxbKmlContext;
	this.jaxbColladaContext = jaxbColladaContext;
	this.databaseAdapter = databaseAdapter;
	this.writerPool = writerPool;
	this.tracker = tracker;
	this.kmlFactory = kmlFactory;
	this.textureExportAdapter = textureExportAdapter;
	this.eventDispatcher = eventDispatcher;
	this.config = config;

	useTiling = query.isSetTiling();
	mainFilename = config.getInternal().getExportFileName().trim();
	if (mainFilename.lastIndexOf(File.separator) != -1) {
		if (mainFilename.lastIndexOf(".") == -1) {
			mainFilename = mainFilename.substring(mainFilename.lastIndexOf(File.separator) + 1);
		}
		else {
			mainFilename = mainFilename.substring(mainFilename.lastIndexOf(File.separator) + 1, mainFilename.lastIndexOf("."));
		}
	}
	else {
		if (mainFilename.lastIndexOf(".") != -1) {
			mainFilename = mainFilename.substring(0, mainFilename.lastIndexOf("."));
		}
	}
	mainFilename = mainFilename + ".kml";

	objectCounter = new HashMap<>();
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:40,代码来源:KmlExporterManager.java


示例14: CityGMLWriter

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public CityGMLWriter(SAXWriter saxWriter, CityGMLVersion version) {
	this.saxWriter = saxWriter;
	this.version = version;
	
	cityGMLBuilder = ObjectRegistry.getInstance().getCityGMLBuilder();
	jaxbMarshaller = cityGMLBuilder.createJAXBMarshaller(version);

	writerPool = new SingleWorkerPool<SAXEventBuffer>(
			"citygml_writer_pool",
			new XMLWriterWorkerFactory(saxWriter, ObjectRegistry.getInstance().getEventDispatcher()),
			100,
			false);

	writerPool.prestartCoreWorkers();
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:16,代码来源:CityGMLWriter.java


示例15: XMLChunkImpl

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
XMLChunkImpl(AbstractJAXBReader chunkReader, XMLChunkImpl parentChunk) {
	this.jaxbReader = chunkReader;
	this.parentChunk = parentChunk;

	buffer = new SAXEventBuffer();
	stax2sax = new StAXStream2SAX(buffer);
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:8,代码来源:XMLChunkImpl.java


示例16: DBExporterManager

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public DBExporterManager(Connection connection,
		JAXBBuilder jaxbBuilder,
		WorkerPool<SAXEventBuffer> ioWriterPool,
		WorkerPool<DBXlink> xlinkExporterPool,
		DBGmlIdLookupServerManager lookupServerManager,
		CacheManager cacheManager,
		ExportFilter exportFilter,
		Config config,
		EventDispatcher eventDispatcher) throws SAXException {
	this.connection = connection;
	this.jaxbBuilder = jaxbBuilder;
	this.ioWriterPool = ioWriterPool;
	this.xlinkExporterPool = xlinkExporterPool;
	this.lookupServerManager = lookupServerManager;
	this.cacheManager = cacheManager;
	this.exportFilter = exportFilter;
	this.config = config;
	this.eventDispatcher = eventDispatcher;

	dbExporterMap = new EnumMap<DBExporterEnum, DBExporter>(DBExporterEnum.class);
	featureCounterMap = new HashMap<CityGMLClass, Long>();
	geometryCounterMap = new HashMap<GMLClass, Long>();

	CityGMLVersion version = config.getProject().getExporter().getCityGMLVersion().toCityGMLVersion();
	jaxbMarshaller = jaxbBuilder.createJAXBMarshaller(version);
	jaxbUnmarshaller = jaxbBuilder.createJAXBUnmarshaller();
	jaxbUnmarshaller.setThrowMissingADESchema(false);
	jaxbUnmarshaller.setParseSchema(false);
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:30,代码来源:DBExporterManager.java


示例17: print

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public void print(AbstractFeature abstractFeature) throws CityGMLWriteException {
	FeatureProperty<? extends AbstractFeature> member = null;

	// wrap feature with a feature property element
	if (abstractFeature instanceof AbstractCityObject) {
		member = new CityObjectMemberImpl();
		((CityObjectMember)member).setCityObject((AbstractCityObject)abstractFeature);
	} 

	else if (abstractFeature instanceof Appearance) {
		member = new AppearanceMemberImpl();
		((AppearanceMember)member).setAppearance((Appearance)abstractFeature);
	} 

	else {
		member = new FeatureMemberImpl();
		((FeatureMember)member).setFeature(abstractFeature);
	}

	if (member != null) {
		try {
			SAXEventBuffer buffer = new SAXEventBuffer();
			Marshaller marshaller = jaxbBuilder.getJAXBContext().createMarshaller();
			marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);

			JAXBElement<?> jaxbElement = jaxbMarshaller.marshalJAXBElement(member);
			if (jaxbElement != null)
				marshaller.marshal(jaxbElement, buffer);

			if (!buffer.isEmpty())
				ioWriterPool.addWork(buffer);
		} catch (JAXBException e) {
			throw new CityGMLWriteException("Caused by: ", e);
		}
	}		
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:37,代码来源:DBExporterManager.java


示例18: KmlExporterManager

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public KmlExporterManager(JAXBContext jaxbKmlContext,
						  JAXBContext jaxbColladaContext,
						  WorkerPool<SAXEventBuffer> ioWriterPool,
						  ObjectFactory kmlFactory,
						  Config config) {
	this.jaxbKmlContext = jaxbKmlContext;
	this.jaxbColladaContext = jaxbColladaContext;
	this.ioWriterPool = ioWriterPool;
	this.kmlFactory = kmlFactory;
	this.config = config;

	isBBoxActive = config.getProject().getKmlExporter().getFilter().getComplexFilter().getTiledBoundingBox().getActive().booleanValue();
	mainFilename = config.getInternal().getExportFileName().trim();
	if (mainFilename.lastIndexOf(File.separator) != -1) {
		if (mainFilename.lastIndexOf(".") == -1) {
			mainFilename = mainFilename.substring(mainFilename.lastIndexOf(File.separator) + 1);
		}
		else {
			mainFilename = mainFilename.substring(mainFilename.lastIndexOf(File.separator) + 1, mainFilename.lastIndexOf("."));
		}
	}
	else {
		if (mainFilename.lastIndexOf(".") != -1) {
			mainFilename = mainFilename.substring(0, mainFilename.lastIndexOf("."));
		}
	}
	mainFilename = mainFilename + ".kml";
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:29,代码来源:KmlExporterManager.java


示例19: setRootElement

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
public void setRootElement(JAXBElement<?> jaxbRootElement,
	JAXBContext jaxbContext,
	Properties marshallerProps) throws JAXBException {
saxBuffer = new SAXEventBuffer();

Marshaller marshaller = jaxbContext.createMarshaller();
for (Object key : marshallerProps.keySet())
	marshaller.setProperty(key.toString(), marshallerProps.get(key));

marshaller.marshal(jaxbRootElement, saxBuffer);	}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:11,代码来源:KMLHeaderWriter.java


示例20: process

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
@Override
public void process(AbstractFeature abstractFeature) throws FeatureProcessException {

	// security feature: strip geometry from features
	if (geometryStripper != null) {
		abstractFeature.accept(geometryStripper);
		geometryStripper.reset();
	}

	JAXBElement<?> output = null;
	
	if (writeMemberProperty) {
		MemberPropertyType memberProperty = new MemberPropertyType();

		if (!exporterConfig.getInternal().isRegisterGmlIdInCache() || !isFeatureAlreadyExported(abstractFeature)) {
			// TODO: CityGML 1.0 Appearance elements are not global and hence must be wrapped by an AppearanceProperty 
			memberProperty.getContent().add(jaxbMarshaller.marshalJAXBElement(abstractFeature));
		} else
			memberProperty.setHref("#" + abstractFeature.getId());
		
		output = wfsFactory.createMember(memberProperty);
	} else {
		output = jaxbMarshaller.marshalJAXBElement(abstractFeature);
	}
	
	try {
		SAXEventBuffer buffer = new SAXEventBuffer();
		Marshaller marshaller = jaxbBuilder.getJAXBContext().createMarshaller();
		marshaller.setProperty(Marshaller.JAXB_FRAGMENT, writeMemberProperty);				

		if (output != null)
			marshaller.marshal(output, buffer);
		else
			throw new FeatureProcessException("Failed to write feature with gml:id '" + abstractFeature.getId() + "'.");

		if (!buffer.isEmpty())
			writerPool.addWork(buffer);
		else
			throw new FeatureProcessException("Failed to write feature with gml:id '" + abstractFeature.getId() + "'.");
	} catch (JAXBException e) {
		throw new FeatureProcessException("Failed to write feature with gml:id '" + abstractFeature.getId() + "': " + e.getMessage());
	}
}
 
开发者ID:3dcitydb,项目名称:web-feature-service,代码行数:44,代码来源:FeatureMemberWriter.java


示例21: createWorker

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
@Override
public Worker<SAXEventBuffer> createWorker() {
	return new XMLWriterWorker(saxWriter, eventDispatcher);
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:5,代码来源:XMLWriterWorkerFactory.java


示例22: setFirstWork

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
@Override
public void setFirstWork(SAXEventBuffer firstWork) {
	this.firstWork = firstWork;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:5,代码来源:IOWriterWorker.java


示例23: setWorkQueue

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
@Override
public void setWorkQueue(WorkQueue<SAXEventBuffer> workQueue) {
	this.workQueue = workQueue;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:5,代码来源:IOWriterWorker.java


示例24: createWorker

import org.citygml4j.util.xml.SAXEventBuffer; //导入依赖的package包/类
@Override
public Worker<SAXEventBuffer> createWorker() {
	return new IOWriterWorker(saxWriter);
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:5,代码来源:IOWriterWorkerFactory.java



注:本文中的org.citygml4j.util.xml.SAXEventBuffer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。