javax.xml.bind.Unmarshaller.Listener源码实例Demo

类javax.xml.bind.Unmarshaller.Listener源码实例Demo

下面列出了javax.xml.bind.Unmarshaller.Listener 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: recheck   文件: XmlPersistenceUtil.java
static <T extends Persistable> ReTestXmlDataContainer<T> migrateAndRead( final XmlTransformer xml,
		final NamedBufferedInputStream inputStream, final Listener unmarshallListener ) throws IOException {
	NamedBufferedInputStream bin = inputStream;

	final XmlVersionCheckResult checkResult = XmlVersionCheckResult.create( bin );

	if ( checkResult.newDataTypeInstance == null ) {
		throw new RuntimeException( "Unexpected data type " + checkResult.oldDataType );
	}

	if ( !checkResult.isCompatible() ) {
		bin = XmlMigrator.tryToMigrate( checkResult, bin );
		if ( bin == null ) {
			throw new RuntimeException( "Could not migrate XML." );
		}
	}

	return xml.fromXML( bin, unmarshallListener );
}
 
源代码2 项目: vethrfolnir-mu   文件: Tools.java
public static synchronized void afterUnmarshal(ArrayList<?> list) {
	for (Object object : list) {
		if(object instanceof Listener)
			((Listener) object).afterUnmarshal(null, null);
	}
}
 
源代码3 项目: vethrfolnir-mu   文件: Tools.java
public static synchronized void afterUnmarshal(Object object) {
	if(object instanceof Listener)
		((Listener) object).afterUnmarshal(null, null);
}