Examples of ClassParser


Examples of org.apache.bcel.classfile.ClassParser

   *  called by {@link #prepareClassDefinition()}.
   */
  private void initPreparation() throws java.io.IOException, ClassNotFoundException {
    if( initialized ) {
      // weaver was already used, so reset bcelClass to its original state
      ClassParser classParser = new ClassParser( new ByteArrayInputStream(originalCode), bcelClass.getFileName());
      bcelClass = classParser.parse();
    }
    else
      initialized = true;

    // create bcel generator objects
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

    if( null == clGen || null == bcelClass )
      throw new RuntimeException( "nothing to verify" );

    //System.out.println( "Verifying " + oldClass.getClassName() );
    // Get classes 
    ClassParser cp = new ClassParser( new ByteArrayInputStream(originalCode), targetClass.getName().replace( '.', '/') );
    try {
      bcelClass = cp.parse();
    }
    catch (java.io.IOException e) {
      throw new RuntimeException( e.getMessage() );
    }
    JavaClass newClass = clGen.getJavaClass();
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

        }
        return ret;
    }

    static void nullBCELAdapt(final byte[] b) throws IOException {
        JavaClass jc = new ClassParser(new ByteArrayInputStream(b),
                "class-name").parse();
        ClassGen cg = new ClassGen(jc);
        ConstantPoolGen cp = cg.getConstantPool();
        Method[] ms = cg.getMethods();
        for (int k = 0; k < ms.length; ++k) {
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

                JarEntry entry = export.getKey();
                InputStream in = null;
                try
                {
                    in = jar.getInputStream(entry);
                    ClassParser parser = new ClassParser(in, entry.getName());
                    JavaClass c = parser.parse();
                    index.addEntry(c, rep, bundle, true);
                }
                finally
                {
                    if (in != null)
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

        Vertex jarVertex = singleOrDefault(((Vertex) data.getElement()).getVertices(Direction.BOTH, Ontology.EDGE_LABEL_JAR_CONTAINS, getAuthorizations()), null);

        String fileName = LumifyProperties.FILE_NAME.getPropertyValue(data.getElement());

        JavaClass javaClass = new ClassParser(in, fileName).parse();
        ConstantPoolGen constants = new ConstantPoolGen(javaClass.getConstantPool());

        Vertex classVertex = createClassVertex(javaClass, data);
        if (jarVertex != null) {
            getGraph().addEdge(jarVertex, classVertex, Ontology.EDGE_LABEL_JAR_CONTAINS, data.getProperty().getVisibility(), getAuthorizations());
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

            throw new RuntimeException(e);
        }
        try {
            for (Entry<String, byte[]> entry : rawclasses.entrySet()) {
                ByteArrayInputStream in = new ByteArrayInputStream(entry.getValue());
                ClassParser parser = new ClassParser(in, entry.getKey());
                javaclasses.put(entry.getKey(), new ClassGen(parser.parse()));
                in.close();
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

     *            the input stream from which to read the class file
     * @param fileName
     *            filename of the class file
     */
    public RepositoryClassParser(InputStream inputStream, String fileName) {
        classParser = new ClassParser(inputStream, fileName);
    }
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

     *
     * @param fileName
     *            name of the class file
     */
    public RepositoryClassParser(String fileName)  {
        classParser = new ClassParser(fileName);
    }
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

     *            name of a zip file containing the class
     * @param fileName
     *            name of the zip entry within the class
     */
    public RepositoryClassParser(String zipFile, String fileName) {
        classParser = new ClassParser(zipFile, fileName);
    }
View Full Code Here

Examples of org.apache.bcel.classfile.ClassParser

  }

  byte[] nullAdaptClass (final InputStream is, final String name)
    throws Exception
  {
    JavaClass jc = new ClassParser(is, name + ".class").parse();
    ClassGen cg = new ClassGen(jc);
    ConstantPoolGen cp = cg.getConstantPool();
    Method[] ms = cg.getMethods();
    for (int j = 0; j < ms.length; ++j) {
      MethodGen mg = new MethodGen(ms[j], cg.getClassName(), cp);
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.