Revision 1681 tmp/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/AnnotationInjection.groovy

AnnotationInjection.groovy (revision 1681)
1

  
2

  
1 3
// Copyright © 2010-2013 ENS de Lyon.
2 4
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3 5
// Lyon 2, University of Franche-Comté, University of Nice
......
32 34
import org.txm.importer.StaxIdentityParser
33 35
import org.txm.importer.filters.*
34 36
import org.txm.importer.PersonalNamespaceContext
35
// TODO: Auto-generated Javadoc
37
import java.io.File
38
import java.io.IOException
39

  
40
import javax.xml.stream.XMLStreamException
41

  
36 42
/**
37 43
 * The Class AnnotationInjection.
38 44
 *
......
213 219
			}
214 220
		}
215 221
	}
222
	
223
	public boolean process(File outfile) throws XMLStreamException, IOException
224
	{
225
		boolean ret = super.process(outfile);
226
		releaseLinkParsers();
227
	}
228
	
229
	/**
230
	 * Release the link parsers.
231
	 */
232
	private void releaseLinkParsers() {
233
		if (linkparsers == null) return;
234
		
235
		for (String l : linkparsers.keySet()) {
236
			XMLStreamReader p = linkparsers.get(l);
237
			if (p != null) {
238
				try {
239
					p.close();
240
				} catch(Exception e) {
241
					println "** Can not close $l link parser $p: $e"
242
				}
243
			}
244
		}
245
	}
216 246

  
217 247
	/**
218 248
	 * get the next tei:link value of a tei:LinkGrp.

Also available in: Unified diff