protected void setXmlWriter(XMLWriter writer) { this.setWriteAllPropertiesAsAttributes(false); this.writer = writer; }
protected void setPath(String path) { if ( path == null ) { throw new IllegalArgumentException("path must be set"); } this.setWriteAllPropertiesAsAttributes(false); writer = new XMLWriter(path); mtAttribute = new Hashtable<String, String>(); mtAttribute.put(CREATIONID, Util.MTFLAG); altAttribute = new Hashtable<String, String>(); altAttribute.put(CREATIONID, FROMALTERNATE); }
private void processStartDocument (Event event) { StartDocument sd = (StartDocument)event.getResource(); // Create the output if ( outputStream == null ) { if (writer == null) { writer = new TMXWriter(outputPath); } else { writer.setPath(outputPath); } } else if ( outputStream != null ) { if (writer == null) { writer = new TMXWriter(new XMLWriter( new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))); } else { writer.setXmlWriter(new XMLWriter( new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))); } } writer.setWriteAllPropertiesAsAttributes(params.isWriteAllPropertiesAsAttributes()); writer.setExpandDuplicateProps(params.isEnableDuplicateProps()); writer.setPropValueSep(params.getPropValueSep()); writer.setGenerateUUID(params.isGenerateUUID()); writer.setNormalizeCodeIds(params.isNormalizeInlineIDs()); writer.writeStartDocument(sd, sd.getLocale(), locale, null, null, segType, "unknown", "text"); }