public static class DynamicType.Default extends Object implements DynamicType
| Modifier and Type | Class and Description | 
|---|---|
| protected static class  | DynamicType.Default.Loaded<T>A default implementation of a loaded dynamic type. | 
| static class  | DynamicType.Default.Unloaded<T>A default implementation of an unloaded dynamic type. | 
DynamicType.Builder<T>, DynamicType.Default| Modifier and Type | Field and Description | 
|---|---|
| protected List<? extends DynamicType> | auxiliaryTypesA list of auxiliary types for this dynamic type. | 
| protected byte[] | binaryRepresentationThe byte array representing this dynamic type. | 
| protected LoadedTypeInitializer | loadedTypeInitializerThe loaded type initializer for this dynamic type. | 
| protected TypeDescription | typeDescriptionA type description of this dynamic type. | 
| Constructor and Description | 
|---|
| Default(TypeDescription typeDescription,
       byte[] binaryRepresentation,
       LoadedTypeInitializer loadedTypeInitializer,
       List<? extends DynamicType> auxiliaryTypes)Creates a new dynamic type. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | equals(Object other) | 
| byte[] | getBytes()Returns a byte array representing this dynamic type. | 
| Map<TypeDescription,LoadedTypeInitializer> | getLoadedTypeInitializers()Returns a map of all loaded type initializers for the main type and all auxiliary types, if any. | 
| Map<TypeDescription,byte[]> | getRawAuxiliaryTypes()Returns a map of all auxiliary types that are required for making use of the main type. | 
| TypeDescription | getTypeDescription()Returns a description of this dynamic type. | 
| boolean | hasAliveLoadedTypeInitializers()Checks if a dynamic type requires some form of explicit type initialization, either for itself or for one
 of its auxiliary types, if any. | 
| int | hashCode() | 
| File | inject(File jar)Injects the types of this dynamic type into a given jar file. | 
| File | inject(File sourceJar,
      File targetJar)Injects the types of this dynamic type into a given jar file. | 
| Map<TypeDescription,File> | saveIn(File folder)Saves a dynamic type in a given folder using the Java class file format while respecting the naming conventions
 for saving compiled Java classes. | 
| File | toJar(File file,
     Manifest manifest)Saves the contents of this dynamic type inside a jar file. | 
| String | toString() | 
protected final TypeDescription typeDescription
protected final byte[] binaryRepresentation
protected final LoadedTypeInitializer loadedTypeInitializer
protected final List<? extends DynamicType> auxiliaryTypes
public Default(TypeDescription typeDescription, byte[] binaryRepresentation, LoadedTypeInitializer loadedTypeInitializer, List<? extends DynamicType> auxiliaryTypes)
typeDescription - A description of this dynamic type.binaryRepresentation - A byte array containing the binary representation of this dynamic type.loadedTypeInitializer - The loaded type initializer of this dynamic type.auxiliaryTypes - The auxiliary type required for this dynamic type.public TypeDescription getTypeDescription()
DynamicTypegetTypeDescription in interface DynamicTypepublic Map<TypeDescription,LoadedTypeInitializer> getLoadedTypeInitializers()
DynamicTypegetLoadedTypeInitializers in interface DynamicTypepublic boolean hasAliveLoadedTypeInitializers()
DynamicTypehasAliveLoadedTypeInitializers in interface DynamicTypetrue if this type requires explicit type initialization.public byte[] getBytes()
DynamicTypegetBytes in interface DynamicTypepublic Map<TypeDescription,byte[]> getRawAuxiliaryTypes()
DynamicTypegetRawAuxiliaryTypes in interface DynamicTypepublic Map<TypeDescription,File> saveIn(File folder) throws IOException
DynamicTypefolder does not yet exist, it is created during the
 call of this method.saveIn in interface DynamicTypefolder - The base target folder for storing this dynamic type and its auxiliary types, if any.folder.IOException - Thrown if the underlying file operations cause an IOException.public File inject(File sourceJar, File targetJar) throws IOException
DynamicTypetarget file's folder must exist prior to calling this method. The
 file itself is overwritten or created depending on its prior existence.inject in interface DynamicTypesourceJar - The original jar file.targetJar - The source jar file with the injected contents.target jar file.IOException - If an IO exception occurs while injecting from the source into the target.public File inject(File jar) throws IOException
DynamicTypeinject in interface DynamicTypejar - The jar file to replace with an injected version.jar file.IOException - If an IO exception occurs while injecting into the jar.public File toJar(File file, Manifest manifest) throws IOException
DynamicTypefile must
 exist prior to calling this method.toJar in interface DynamicTypefile - The target file to which the jar is written to.manifest - The manifest of the created jar.file.IOException - If an IO exception occurs while writing the file.Copyright © 2014. All rights reserved.