final class DmoProxyPlugin extends java.lang.Object implements ProxyAssemblerPlugin, DmoAsmTypes, org.objectweb.asm.Opcodes
T<? extends BaseDataType> getFoo(NumberType index) T<? extends BaseDataType>[] getFoo() void setFoo(NumberType index, T<? extendsBaseDataType> foo) void setFoo(T<? extendsBaseDataType> foo) void setFoo(T<? extendsBaseDataType>[] foo)
Note that the supported return and parameter types are concrete subclasses of
BaseDataType
, not generics; the generics above are meant only to express that the
data types supported are limited to BaseDataType
sub-types.
In addition, methods with the following signatures are handled specially by this plugin:
T<? extends BaseDataType> getFoo(int index) void setFoo(int index, T<? extendsBaseDataType> foo)
For extent fields converted to a normalized form, the above two method types are overridden by this plugin. For the most part, the implementation is provided by the main proxy assembler. However, it is augmented with a range check, which is applied before the normal delegation to an invocation handler.
For the denormalized form of these two method types, the plugin implementation applies the range check, then performs the bytecode equivalent of a switch statement to delegate an indexed invocation to the appropriate, matching scalar getter or setter method. The actual scalar method invoked is determined by the subscript value passed into the indexed method. The scalar method then delegates to the invocation handler as usual.
As a result of these specialized method implementations, the only DMO getter and setter method
signatures that ever are passed to the associated invocation handler for scalar fields and
extent fields converted to a denormalized form are simple, scalar variants (simple bean
methods). For extent fields converted to a normalized form, the additional two, indexed methods
above are passed in as well. This allows the invocation handler to remain simpler and avoid
expensive runtime lookups to distinguish the less commonly invoked forms of the legacy-support
methods (i.e., the first five variants listed above). It also ensures that any subscripts have
been checked for unknown value (for NumberType
index values) and for range
validity before the invocation handler is invoked. This avoids the runtime cost of determining
extents for subscript validity checks in the invocation handler, since these checks are now
compiled into the proxies themselves.
Modifier and Type | Class and Description |
---|---|
private static class |
DmoProxyPlugin.IndexedGetterAssembler
This class assembles an indexed getter method which performs a range check on the index
before calling the proxy's invocation handler.
|
protected static class |
DmoProxyPlugin.IndexedProxyMethod
A base class for concrete implementations of indexed proxy method assemblers.
|
private static class |
DmoProxyPlugin.IndexedSetterAssembler
This class assembles an indexed setter method which performs a range check on the index
before calling the proxy's invocation handler.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
arrayBulkGetterMap
Denormalized property names to getter methods which return an array of wrapper objects
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
arrayBulkSetterMap
Denormalized property names to bulk setter methods which accept an array parameter
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
bdtGetterMap
Denormalized property names to indexed getter methods with a NumberType wrapper index
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
bdtSetterMap
Denormalized property names to indexed setter methods with a NumberType wrapper index
|
private static java.lang.String |
COMPOSITE
Prefix for name of composite inner class containing normalized extent field properties
|
private java.util.Map<java.lang.String,java.lang.String[]> |
denormPropMap
Indexed property names to arrays of denormalized, custom extent property names
|
private java.lang.Class<?> |
dmoBufInterface
DMO interface provided by proxy assembler (may be a sub-interface of target interface)
|
private java.lang.Class<?> |
dmoClass
DMO implementation class containing legacy field annotations
|
private java.util.Map<java.lang.String,java.lang.Integer> |
extentMap
Indexed property names to extent sizes (does not include denormalized properties)
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
legacyGetterMap
Property names to legacy getter methods (primitive int index for extent fields)
|
private java.util.Set<java.lang.String> |
legacyProps
Set of property names representing only legacy fields (not denormalized)
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
legacySetterMap
Property names to legacy setter methods (primitive int index for extent fields)
|
private static java.util.logging.Logger |
LOG
Logger
|
private java.util.Map<java.lang.reflect.Method,ProxyAssembler.ProxyMethod> |
methodAssemblerMap
Indexed getter/setter methods to proxy method assemblers
|
private java.util.Set<java.lang.reflect.Method> |
methods
Methods for which this plugin implements proxies (instead of default proxy assembler)
|
private java.util.Map<java.lang.String,java.lang.Integer> |
normPropExtentMap
Indexed property names to corresponding extents
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
pojoGetterMap
Property names to POJO getter methods
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
pojoSetterMap
Property names to all setter methods
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
primGetterMap
Denormalized property names to indexed getter methods with a primitive integer index
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
primSetterMap
Denormalized property names to indexed setter methods with a primitive integer index
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
scalarBulkSetterMap
Denormalized property names to bulk setter methods which accept a scalar parameter
|
private java.lang.Class<?> |
targetInterface
DMO interface which declares POJO bean,
Buffer and legacy support methods |
ANNOTATION_DESC_PREFIX, BUF, BUF_SUFFIX, BUFFER_IFACE, DESC_ARRAYLIST, DESC_DATE, DESC_JAVA_INTEGER, DESC_JAVA_STRING, DESC_LIST, FLD_MULTIPLEX, METH_ADD, METH_ASSIGN, METH_CHKXRNG, METH_GET, METH_INIT, METH_INTVALUE, METH_ISUNK, METH_MIN, METH_OOBE, METH_SETUNK, METH_SIZE, PKG_PERSIST, PKG_UTIL, SIG_ADD, SIG_CHKXRNG, SIG_DEF_INIT, SIG_DMO_ASSIGN, SIG_GET, SIG_INT_INIT, SIG_INTVALUE, SIG_ISUNK, SIG_MIN, SIG_OOBE, SIG_SETUNK, SIG_SIZE, TYPE_ARRAYLIST, TYPE_BINARYDATA, TYPE_BUFFERIMPL, TYPE_CHARACTER, TYPE_DATE, TYPE_DATETIME, TYPE_DATETIMETZ, TYPE_DECIMAL, TYPE_HANDLE, TYPE_INT64, TYPE_INTEGER, TYPE_LIST, TYPE_LOGICAL, TYPE_LONGCHAR, TYPE_MATH, TYPE_MEMPTR, TYPE_NUMBERTYPE, TYPE_OBJECT, TYPE_PERSISTABLE, TYPE_RAW, TYPE_RECID, TYPE_ROWID, TYPE_SERIALIZABLE, TYPE_TEMPORARY, TYPE_TEXT, TYPE_UNDOABLE
AALOAD, AASTORE, ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_MANDATED, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASM4, ASM5, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DOUBLE, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F_APPEND, F_CHOP, F_FULL, F_NEW, F_SAME, F_SAME1, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAT, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, H_GETFIELD, H_GETSTATIC, H_INVOKEINTERFACE, H_INVOKESPECIAL, H_INVOKESTATIC, H_INVOKEVIRTUAL, H_NEWINVOKESPECIAL, H_PUTFIELD, H_PUTSTATIC, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INTEGER, INVOKEDYNAMIC, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LONG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, NULL, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, TOP, UNINITIALIZED_THIS, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8
Constructor and Description |
---|
DmoProxyPlugin(java.lang.Class<?> dmoBufInterface,
java.lang.Class<?> dmoClass)
Create an instance of this plugin.
|
Modifier and Type | Method and Description |
---|---|
private void |
analyze()
Analyze the instance fields in the DMO implementation class associated with the DMO
interface, and cross-reference this information with the interface's methods, for the
purpose of assembling proxy implementations of these methods.
|
private void |
analyzeDmoBufMethod(java.lang.reflect.Method method)
Analyze a method declared by the root DMO buffer interface, and categorize this method for
further processing/assembly.
|
private void |
analyzeDmoMethod(java.lang.reflect.Method method)
Analyze a method declared by the root DMO buffer interface's enclosing interface, and
categorize this method for further processing/assembly.
|
private void |
analyzeFields(java.lang.Class<?> cls)
Analyze the instance fields of a DMO implementation class, or inner composite class, for
the purpose of categorizing the fields, extracting annotation metadata, and later
cross-referencing this information with DMO interface methods which require proxy
implementations.
|
void |
assemble(org.objectweb.asm.ClassWriter classWriter)
Entry point into this plugin's arbitrary method assembly process.
|
private void |
assembleArrayBulkGetter(org.objectweb.asm.ClassWriter classWriter,
java.lang.String dmoBufIfaceType,
java.lang.String baseProperty,
java.lang.reflect.Method method)
Assemble a getter method which returns an array containing all the values in an array
property by delegating to the corresponding, primitive, indexed getter method in a loop.
|
private void |
assembleArrayBulkSetter(org.objectweb.asm.ClassWriter classWriter,
java.lang.String dmoBufIfaceType,
java.lang.String baseProperty,
java.lang.reflect.Method method)
Assemble a setter method which accepts an array containing zero or more values to be stored
in an array property, at the corresponding element positions, by delegating to the
corresponding, primitive, indexed setter method in a loop.
|
private void |
assembleDenormBdtGetter(org.objectweb.asm.ClassWriter classWriter,
java.lang.String dmoBufIfaceType,
java.lang.String baseProperty,
java.lang.reflect.Method method)
Assemble an indexed getter method which accepts a
NumberType index, does an
unknown value check, and delegates to the corresponding, indexed getter method. |
private void |
assembleDenormBdtSetter(org.objectweb.asm.ClassWriter classWriter,
java.lang.String dmoBufIfaceType,
java.lang.String baseProperty,
java.lang.reflect.Method method)
Assemble an indexed setter method which accepts a
NumberType index, does an
unknown value check, and delegates to the corresponding, indexed getter method. |
private void |
assembleDenormPrimGetter(org.objectweb.asm.ClassWriter classWriter,
java.lang.String dmoBufIfaceType,
java.lang.String baseProperty,
java.lang.reflect.Method method)
Assemble an indexed getter method which accepts a primitive
int index and
delegates to the appropriate, denormalized, simple getter method. |
private void |
assembleDenormPrimSetter(org.objectweb.asm.ClassWriter classWriter,
java.lang.String dmoBufIfaceType,
java.lang.String baseProperty,
java.lang.reflect.Method method)
Assemble an indexed setter method which accepts a primitive
int index and
delegates to the appropriate, denormalized, simple setter method. |
private static void |
assembleReturnUnknown(org.objectweb.asm.MethodVisitor mv,
java.lang.String typeName,
int localVar)
Assemble bytecode instructions to return an instance of a
BaseDataType
subclass of the given type, initialized to unknown value. |
private void |
assembleScalarBulkSetter(org.objectweb.asm.ClassWriter classWriter,
java.lang.String dmoBufIfaceType,
java.lang.String baseProperty,
java.lang.reflect.Method method)
Assemble a setter method which accepts a scalar value and store that value into each
element in an array property, by delegating to the corresponding, primitive, indexed setter
method in a loop.
|
private org.objectweb.asm.Label |
assembleUnknownValueCheck(org.objectweb.asm.MethodVisitor mv)
Assemble the instructions to test whether the
NumberType object in local
variable slot 1 (i.e., the subscript parameter to an indexed getter/setter method)
represents the unknown value, and to jump to the instruction represented by the returned
label if so. |
private static java.lang.Class<?> |
findRootProxyInterface(java.lang.Class<?> iface)
Find the ancestral root of inner interfaces which extend
Buffer . |
java.util.Set<java.lang.reflect.Method> |
getImplementedMethods()
Report the set of methods which this plugin will implement.
|
private java.lang.String |
getPropertyName(java.lang.reflect.Method method)
Extract the DMO property name from the given method, which is assumed to be a getter or
setter method.
|
ProxyAssembler.ProxyMethod |
getProxyMethodAssembler(java.lang.reflect.Method method)
Return an object which will assemble the given proxy method, or
null if this
plugin will allow the default proxy method implementation. |
private void |
logUnexpectedMethod(java.lang.reflect.Method method)
Log a warning that an unexpected method was encountered while introspecting a DMO
interface or DMO buffer interface.
|
private static final java.util.logging.Logger LOG
private static final java.lang.String COMPOSITE
private final java.lang.Class<?> dmoBufInterface
private final java.lang.Class<?> targetInterface
Buffer
and legacy support methodsprivate final java.lang.Class<?> dmoClass
private java.util.Set<java.lang.reflect.Method> methods
private java.util.Map<java.lang.reflect.Method,ProxyAssembler.ProxyMethod> methodAssemblerMap
private java.util.Map<java.lang.String,java.lang.Integer> extentMap
private java.util.Set<java.lang.String> legacyProps
private java.util.Map<java.lang.String,java.lang.reflect.Method> legacyGetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> legacySetterMap
private java.util.Map<java.lang.String,java.lang.String[]> denormPropMap
private java.util.Map<java.lang.String,java.lang.Integer> normPropExtentMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> pojoGetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> pojoSetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> primGetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> primSetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> bdtGetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> bdtSetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> arrayBulkGetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> arrayBulkSetterMap
private java.util.Map<java.lang.String,java.lang.reflect.Method> scalarBulkSetterMap
public DmoProxyPlugin(java.lang.Class<?> dmoBufInterface, java.lang.Class<?> dmoClass)
dmoBufInterface
- DMO buffer interface.dmoClass
- DMO implementation class.private static java.lang.Class<?> findRootProxyInterface(java.lang.Class<?> iface)
Buffer
. This will be
the one which declares any special methods declared for legacy business logic, and whose
enclosing interface defines the POJO methods of the DMO.
Converted temp-table DMO interfaces may define such nested interfaces arbitrarily deeply, so we have to find the root in order to inspect the methods we need to proxy.
iface
- DMO buffer interface to test.iface
if it represents the
root.private static void assembleReturnUnknown(org.objectweb.asm.MethodVisitor mv, java.lang.String typeName, int localVar)
BaseDataType
subclass of the given type, initialized to unknown value. While the call to
setUnknownValue()
may be redundant for most BDT sub-types (since a default
constructor initializes to unknown value in most cases), it was decided to leave this
invocation in place to make the operation explicit and to make the assembled code more
resilient to possible future changes.mv
- Method visitor.typeName
- Internal form name of BaseDataType
subclass which should be
instantiated.localVar
- Zero-based index of the local variable slot which should be used for the unknown
value object before the object is returned.public java.util.Set<java.lang.reflect.Method> getImplementedMethods()
Note that any method in the returned set will NOT be included in the array of methods the
invocation handler will have access to at runtime. Therefore, the returned set should NOT
include any method handled specifically by getProxyMethodAssembler(Method)
.
getProxyMethodAssembler(Method)
will not be invoked for any of the methods in the
returned set.
See the class javadoc
for additional information on which DMO
methods this plugin will implement.
getImplementedMethods
in interface ProxyAssemblerPlugin
public ProxyAssembler.ProxyMethod getProxyMethodAssembler(java.lang.reflect.Method method)
null
if this
plugin will allow the default proxy method implementation. If a non-null
value is returned, the corresponding method should NOT be included in the set of methods
reported by getImplementedMethods()
.
This method is invoked for each proxy method implemented by the main proxy assembler.
This plugin implementation will return a non-null
value only for indexed
getter and setter fields which accept a primitive int
for the first argument
(the subscript value), and only in the case the associated extent field was converted in
normalized form. This is done because we need the default proxy implementation for this
category of method (it is backed by an implementation in the DMO implementation class), but
we also need to implement a range check on the subscript value ahead of that default
behavior.
For all other methods, null
is returned.
getProxyMethodAssembler
in interface ProxyAssemblerPlugin
method
- Method for which a proxy implementation is needed.ProxyAssembler.ProxyMethod
or null
if the
default proxy method implementation is suitable for the given method.getImplementedMethods()
public void assemble(org.objectweb.asm.ClassWriter classWriter)
getImplementedMethods()
and after getProxyMethodAssembler(Method)
(i.e.,
after the main proxy assembler has implemented its methods), but before
ClassWriter.visitEnd
is invoked to terminate the assembly process.assemble
in interface ProxyAssemblerPlugin
classWriter
- ASM class writer which the plugin will use to do its work.private void analyze()
Update the PropertyHelper
's legacy getter and setter method caches for the DMO
interface as an important side effect.
private void analyzeFields(java.lang.Class<?> cls)
cls
- DMO implementation class or inner composite class which contains instance fields.private void analyzeDmoBufMethod(java.lang.reflect.Method method)
The method
argument must conform to one of the following signatures, where
"foo" is an example property name (note: access modifiers intentionally are omitted, and
the generics here are intended only to express valid types; however, the actual method
signature must not include generics):
T<? extends BaseDataType> getFoo(int index) T<? extends BaseDataType> getFoo(NumberType index) T<? extends BaseDataType>[] getFoo() void setFoo(int index, T<? extendsBaseDataType> foo) void setFoo(NumberType index, T<? extendsBaseDataType> foo) void setFoo(T<? extendsBaseDataType> foo) void setFoo(T<? extendsBaseDataType>[] foo)
If any other signature is encountered, a warning is logged and this method returns immediately.
method
- Method requiring analysis.private void analyzeDmoMethod(java.lang.reflect.Method method)
The method
argument must conform to one of the following signatures, where
"foo" is an example property name (note: access modifiers intentionally are omitted, and
the generics here are intended only to express valid types; however, the actual method
signature must not include generics):
T<? extends BaseDataType> getFoo() T<? extends BaseDataType> getFoo(int index) void setFoo(T<? extendsBaseDataType> foo) void setFoo(int index, T<? extendsBaseDataType> foo)
If any other signature is encountered, a warning is logged and this method returns immediately.
method
- Method requiring analysis.private java.lang.String getPropertyName(java.lang.reflect.Method method)
If the method does not follow the naming convention of a getter or setter method, log a
warning and return null
.
method
- DMO getter/setter method.null
if method is not a getter or setter.private void assembleDenormPrimGetter(org.objectweb.asm.ClassWriter classWriter, java.lang.String dmoBufIfaceType, java.lang.String baseProperty, java.lang.reflect.Method method)
int
index and
delegates to the appropriate, denormalized, simple getter method.
The source equivalent for an integer
property foo
with extent
N
and default denormalization naming would be:
public integer getFoo(int index) { switch (index) { case 0: return getFoo1(); case 1: return getFoo2(); ... case N: return getFooN(); } outOfBoundsError(index); integer unk = new integer(); unk.setUnknown(); return unk; }
classWriter
- ASM class writerdmoBufIfaceType
- Internal type name of the interface containing the method being implemented and
the methods it calls.baseProperty
- Base property name associated with the indexed setter.method
- Indexed setter method.private void assembleDenormPrimSetter(org.objectweb.asm.ClassWriter classWriter, java.lang.String dmoBufIfaceType, java.lang.String baseProperty, java.lang.reflect.Method method)
int
index and
delegates to the appropriate, denormalized, simple setter method.
The source equivalent for an integer
property foo
with extent
N
and default denormalization naming would be:
public void setFoo(int index, integer foo) { switch (index) { case 0: setFoo1(foo); return; case 1: setFoo2(foo); return; ... case N: setFooN(); return; } outOfBoundsError(index); }
classWriter
- ASM class writer.dmoBufIfaceType
- Internal type name of the interface containing the method being implemented and
the methods it calls.baseProperty
- Base property name associated with the indexed setter.method
- Indexed setter method.private void assembleDenormBdtGetter(org.objectweb.asm.ClassWriter classWriter, java.lang.String dmoBufIfaceType, java.lang.String baseProperty, java.lang.reflect.Method method)
NumberType
index, does an
unknown value check, and delegates to the corresponding, indexed getter method.
The source equivalent for an integer
property foo
with default
denormalization naming would be:
public integer getFoo(NumberType index) { if (index.isUnknown()) { integer unk = new integer(); unk.setUnknown(); return unk; } return getFoo(index.intValue()); }
classWriter
- ASM class writerdmoBufIfaceType
- Internal type name of the interface containing the method being implemented and
the methods it calls.baseProperty
- Base property name associated with the indexed getter.method
- Indexed getter method.private void assembleDenormBdtSetter(org.objectweb.asm.ClassWriter classWriter, java.lang.String dmoBufIfaceType, java.lang.String baseProperty, java.lang.reflect.Method method)
NumberType
index, does an
unknown value check, and delegates to the corresponding, indexed getter method.
The source equivalent for an integer
property foo
with default
denormalization naming would be:
public void setFoo(NumberType index, integer foo) { if (index.isUnknown()) { return; } setFoo(index.intValue(), foo); }
classWriter
- ASM class writerdmoBufIfaceType
- Internal type name of the interface containing the method being implemented and
the methods it calls.baseProperty
- Base property name associated with the indexed setter.method
- Indexed setter method.private void assembleArrayBulkGetter(org.objectweb.asm.ClassWriter classWriter, java.lang.String dmoBufIfaceType, java.lang.String baseProperty, java.lang.reflect.Method method)
The source equivalent for an integer
property foo
with extent
N
and default denormalization naming would be:
public integer[] getFoo() { integer[] fooArray = new integer[N]; for (int i = 0; i < N; i++) { fooArray[i] = getSchedule(i); } return fooArray; }
classWriter
- ASM class writerdmoBufIfaceType
- Internal type name of the interface containing the method being implemented and
the methods it calls.baseProperty
- Base property name associated with the getter.method
- Array bulk getter method.private void assembleArrayBulkSetter(org.objectweb.asm.ClassWriter classWriter, java.lang.String dmoBufIfaceType, java.lang.String baseProperty, java.lang.reflect.Method method)
The source equivalent for an integer
property foo
with extent
N
and default denormalization naming would be:
public void setFoo(integer[] foo) { int len = Math.min(foo.length, N); for (int i = 0; i < len; i++) { setFoo(i, foo[i]); } }
classWriter
- ASM class writerdmoBufIfaceType
- Internal type name of the interface containing the method being implemented and
the methods it calls.baseProperty
- Base property name associated with the setter.method
- Array bulk setter method.private void assembleScalarBulkSetter(org.objectweb.asm.ClassWriter classWriter, java.lang.String dmoBufIfaceType, java.lang.String baseProperty, java.lang.reflect.Method method)
The source equivalent for an integer
property foo
with extent
N
and default denormalization naming would be:
public void setFoo(integer foo) { for (int i = 0; i < N; i++) { setFoo(i, foo); } }
classWriter
- ASM class writerdmoBufIfaceType
- Internal type name of the interface containing the method being implemented and
the methods it calls.baseProperty
- Base property name associated with the setter.method
- Scalar bulk setter method.private org.objectweb.asm.Label assembleUnknownValueCheck(org.objectweb.asm.MethodVisitor mv)
NumberType
object in local
variable slot 1 (i.e., the subscript parameter to an indexed getter/setter method)
represents the unknown value, and to jump to the instruction represented by the returned
label if so. It is up to the caller to assign the label to a jump destination.mv
- Method visitor.private void logUnexpectedMethod(java.lang.reflect.Method method)
method
- Unexpected method.