• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2017 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 package org.mockitoutil;
6 
7 import org.objectweb.asm.ClassWriter;
8 
9 import static org.objectweb.asm.Opcodes.*;
10 
11 public class SimpleClassGenerator {
12 
makeMarkerInterface(String qualifiedName)13     public static byte[] makeMarkerInterface(String qualifiedName) {
14         String relativePath = qualifiedName.replace('.', '/');
15 
16         ClassWriter cw = new ClassWriter(0);
17         cw.visit(V1_6, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, relativePath, null, "java/lang/Object", null);
18         cw.visitEnd();
19 
20         return cw.toByteArray();
21     }
22 
23 }
24