public class ClassConverter extends Object implements Converter, ClassFileTransformer
| Modifier and Type | Field and Description |
|---|---|
protected EESpecProfile |
profile
The configured spec profile.
|
| Constructor and Description |
|---|
ClassConverter()
Create a class converter with the default TOMCAT profile.
|
ClassConverter(EESpecProfile profile)
Create a class converter with the specified spec profile.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(String filename)
Check if the file can be processed by this converter.
|
boolean |
convert(String path,
InputStream src,
OutputStream dest,
EESpecProfile profile)
Copies the source to the destination, converting it if necessary,
according to the requirements of the given profile.
|
protected boolean |
convertInternal(String path,
InputStream src,
OutputStream dest,
EESpecProfile profile,
ClassLoader loader)
Convert specified class bytecode.
|
String |
toString() |
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
protected final EESpecProfile profile
public ClassConverter()
public ClassConverter(EESpecProfile profile)
profile - the specification profile to use for conversionpublic boolean accepts(String filename)
Converterpublic boolean convert(String path, InputStream src, OutputStream dest, EESpecProfile profile) throws IOException
Converterconvert in interface Converterpath - The path to the data being convertedsrc - The source data to convertdest - The destination to write the converted dataprofile - The profile that defines the conversion requiredIOException - If the conversion failspublic byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform in interface ClassFileTransformerIllegalClassFormatExceptionprotected boolean convertInternal(String path, InputStream src, OutputStream dest, EESpecProfile profile, ClassLoader loader) throws IOException
path - the pathsrc - the source byte streamdest - the output byte streamprofile - the specification profile to useloader - the class loaderIOException - rethrow on byte read or writeCopyright © 2020–2022 The Apache Software Foundation. All rights reserved.