Package de.ddb.conversion

Examples of de.ddb.conversion.GenericConverter


    final static Format B = new Format("B");

    public void testGetConverter() throws ConverterException {
        ConverterRegistry registry = new ConverterRegistry();

        Converter anyEncConverter = new GenericConverter(){
         
          // A, B, null, null
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
            getConverterContext().setSourceEncoding(null);
            getConverterContext().setTargetEncoding(null);
          }

      public void convert(InputStream in, OutputStream out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }

      public void convert(Reader in, Writer out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }
         
        };
       
        Converter anySourceEncConverter = new GenericConverter(){
         
//          A, B, null, "UTF-8"
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
            getConverterContext().setSourceEncoding(null);
            getConverterContext().setTargetEncoding("UTF-8");
          }

      public void convert(InputStream in, OutputStream out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }

      public void convert(Reader in, Writer out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }
         
        };
        Converter anyTargetEncConverter = new GenericConverter(){
         
//          A, B, "UTF-8", null
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
            getConverterContext().setSourceEncoding("UTF-8");
            getConverterContext().setTargetEncoding(null);
          }

      public void convert(InputStream in, OutputStream out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }

      public void convert(Reader in, Writer out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }
         
        };
        Converter specifiedEncConverter = new GenericConverter(){
         
//          A, B, "UTF-8", "UTF-8"
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
View Full Code Here


            if (in != null)
                in.close();
        }

       
        GenericConverter converter = new MabToMabxmlConverter();
        converter.getConverterContext().setSourceFormat(new Format("MAB2"));
        converter.getConverterContext().setTargetFormat(new Format("MABxml-1"));
        LOGGER.info("Start conversion...\n");
        List<byte[]> records = converter.convertToList(byteArray
                .toByteArray(), "x-MAB", "UTF-8");
        for (byte[] buf : records)
        {
            LOGGER.info(buf);
        }
View Full Code Here

TOP

Related Classes of de.ddb.conversion.GenericConverter

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.