Examples of ClassFileReader


Examples of org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileReader

   * @see IClassFileReader
   * @since 3.2
   */
  public static IClassFileReader createDefaultClassFileReader(InputStream stream, int decodingFlag) {
    try {
      return new ClassFileReader(Util.getInputStreamAsByteArray(stream, -1), decodingFlag);
    } catch(ClassFormatException e) {
      return null;
    } catch(IOException e) {
      return null;
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileReader

   *
   * @see IClassFileReader
   */
  public static IClassFileReader createDefaultClassFileReader(String fileName, int decodingFlag){
    try {
      return new ClassFileReader(Util.getFileByteContent(new File(fileName)), decodingFlag);
    } catch(ClassFormatException e) {
      return null;
    } catch(IOException e) {
      return null;
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileReader

      }
      if (!zipEntryName.toLowerCase().endsWith(SuffixConstants.SUFFIX_STRING_class)) {
        return null;
      }
      byte classFileBytes[] = Util.getZipEntryByteContent(zipEntry, zipFile);
      return new ClassFileReader(classFileBytes, decodingFlag);
    } catch(ClassFormatException e) {
      return null;
    } catch(IOException e) {
      return null;
    } finally {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

          {
            try
            {
              byte[] classBytes = JRLoader.loadBytes(is);
              char[] fileName = className.toCharArray();
              ClassFileReader classFileReader =
                new ClassFileReader(classBytes, fileName, true);
             
              if (is2ArgsConstr)
              {
                return (NameEnvironmentAnswer) constrNameEnvAnsBin2Args.newInstance(new Object[] { classFileReader, null });
              }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

            try {
                byte[] bytes = this.findClass(CharOperation.toString(compoundTypeName));
                if (bytes == null) {
                    return null;
                }
                ClassFileReader classFileReader =
                        new ClassFileReader(bytes, fqn.toCharArray(), true);
                return new NameEnvironmentAnswer(classFileReader, null);
            } catch (Exception e) {
                return null;
            }
        }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

                                baos.write(buf, 0, count);
                            }
                            baos.flush();
                            classBytes = baos.toByteArray();
                            char[] fileName = className.toCharArray();
                            ClassFileReader classFileReader =
                                new ClassFileReader(classBytes, fileName,
                                                    true);
                            return
                                new NameEnvironmentAnswer(classFileReader);
                        }
                    } catch (IOException exc) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

    try {
      if (!name.startsWith("japidviews.")) {
        // let super class loader to load the bytecode
//        byte[] bytes = this.rendererCompiler.crlr.getClassDefinition(name);
        byte[] bytes = this.rendererCompiler.crlr.getClassDefinition(name);
        return bytes == null? null : new NameEnvironmentAnswer(new ClassFileReader(bytes, name.toCharArray(), true), null);
      } else {
        char[] fileName = name.toCharArray();
        RendererClass applicationClass = this.rendererCompiler.japidClasses.get(name);

        // ApplicationClass exists
        if (applicationClass != null) {

          byte[] bytecode = applicationClass.getBytecode();
          if (bytecode != null) {
            ClassFileReader classFileReader = new ClassFileReader(bytecode, fileName, true);
            return new NameEnvironmentAnswer(classFileReader, null);
          }
          // Cascade compilation
          ICompilationUnit compilationUnit = new CompilationUnit(this.rendererCompiler, name);
          return new NameEnvironmentAnswer(compilationUnit, null);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

                }
            }

            private NameEnvironmentAnswer createNameEnvironmentAnswer(final String pClazzName, final byte[] clazzBytes) throws ClassFormatException {               
                final char[] fileName = pClazzName.toCharArray();
                final ClassFileReader classFileReader = new ClassFileReader(clazzBytes, fileName, true);
                return new NameEnvironmentAnswer(classFileReader, null);
            }

            private boolean isSourceAvailable(final String pClazzName, final ResourceReader pReader) {
                // FIXME: this should not be tied to the extension
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

                }
            }

            private NameEnvironmentAnswer createNameEnvironmentAnswer(final String pClazzName, final byte[] clazzBytes) throws ClassFormatException {
                final char[] fileName = pClazzName.toCharArray();
                final ClassFileReader classFileReader = new ClassFileReader(clazzBytes, fileName, true);
                return new NameEnvironmentAnswer(classFileReader, null);
            }

            private boolean isSourceAvailable(final String pClazzName, final ResourceReader pReader) {
                // FIXME: this should not be tied to the extension
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

             * insensitive so we need to use Class.forName to effectively verify
             * the case.
             */
            if (isBinaryType(classLoader, className)) {
              byte[] classBytes = Util.readURLAsBytes(resourceURL);
              ClassFileReader cfr;
              try {
                cfr = new ClassFileReader(classBytes, null);
                return new NameEnvironmentAnswer(cfr, null);
              } catch (ClassFormatException e) {
                // Ignored.
              }
            }
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.