/** * Inserts total number of method's arguments. */ public static int argumentsCount() { throw new ProxettaException(); }
/** * Creates array of arguments values. It is more safely then to get one argument at time, since * the returned array has correct length. * Equals to: <code>new Object[] {arg1, arg2,...}</code> * @see #createArgumentsClassArray() * @see #argument(int) */ public static Object[] createArgumentsArray() { throw new ProxettaException(); }
/** * Inserts targets class annotation value. Inserts <code>null</code> * if annotation or element is missing. */ public static Object targetClassAnnotation(final String annotationClassName, final String element) { throw new ProxettaException(); }
/** * Inserts populated {@link jodd.proxetta.ProxyTargetInfo} instance. */ public static ProxyTargetInfo info() { throw new ProxettaException(); }
/** * Checks if target is not defined yet. */ private void assertTargetIsNotDefined() { if (targetInputStream != null) { throw new ProxettaException("Target already defined"); } }
/** * Inserts target class. */ public static Class targetClass() { throw new ProxettaException(); }
/** * Inserts target method name. Useful for reflection. */ public static String targetMethodName() { throw new ProxettaException(); }
/** * Assigns new value for an argument specified by 1-based index. */ public static void setArgument(final Object value, final int index) { throw new ProxettaException(); }
/** * Inserts proxy (i.e. target) instance. */ public static Object target() { throw new ProxettaException(); }
/** * Inserts target method signature, java alike, including the method name. * Useful for identifying the method, since it is unique for class. * @see #targetMethodDescription() */ public static String targetMethodSignature() { throw new ProxettaException(); }
/** * Inserts targets method annotation value. Inserts <code>null</code> * if annotation or element is missing. */ public static Object targetMethodAnnotation(final String annotationClassName, final String element) { throw new ProxettaException(); } /**
/** * Creates array of arguments types. Works correctly with <code>null</code> argument values. * Equals to: <code>new Class[] {Arg1Type.class, Arg2Type.class...}</code> * @see #createArgumentsArray() * @see #argumentType(int) */ public static Class[] createArgumentsClassArray() { throw new ProxettaException(); }
/** * Inserts return type of target method. <code>null</code> is used for void. */ public static Class returnType() { throw new ProxettaException(); }
/** * Inserts target method description, bytecode alike, <b>without</b> method name. * May be used for identifying the method. * @see #targetMethodSignature() */ public static String targetMethodDescription() { throw new ProxettaException(); }
/** * Checks if proxy is created and throws an exception if not. */ protected void assertProxyIsCreated() { if (destClassWriter == null) { throw new ProxettaException("Target not accepted yet!"); } }
/** * Inserts the invocation of target method and getting the invocation results. * Small types are converted to wrappers. If method is <code>void</code>, * <code>null</code> is used for return value. */ public static Object invoke() { throw new ProxettaException(); }
/** * Inserts type of method argument specified by 1-based index. * Works correctly with <code>null</code> argument values. * @see #createArgumentsClassArray() */ public static Class argumentType(final int index) { throw new ProxettaException(); }
/** * Inserts value of method argument specified by 1-based index. * @see #createArgumentsArray() */ public static Object argument(final int index) { throw new ProxettaException(); }
/** * Prepares return value. Must be used as last method call: * <pre> * ... * return ProxyTarget.returnValue(xxx); * </pre> * * Used when returning values in general case, when return type may * be either primitive or an object. Also, must be used when returning <code>null</code> * for primitives. */ public static Object returnValue(final Object value) { throw new ProxettaException(); }
/** * Returns argument index from the history. * <b>Must</b> POP value from the stack after the execution. */ protected int getArgumentIndex() { if (!isPrevious) { throw new ProxettaException("Unexpected previous instruction type used for setting argument index"); } int argIndex; switch (opcode) { case ICONST_0: argIndex = 0; break; case ICONST_1: argIndex = 1; break; case ICONST_2: argIndex = 2; break; case ICONST_3: argIndex = 3; break; case ICONST_4: argIndex = 4; break; case ICONST_5: argIndex = 5; break; case BIPUSH: case SIPUSH: argIndex = operand; break; default: throw new ProxettaException("Unexpected previous instruction used for setting argument index"); } return argIndex; }