Examples of ClassReader


Examples of com.wordnik.swagger.reader.ClassReader

    }

    private List<ApiListing> gatherListings() {
        Map<String, Object> endpoints = context.getBeansWithAnnotation(Path.class);

        ClassReader classReader = ClassReaders.reader().get();

        List<ApiListing> listings = new ArrayList<>();
        for (Object endpoint : endpoints.values()) {
            Option<ApiListing> listing = classReader.read(getApiUrl(), endpoint.getClass(), swaggerConfig);
            if (listing.nonEmpty()) {
                listings.add(listing.get());
            }
        }
View Full Code Here

Examples of jdk.internal.org.objectweb.asm.ClassReader

                if (ze.isDirectory()) {
                    continue;
                }
                out.putNextEntry(ze);
                if (ze.getName().endsWith(".class")) {
                    ClassReader cr = new ClassReader(zf.getInputStream(ze));
                    // cr.accept(new ClassDump(), 0);
                    cr.accept(new ClassVerifier(), 0);
                }
                InputStream is = zf.getInputStream(ze);
                int n;
                do {
                    n = is.read(buf, 0, buf.length);
View Full Code Here

Examples of jodd.asm5.ClassReader

  protected void process() {
    if (targetInputStream == null) {
      throw new ProxettaException("Target missing");
    }
    // create class reader
    ClassReader classReader;
    try {
      classReader = new ClassReader(targetInputStream);
    } catch (IOException ioex) {
      throw new ProxettaException("Error reading class input stream", ioex);
    }

    // reads information
    TargetClassInfoReader targetClassInfoReader = new TargetClassInfoReader();
    classReader.accept(targetClassInfoReader, 0);

    this.destClassWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);

    // create proxy
    if (log.isDebugEnabled()) {
      log.debug("processing: " + classReader.getClassName());
    }
    WorkData wd = process(classReader, targetClassInfoReader);

    // store important data
    proxyApplied = wd.proxyApplied;
View Full Code Here

Examples of limpidlog.org.objectweb.asm.ClassReader

  public synchronized byte[] getModifiedClassBytes(String className, byte[] classBytes) {
    if (Options.debug)
      System.out.println("Bytecoder1.getModifiedClassBytes: " + className +
        " classBytes=" + classBytes.length);

    ClassReader classReader = new ClassReader(classBytes);
    ClassPreVisitor classPreVisitor = new ClassPreVisitor();
    classReader.accept(classPreVisitor, ClassReader.EXPAND_FRAMES);
    Hashtable localVariableVectorHashtable = classPreVisitor.localVariableVectorHashtable;
    Hashtable labelVectorHashtable = classPreVisitor.labelVectorHashtable;

    MyClassWriter myClassWriter =
      new MyClassWriter(labelVectorHashtable, localVariableVectorHashtable);
    classReader = new ClassReader(classBytes);

    if (Options.debug)
      System.out.println("Bytecoder1.getModifiedClassBytes: " +
        "before accept: className="+className+" classBytes=" + classBytes.length);

    classReader.accept(myClassWriter, 0);
    containsDebugInfo = myClassWriter.containsDebugInfo;

    byte[] bytes = null;
    if (Options.forceTransform || containsDebugInfo)
      bytes = myClassWriter.toByteArray();
View Full Code Here

Examples of net.sf.cglib.asm.ClassReader

   * @param nbtCompoundClass - the compound clas.
   * @throws IOException If we cannot find these methods.
   */
  private void findMethodsUsingASM(final Class<?> tileEntityClass) throws IOException {
    final Class<?> nbtCompoundClass = MinecraftReflection.getNBTCompoundClass();
    final ClassReader reader = new ClassReader(tileEntityClass.getCanonicalName());
   
    final String tagCompoundName = getJarName(MinecraftReflection.getNBTCompoundClass());
    final String expectedDesc = "(L" + tagCompoundName + ";)V";
   
    reader.accept(new EmptyClassVisitor() {
      @Override
      public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
        final String methodName = name;
       
        // Detect read/write calls to NBTTagCompound
View Full Code Here

Examples of net.sf.joafip.asm.ClassReader

    byteOutputStream.close();
    inputStream.close();
    final byte[] originalCode = byteOutputStream.toByteArray();
    final int off = 0;
    final int len = originalCode.length;
    final ClassReader classreader = new ClassReader(originalCode, off, len);
    try {
      classreader.accept(this, ClassReader.SKIP_FRAMES);
    } catch (RuntimeEnhanceException exception) {
      throw (EnhanceException) exception.getCause();
    }
    if (logger.debugEnabled) {
      logger.debug(checkMethodListener.unassembled());
View Full Code Here

Examples of net.sf.pizzacompiler.compiler.ClassReader

    public boolean compile() throws IOException {

        ByteArrayOutputStream err = new ByteArrayOutputStream();

        Main.init();
        Main.setClassReader(new ClassReader(this.classpath, null));
        Main.argument("-java");
        Main.argument("-O");
        Main.argument("-nowarn");
        Main.compile(new String[]{file},
                new FileSourceReader(),
View Full Code Here

Examples of nginx.clojure.asm.ClassReader

       
   
    }

    static byte[] instrumentClass(MethodDatabase db, byte[] data, boolean check) {
        ClassReader r = new ClassReader(data);
        ClassWriter cw = new DBClassWriter(db, r);
        ClassVisitor cv = check ? new CheckClassAdapter(cw) : cw;
        ClassEntry ce = MethodDatabaseUtil.buildClassEntryFamily(db, r);
        if(db.shouldIgnore(r.getClassName())) {
            return null;
        }
        db.trace("TRANSFORM: %s", r.getClassName());
        InstrumentClass ic = new InstrumentClass(r.getClassName(), ce, cv, db, false);
        r.accept(ic, ClassReader.SKIP_FRAMES);
        return cw.toByteArray();
    }
View Full Code Here

Examples of oracle.toplink.libraries.asm.ClassReader

  public static void main (final String[] args) throws Exception {
    if (args.length != 1) {
      printUsage();
    }
    ClassReader cr;
    if (args[0].endsWith(".class")) {
      cr = new ClassReader(new FileInputStream(args[0]));
    } else {
      cr = new ClassReader(args[0]);
    }
   
    TreeClassAdapter ca = new TreeClassAdapter(null);
    cr.accept(new CheckClassAdapter(ca), true);
   
    List methods = ca.classNode.methods;
    for (int i = 0; i < methods.size(); ++i) {
      MethodNode method = (MethodNode)methods.get(i);
      if (method.instructions.size() > 0) {
View Full Code Here

Examples of org.apache.openejb.asm.ClassReader

        }

        // Load the parameter names using ASM
        Map<Method, List<String>>  methodParameters = new HashMap<Method, List<String>>();
        try {
            ClassReader reader = AsmParameterNameLoader.createClassReader(clazz);

            AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor visitor = new AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor(clazz, methodName);
            reader.accept(visitor, 0);

            Map exceptions = visitor.getExceptions();
            if (exceptions.size() == 1) {
                throw new RuntimeException((Exception) exceptions.values().iterator().next());
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.