public abstract class ProxettaFactory<T extends ProxettaFactory,P extends Proxetta>
extends java.lang.Object
Proxetta
only holds aspects and
configuration, ProxettaBuilder
deals with the
actually building proxies and wrappers over provided target.Modifier and Type | Field and Description |
---|---|
protected ClassWriter |
destClassWriter |
protected P |
proxetta |
protected boolean |
proxyApplied |
protected java.lang.String |
proxyClassName |
protected java.lang.String |
requestedProxyClassName
Requested proxy class name (or class name template).
|
protected static int |
suffixCounter
Number appended to proxy class name, incremented on each use to make classnames unique
in the system (e.g. classloader).
|
Modifier | Constructor and Description |
---|---|
protected |
ProxettaFactory(P proxetta)
Creates new builder.
|
Modifier and Type | Method and Description |
---|---|
protected T |
_this() |
protected void |
assertProxyIsCreated()
Checks if proxy is created and throws an exception if not.
|
byte[] |
create()
Returns byte array of created class.
|
java.lang.Class |
define()
Defines class.
|
protected void |
dumpClassInDebugFolder(byte[] bytes)
Writes created class content to output folder for debugging purposes.
|
java.lang.String |
getProxyClassName()
Returns proxy class name.
|
boolean |
isProxyApplied()
Returns
true if at least one method was wrapped. |
java.lang.Object |
newInstance()
Creates new instance of created class.
|
protected void |
process()
Reads the target and creates destination class.
|
protected abstract WorkData |
process(ClassReader cr,
TargetClassInfoReader targetClassInfoReader)
Creates custom class builder and process the target class with it.
|
protected java.lang.String |
resolveClassNameSuffix()
Returns new suffix or
null if suffix is not in use. |
T |
setTarget(java.lang.Class target)
Defines class as a target.
|
protected T |
setTarget(java.io.InputStream target)
Defines class input stream as a target.
|
protected T |
setTarget(java.lang.String targetName)
Defines class name as a target.
|
T |
setTargetProxyClassName(java.lang.String targetProxyClassName)
Sets requested proxy class name.
|
protected byte[] |
toByteArray()
Returns raw bytecode.
|
protected java.lang.String requestedProxyClassName
protected static int suffixCounter
Proxetta.setVariableClassName(boolean)
protected ClassWriter destClassWriter
protected boolean proxyApplied
protected java.lang.String proxyClassName
protected ProxettaFactory(P proxetta)
protected T _this()
public T setTargetProxyClassName(java.lang.String targetProxyClassName)
protected T setTarget(java.io.InputStream target)
protected T setTarget(java.lang.String targetName)
public T setTarget(java.lang.Class target)
protected java.lang.String resolveClassNameSuffix()
null
if suffix is not in use.protected abstract WorkData process(ClassReader cr, TargetClassInfoReader targetClassInfoReader)
protected void process()
public byte[] create()
public java.lang.Class define()
public java.lang.Object newInstance()
protected void dumpClassInDebugFolder(byte[] bytes)
protected void assertProxyIsCreated()
protected byte[] toByteArray()
public boolean isProxyApplied()
true
if at least one method was wrapped.public java.lang.String getProxyClassName()
Copyright © 2003-present Jodd Team