@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); typeSystemWritten = false; }
protected NamedOutputStream getOutputStream(JCas aJCas, String aExtension) throws IOException { if (targetLocation == null) { return new NamedOutputStream(null, new CloseShieldOutputStream(System.out)); } else if (singularTarget) { return getOutputStream((String) null, aExtension); } else { return getOutputStream(getRelativePath(aJCas), aExtension); } }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { super.collectionProcessComplete(); try { writer.close(); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } getLogger().info("Output written to " + getTargetLocation()); } }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { if (getTargetLocation() == null) { getLogger().info("Output written to file <stdout>"); } else { getLogger().info("Output written to file " + getTargetLocation()); } super.collectionProcessComplete(); } }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); typeSystemWritten = false; }
protected NamedOutputStream getOutputStream(JCas aJCas, String aExtension) throws IOException { if (targetLocation == null) { return new NamedOutputStream(null, new CloseShieldOutputStream(System.out)); } else if (singularTarget) { return getOutputStream((String) null, aExtension); } else { return getOutputStream(getRelativePath(aJCas), aExtension); } }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); typeSystemWritten = false; }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); typeSystemWritten = false; }
@Override public void initialize(final UimaContext context) throws ResourceInitializationException { super.initialize(context); clazz = TypeParameterUtil.getClass(type); }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); // #670 - TcfWriter can currently not properly write to ZIP files because of the "try and // error" approach that we take to trying to merge with an existing file. In particular, if // the attempt fails and we go without merging, we cannot delete the broken entry from the // ZIP file. if (StringUtils.startsWith(getTargetLocation(), JAR_PREFIX)) { throw new ResourceInitializationException(new IllegalStateException( "TcfWriter cannot write to ZIP files.")); } }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); File targetLocation = new File(getTargetLocation()); targetLocation.getParentFile().mkdirs(); try { writer = new BufferedWriter(new FileWriter(targetLocation)); } catch (IOException e) { throw new ResourceInitializationException(e); } getLogger().info("Writing output to " + targetLocation); }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); if (xslt != null) { TransformerFactory tf = TransformerFactory.newInstance(); try { URL url = ResourceUtils.resolveLocation(xslt, this, getContext()); transformer = tf.newTransformer(new StreamSource(url.openStream())); } catch (Exception e) { throw new ResourceInitializationException(e); } } cas2xml = new CasToInlineXml(); }
@Override public void initialize(final UimaContext context) throws ResourceInitializationException { super.initialize(context); csvVariant = CSVVariant.valueOf(csvVariantName); csvFormat = CSVFormat.valueOf(csvFormatName); }
@Override public void initialize(final UimaContext context) throws ResourceInitializationException { super.initialize(context); attributeMap = new HashMap<String, Integer>(); attributes = new LinkedList<String>();
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); typeSystemWritten = false; jcs = new JsonCasSerializer(); jcs.setPrettyPrint(prettyPrint); jcs.setOmit0Values(omitDefaultValues); jcs.setJsonContext(JsonContextFormat.valueOf(jsonContextFormat)); }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); typeSystemWritten = false; jcs = new JsonCasSerializer(); jcs.setPrettyPrint(prettyPrint); jcs.setOmit0Values(omitDefaultValues); jcs.setJsonContext(JsonContextFormat.valueOf(jsonContextFormat)); }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); typeSystemWritten = false; jcs = new JsonCasSerializer(); jcs.setPrettyPrint(prettyPrint); jcs.setOmit0Values(omitDefaultValues); jcs.setJsonContext(JsonContextFormat.valueOf(jsonContextFormat)); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); try { sequenceGenerator = new PhraseSequenceGenerator.Builder() .featurePath(featurePath) .filterRegex(numberRegex) .filterRegexReplacement(NUMBER_REPLACEMENT) .stopwordsFile(stopwordsFile) .stopwordsReplacement(STOPWORD_REPLACEMENT) .coveringType(coveringType) .buildStringSequenceGenerator(); } catch (IOException e) { throw new ResourceInitializationException(e); } }
throws ResourceInitializationException super.initialize(context); if (getTargetLocation() == null) { throw new ResourceInitializationException(