1   /*
2    * Copyright (C) The MetaClass Group. All rights reserved.
3    *
4    * This software is published under the terms of the Spice
5    * Software License version 1.1, a copy of which has been included
6    * with this distribution in the LICENSE.txt file.
7    */
8   package org.codehaus.metaclass.io;
9   
10  import java.io.IOException;
11  import java.io.InputStream;
12  import java.io.OutputStream;
13  import org.codehaus.metaclass.model.ClassDescriptor;
14  
15  /***
16   * @author Peter Donald
17   * @version $Revision: 1.1 $ $Date: 2003/12/11 08:41:51 $
18   */
19  public class MockMetaClassIOASM
20      extends MetaClassIOASM
21  {
22      private final IOException m_ioe;
23  
24      public MockMetaClassIOASM()
25      {
26          this( null );
27      }
28  
29      public MockMetaClassIOASM( final IOException ioe )
30      {
31          m_ioe = ioe;
32      }
33  
34      ExtractMetaDataVisitor visitClassFile( final InputStream input )
35          throws IOException
36      {
37          return new FailedExtractMetaDataVisitor();
38      }
39  
40      public void serializeClass( final InputStream input,
41                                  final OutputStream output,
42                                  final ClassDescriptor info )
43          throws Exception
44      {
45          if( null != m_ioe )
46          {
47              throw m_ioe;
48          }
49      }
50  }