Class AbstractTransformTask

  • All Implemented Interfaces:
    java.lang.Cloneable

    public abstract class AbstractTransformTask
    extends AbstractProcessTask
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int CLASS_MAGIC  
      private boolean verbose  
      private static int ZIP_MAGIC  
      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.objectweb.asm.Attribute[] attributes()  
      private boolean checkMagic​(java.io.File file, long magic)  
      private byte[] getBytes​(java.util.zip.ZipInputStream zip)  
      private static org.objectweb.asm.ClassReader getClassReader​(java.io.File file)  
      protected abstract ClassTransformer getClassTransformer​(java.lang.String[] classInfo)
      returns transformation for source class
      protected int getFlags()  
      protected boolean isClassFile​(java.io.File file)  
      protected boolean isJarFile​(java.io.File file)  
      private byte[] process​(byte[] bytes)  
      private void processClassFile​(java.io.File file)  
      protected void processFile​(java.io.File file)  
      protected void processJarFile​(java.io.File file)  
      void setVerbose​(boolean verbose)  
      • Methods inherited from class org.apache.tools.ant.Task

        bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractTransformTask

        public AbstractTransformTask()
    • Method Detail

      • setVerbose

        public void setVerbose​(boolean verbose)
      • getClassTransformer

        protected abstract ClassTransformer getClassTransformer​(java.lang.String[] classInfo)
        returns transformation for source class
        Parameters:
        classInfo - class information class name := classInfo[ 0 ] super class name := classInfo[ 1 ] interfaces := classInfo[ >1 ]
      • attributes

        protected org.objectweb.asm.Attribute[] attributes()
      • processFile

        protected void processFile​(java.io.File file)
                            throws java.lang.Exception
        Specified by:
        processFile in class AbstractProcessTask
        Throws:
        java.lang.Exception
      • processClassFile

        private void processClassFile​(java.io.File file)
                               throws java.lang.Exception,
                                      java.io.FileNotFoundException,
                                      java.io.IOException,
                                      java.net.MalformedURLException
        Parameters:
        file -
        Throws:
        java.lang.Exception
        java.io.FileNotFoundException
        java.io.IOException
        java.net.MalformedURLException
      • getFlags

        protected int getFlags()
      • getClassReader

        private static org.objectweb.asm.ClassReader getClassReader​(java.io.File file)
                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isClassFile

        protected boolean isClassFile​(java.io.File file)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • processJarFile

        protected void processJarFile​(java.io.File file)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • process

        private byte[] process​(byte[] bytes)
                        throws java.lang.Exception
        Parameters:
        bytes -
        Returns:
        Throws:
        java.io.IOException
        java.lang.Exception
      • getBytes

        private byte[] getBytes​(java.util.zip.ZipInputStream zip)
                         throws java.io.IOException
        Parameters:
        zip -
        Returns:
        Throws:
        java.io.IOException
      • checkMagic

        private boolean checkMagic​(java.io.File file,
                                   long magic)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • isJarFile

        protected boolean isJarFile​(java.io.File file)
                             throws java.io.IOException
        Throws:
        java.io.IOException