Package org.hibernate.bytecode.util

Examples of org.hibernate.bytecode.util.ClassDescriptor


  }

  private void collectClassNames(File file) throws Exception {
      if ( isClassFile( file ) ) {
      byte[] bytes = ByteCodeHelper.readByteCode( file );
      ClassDescriptor descriptor = getClassDescriptor( bytes );
        classNames.add( descriptor.getName() );
      }
      else if ( isJarFile( file ) ) {
        ZipEntryHandler collector = new ZipEntryHandler() {
          public void handleEntry(ZipEntry entry, byte[] byteCode) throws Exception {
          if ( !entry.isDirectory() ) {
View Full Code Here


    }

  protected void processClassFile(File file) throws Exception {
    logger.verbose( "Starting class file : " + file.toURL() );
    byte[] bytes = ByteCodeHelper.readByteCode( file );
    ClassDescriptor descriptor = getClassDescriptor( bytes );
    ClassTransformer transformer = getClassTransformer( descriptor );
    if ( transformer == null ) {
      logger.verbose( "skipping file : " + file.toURL() );
      return;
    }

    logger.info( "processing class [" + descriptor.getName() + "]; file = " + file.toURL() );
    byte[] transformedBytes = transformer.transform(
        getClass().getClassLoader(),
        descriptor.getName(),
        null,
        null,
        descriptor.getBytes()
    );

    OutputStream out = new FileOutputStream( file );
    try {
      out.write( transformedBytes );
View Full Code Here

                logger.verbose( "starting entry : " + entry.toString() );
                if ( !entry.isDirectory() ) {
                  // see if the entry represents a class file
                  DataInputStream din = new DataInputStream( new ByteArrayInputStream( byteCode ) );
                  if ( din.readInt() == CLASS_MAGIC ) {
                    ClassDescriptor descriptor = getClassDescriptor( byteCode );
                    ClassTransformer transformer = getClassTransformer( descriptor );
                    if ( transformer == null ) {
                      logger.verbose( "skipping entry : " + entry.toString() );
                    }
                    else {
                      logger.info( "processing class [" + descriptor.getName() + "]; entry = " + file.toURL() );
                      byteCode = transformer.transform(
                          getClass().getClassLoader(),
                          descriptor.getName(),
                          null,
                          null,
                          descriptor.getBytes()
                      );
                    }
                  }
                  else {
                    logger.verbose( "ignoring zip entry : " + entry.toString() );
View Full Code Here

   * @throws Exception indicates problems accessing the file or its contents.
   */
  private void collectClassNames(File file, final Set classNames) throws Exception {
      if ( isClassFile( file ) ) {
      byte[] bytes = ByteCodeHelper.readByteCode( file );
      ClassDescriptor descriptor = getClassDescriptor( bytes );
        classNames.add( descriptor.getName() );
      }
      else if ( isJarFile( file ) ) {
        ZipEntryHandler collector = new ZipEntryHandler() {
          public void handleEntry(ZipEntry entry, byte[] byteCode) throws Exception {
          if ( !entry.isDirectory() ) {
View Full Code Here

   *
   * @throws Exception Indicates an issue either access files or applying the transformations.
   */
  protected void processClassFile(File file, Set classNames) throws Exception {
    byte[] bytes = ByteCodeHelper.readByteCode( file );
    ClassDescriptor descriptor = getClassDescriptor( bytes );
    ClassTransformer transformer = getClassTransformer( descriptor, classNames );
    if ( transformer == null ) {
      logger.debug( "no trasformer for class file : " + file.getAbsolutePath() );
      return;
    }

    logger.info( "processing class : " + descriptor.getName() + ";  file = " + file.getAbsolutePath() );
    byte[] transformedBytes = transformer.transform(
        getClass().getClassLoader(),
        descriptor.getName(),
        null,
        null,
        descriptor.getBytes()
    );

    OutputStream out = new FileOutputStream( file );
    try {
      out.write( transformedBytes );
View Full Code Here

                logger.debug( "starting zip entry : " + entry.toString() );
                if ( !entry.isDirectory() ) {
                  // see if the entry represents a class file
                  DataInputStream din = new DataInputStream( new ByteArrayInputStream( byteCode ) );
                  if ( din.readInt() == CLASS_MAGIC ) {
                    ClassDescriptor descriptor = getClassDescriptor( byteCode );
                    ClassTransformer transformer = getClassTransformer( descriptor, classNames );
                    if ( transformer == null ) {
                      logger.debug( "no transformer for zip entry :  " + entry.toString() );
                    }
                    else {
                      logger.info( "processing class : " + descriptor.getName() + ";  entry = " + file.getAbsolutePath() );
                      byteCode = transformer.transform(
                          getClass().getClassLoader(),
                          descriptor.getName(),
                          null,
                          null,
                          descriptor.getBytes()
                      );
                    }
                  }
                  else {
                    logger.debug( "ignoring zip entry : " + entry.toString() );
View Full Code Here

  }

  private void collectClassNames(File file) throws Exception {
      if ( isClassFile( file ) ) {
      byte[] bytes = ByteCodeHelper.readByteCode( file );
      ClassDescriptor descriptor = getClassDescriptor( bytes );
        classNames.add( descriptor.getName() );
      }
      else if ( isJarFile( file ) ) {
        ZipEntryHandler collector = new ZipEntryHandler() {
          public void handleEntry(ZipEntry entry, byte[] byteCode) throws Exception {
          if ( !entry.isDirectory() ) {
View Full Code Here

    }

  protected void processClassFile(File file) throws Exception {
    logger.verbose( "Starting class file : " + file.toURL() );
    byte[] bytes = ByteCodeHelper.readByteCode( file );
    ClassDescriptor descriptor = getClassDescriptor( bytes );
    ClassTransformer transformer = getClassTransformer( descriptor );
    if ( transformer == null ) {
      logger.verbose( "skipping file : " + file.toURL() );
      return;
    }

    logger.info( "processing class [" + descriptor.getName() + "]; file = " + file.toURL() );
    byte[] transformedBytes = transformer.transform(
        getClass().getClassLoader(),
        descriptor.getName(),
        null,
        null,
        descriptor.getBytes()
    );

    OutputStream out = new FileOutputStream( file );
    try {
      out.write( transformedBytes );
View Full Code Here

                logger.verbose( "starting entry : " + entry.toString() );
                if ( !entry.isDirectory() ) {
                  // see if the entry represents a class file
                  DataInputStream din = new DataInputStream( new ByteArrayInputStream( byteCode ) );
                  if ( din.readInt() == CLASS_MAGIC ) {
                    ClassDescriptor descriptor = getClassDescriptor( byteCode );
                    ClassTransformer transformer = getClassTransformer( descriptor );
                    if ( transformer == null ) {
                      logger.verbose( "skipping entry : " + entry.toString() );
                    }
                    else {
                      logger.info( "processing class [" + descriptor.getName() + "]; entry = " + file.toURL() );
                      byteCode = transformer.transform(
                          getClass().getClassLoader(),
                          descriptor.getName(),
                          null,
                          null,
                          descriptor.getBytes()
                      );
                    }
                  }
                  else {
                    logger.verbose( "ignoring zip entry : " + entry.toString() );
View Full Code Here

  }

  private void collectClassNames(File file) throws Exception {
      if ( isClassFile( file ) ) {
      byte[] bytes = ByteCodeHelper.readByteCode( file );
      ClassDescriptor descriptor = getClassDescriptor( bytes );
        classNames.add( descriptor.getName() );
      }
      else if ( isJarFile( file ) ) {
        ZipEntryHandler collector = new ZipEntryHandler() {
          public void handleEntry(ZipEntry entry, byte[] byteCode) throws Exception {
          if ( !entry.isDirectory() ) {
View Full Code Here

TOP

Related Classes of org.hibernate.bytecode.util.ClassDescriptor

Copyright © 2018 www.massapicom. 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.