diff options
Diffstat (limited to 'l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java')
-rwxr-xr-x | l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java index ad846ae88295..ff6c20dd99e3 100755 --- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,11 +52,11 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; /** - * + * * This class handles the creating of the source to read from, * the target to write to and the appropriate DataHandler - * - * @author Christian Schmidt 2005 + * + * @author Christian Schmidt 2005 */ public final class Converter { @@ -66,7 +66,7 @@ public final class Converter { private final static String CHARSET = new String("UTF-8"); private static final String EMPTY = new String(""); - + /** * The DataHandler use to connect reader and writer */ @@ -76,13 +76,13 @@ public final class Converter { * Counting the lines written by a writer */ private static int lineCounter; - + /** * The target to write to */ private static DataWriter theTargetWriter; - - + + /** * Overwrite existing files */ @@ -106,7 +106,7 @@ public final class Converter { /** * the Type of the Target file(SDF,GSI,XLIFF) */ - private String targetType; + private String targetType; /** * The writer that handles the output */ @@ -116,7 +116,7 @@ public final class Converter { * The sourceLanguage */ String sourceLanguage = "en-US"; - + /** * The targetLanguage */ @@ -145,7 +145,7 @@ public final class Converter { /** * Creates a new instance of Converter - * + * * @param sourceType the type of the sourceFile * @param sourceString the name of the sourceFile * @param SourceLanguage the ISO Id of the sourceLanguage @@ -197,7 +197,7 @@ public final class Converter { /** * Do the converting from the source file format to the target file format - * + * * @throws IOException */ public final void convert() throws IOException { @@ -214,12 +214,12 @@ public final class Converter { } } - + /** - * + * * Encapsulate the reading from an GSI file - * + * * @author Christian Schmidt 2005 * */ @@ -227,7 +227,7 @@ public final class Converter { DataReader theSourceReader; /** * Create a new Instance of GSISource - * + * * @throws IOException * @throws Exception */ @@ -238,7 +238,7 @@ public final class Converter { } public void convertTo(Target t) { - + try { theTargetWriter = t.getWriter(); while (handler.fillDataFrom(theSourceReader)) { @@ -257,19 +257,19 @@ public final class Converter { } /** - * + * * Encapsulate to write to a GSI file - * + * * @author Christian Schmidt 2005 * */ private class GSITarget implements Target { File target; - + /** * Create a new Instance of GSITarget - * + * * @throws FileNotFoundException * @throws IOException */ @@ -281,17 +281,17 @@ public final class Converter { } public DataWriter getWriter() { - + return theTargetWriter; } } /** - * + * * Encapsulate the reading from an SDF file - * + * * @author Christian Schmidt 2005 - * + * */ private final class SDFSource implements Source { @@ -337,7 +337,7 @@ public final class Converter { /** * Create a new Instance of SDFTarget - * + * * @throws IOException */ public SDFTarget() throws IOException { @@ -358,16 +358,16 @@ public final class Converter { /** * The interface for all convertable sources - * + * * @author Christian Schmidt 2005 * */ private interface Source { - + DataReader Source=null; /** * Convert this. to the designated target - * @param target the target of the converting + * @param target the target of the converting * @throws IOException */ abstract void convertTo(Target target) throws IOException; @@ -375,7 +375,7 @@ public final class Converter { /** * The interface for all creatable targets - * + * * @author Christian Schmidt 2005 * */ @@ -388,8 +388,8 @@ public final class Converter { /** * Get the writer * this target uses to write the - * data in the correct format. - * + * data in the correct format. + * * @return the used DataWriter */ abstract DataWriter getWriter(); @@ -406,8 +406,8 @@ public final class Converter { /** * Create a new Instance of XLIFFSource - * - * + * + * */ public XLIFFSource() { @@ -434,8 +434,8 @@ public final class Converter { SAXParser parser=factory.newSAXParser(); XMLReader xliffreader=parser.getXMLReader(); - - + + // XMLReader xliffreader = XMLReaderFactory // .createXMLReader("org.apache.crimson.parser.XMLReaderImpl"); xliffreader.setErrorHandler(contentHandler); @@ -445,7 +445,7 @@ public final class Converter { xliffreader.setEntityResolver(res); /* * a second possibility to resolve an extern entity (DTD) - * + * * xliffreader.setFeature("xml.org/sax/features/validation",true); * xliffreader.setEntityResolver(new EntityResolver() { * public InputSource resolveEntity(java.lang.String @@ -455,7 +455,7 @@ public final class Converter { * return new InputSource(new ByteArrayInputStream( " <?xml * version='1.0' encoding='UTF-8'?>" .getBytes())); else * return null; } }); - * + * */ xliffreader.parse(sourceString); @@ -490,7 +490,7 @@ public final class Converter { } /** * Encapsulate writing to a XLIFF file - * + * * @author Christian Schmidt 2005 * */ @@ -499,7 +499,7 @@ public final class Converter { /** * Create a new Instance of XLIFFTarget - * + * * @throws FileNotFoundException * @throws IOException */ |