Package de.ddb.conversion

Examples of de.ddb.conversion.ConversionParameters


  {
    String file = "1015404219_pica.mrc";
    Converter converter = new DumpConverter();
    InputStream in = new FileInputStream("test" + File.separator + "input" + File.separator + file);
    OutputStream out = new FileOutputStream("test" + File.separator + "output" + File.separator + file + ".out");
    ConversionParameters params = new ConversionParameters();
    params.setSourceCharset("x-PICA");
    params.setTargetCharset("UTF-8");
    converter.convert(in, out, params);
  }
View Full Code Here


    InOut inOut = null;
    try {
      inOut = XMabToUtf8.parseArgs(args);
      if (inOut != null) {
        new MabCharsetCodeSetter("UTF-8").convert(inOut.in, inOut.out,
            new ConversionParameters());
      }
      XMabToUtf8.LOGGER.info("Done.");
    } finally {
      if (inOut != null) {
        if (inOut.in != null)
View Full Code Here

              context.getFormat(ConversionContextFactory.DOCFORMATNAME_MABXML1));
      c.getConverterContext()
          .setTargetFormat(
              context.getFormat(ConversionContextFactory.DOCFORMATNAME_MAB2));
      context.addConverter(c);
      final ConversionParameters params = new ConversionParameters();
      params.setSourceCharset(MabxmlToMab.inputEncoding);
      params.setTargetCharset(MabxmlToMab.outputEncoding);
      final ByteArrayOutputStream bout = new ByteArrayOutputStream();
      c.convert(MabxmlToMab.in, bout, params);
      if (MabxmlToMab.outputEncoding.equals("x-MAB")
          || MabxmlToMab.outputEncoding.equals("x-PICA")) {
        /*
 
View Full Code Here

            c.getConverterContext().setSourceEncoding(inputEncoding);
            c.getConverterContext().setTargetEncoding(outputEncoding);
            c.getConverterContext().setSourceFormat(context.getFormat(ConversionContextFactory.DOCFORMATNAME_MABXML1));
            c.getConverterContext().setTargetFormat(context.getFormat(ConversionContextFactory.DOCFORMATNAME_MAB2));
            context.addConverter(c);
            ConversionParameters params = new ConversionParameters();
            InputStream convertedIn = c.convert(in, params);
            if (outputEncoding.equals("x-MAB")
                    || outputEncoding.equals("x-PICA")) {
                /*
                 * No normalization for x-PICA and x-MAB, since they
View Full Code Here

      final MabToMabxmlConverter converter = new MabToMabxmlConverter();
      MabToMabxmlConverterTest.context.addConverter(converter, "MAB2",
          "MABxml-1");
      LOGGER.info("Start conversion...");

      final ConversionParameters params = new ConversionParameters();
      params.setAddDoctype(true);
      params.setAddCollectionHeader(true);
      params.setAddCollectionFooter(true);
      params.setSourceCharset("x-MAB");
      params.setTargetCharset("UTF-8");
      converter.convert(in, out, params);
      out.flush();
      out.close();
      in.close();
      LOGGER.info("number of converted records: "
View Full Code Here

    try {
      out = new BufferedOutputStream(new FileOutputStream(outputFileName));
      in = new BufferedInputStream(new FileInputStream(inputFileName));

      final MabToMabxmlConverter converter = new MabToMabxmlConverter();
      final ConversionParameters params = new ConversionParameters();
      params.setAddDoctype(true);
      params.setAddCollectionHeader(true);
      params.setAddCollectionFooter(true);
      params.setSourceCharset("x-MAB");
      params.setTargetCharset("UTF-8");
      converter.convert(in, out, params);
      LOGGER.info("Start conversion...\n");

      converter.convert(in, out, params);
View Full Code Here

       */

      MabToMabxml.out.write(("<?xml version=\"1.0\" encoding=\""
          + MabToMabxml.outputEncoding + "\"?>\n").getBytes());

      final ConversionParameters params = new ConversionParameters();
      params.setAddDoctype(false);
      params.setTargetCharset(MabToMabxml.outputEncoding);
      params.setSourceCharset(MabToMabxml.inputEncoding);
      final ConversionContext context = ConversionContextFactory
          .newDefaultEnvironment();
      final Converter c = new MabToMabxmlConverter();
      c.getConverterContext()
          .setSourceEncoding(MabToMabxml.inputEncoding);
View Full Code Here

            // Reader convertedIn = new MabToMabxmlConverter()
            // .convert(new MabCharsetCodeSetter(outputEncoding)
            // .convert(in));
            // outputNormalizer.convert(convertedIn, out);
            // }
            ConversionParameters params = new ConversionParameters();
            params.setAddDoctype(false);
            ConversionContext context = ConversionContextFactory.newDefaultEnvironment();
            Converter c = new MabToMabxmlConverter();
            c.getConverterContext().setSourceEncoding(inputEncoding);
            c.getConverterContext().setTargetEncoding(outputEncoding);
            c.getConverterContext().setSourceFormat(context.getFormat(ConversionContextFactory.DOCFORMATNAME_MAB2));
View Full Code Here

    logger.info("testConvert() - propFileName= " + propFileName);
    final Properties props = getTestProperties(propFileName);
    this.inReader = new FileReader(props.getProperty(FILE_NAME_IN));
    this.outWriter = new FileWriter(props.getProperty(FILE_NAME_OUT));
    this.converter.convert(this.inReader, this.outWriter,
        new ConversionParameters());
    logger.info("testConvert() - end");
  }
View Full Code Here

            // out.write(output);
            // if (logger.isDebugEnabled()) {
            // logger.debug("main() - finished conversion. output = " + output);
            // }
            Converter mab2Mabxml = ctx.addConverter(new MabToMabxmlConverter());
            ConversionParameters params = new ConversionParameters();
            mab2Mabxml.convert(c.convert(in, params),
                    out);
            if (logger.isDebugEnabled()) {
                logger.debug("main() - finished conversion.");
            }
View Full Code Here

TOP

Related Classes of de.ddb.conversion.ConversionParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.