Package de.ddb.conversion.converters.mab

Examples of de.ddb.conversion.converters.mab.MabxmlToMabConverter


            /*
             * convert input
             */
            ConversionContext context = ConversionContextFactory.newDefaultEnvironment();
           
            Converter c = new MabxmlToMabConverter();
            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
                 * NFD-normalize their input anyway
View Full Code Here


       * convert input
       */
      final ConversionContext context = ConversionContextFactory
          .newDefaultEnvironment();

      final Converter c = new MabxmlToMabConverter();
      c.getConverterContext()
          .setSourceEncoding(MabxmlToMab.inputEncoding);
      c.getConverterContext().setTargetEncoding(
          MabxmlToMab.outputEncoding);
      c.getConverterContext()
          .setSourceFormat(
              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")) {
        /*
         * No normalization for x-PICA and x-MAB, since they
         * NFD-normalize their input anyway
View Full Code Here

TOP

Related Classes of de.ddb.conversion.converters.mab.MabxmlToMabConverter

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.