Package net.sf.cglib.transform
Class AbstractTransformTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- net.sf.cglib.transform.AbstractProcessTask
-
- net.sf.cglib.transform.AbstractTransformTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public abstract class AbstractTransformTask extends AbstractProcessTask
-
-
Field Summary
Fields Modifier and Type Field Description private static intCLASS_MAGICprivate booleanverboseprivate static intZIP_MAGIC
-
Constructor Summary
Constructors Constructor Description AbstractTransformTask()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.objectweb.asm.Attribute[]attributes()private booleancheckMagic(java.io.File file, long magic)private byte[]getBytes(java.util.zip.ZipInputStream zip)private static org.objectweb.asm.ClassReadergetClassReader(java.io.File file)protected abstract ClassTransformergetClassTransformer(java.lang.String[] classInfo)returns transformation for source classprotected intgetFlags()protected booleanisClassFile(java.io.File file)protected booleanisJarFile(java.io.File file)private byte[]process(byte[] bytes)private voidprocessClassFile(java.io.File file)protected voidprocessFile(java.io.File file)protected voidprocessJarFile(java.io.File file)voidsetVerbose(boolean verbose)-
Methods inherited from class net.sf.cglib.transform.AbstractProcessTask
addFileset, beforeExecute, execute, getFiles
-
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
-
-
-
-
Field Detail
-
ZIP_MAGIC
private static final int ZIP_MAGIC
- See Also:
- Constant Field Values
-
CLASS_MAGIC
private static final int CLASS_MAGIC
- See Also:
- Constant Field Values
-
verbose
private boolean verbose
-
-
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:
processFilein classAbstractProcessTask- 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.Exceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionjava.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.IOExceptionjava.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
-
-