congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
jodd.proxetta
Code IndexAdd Tabnine to your IDE (free)

How to use jodd.proxetta

Best Java code snippets using jodd.proxetta (Showing top 20 results out of 315)

origin: oblac/jodd

/**
 * Validates argument index.
 */
public static void checkArgumentIndex(final MethodInfo methodInfo, final int argIndex) {
  if ((argIndex < 1) || (argIndex > methodInfo.getArgumentsCount())) {
    throw new ProxettaException("Invalid argument index: " + argIndex);
  }
}
origin: oblac/jodd

/**
 * Returns <code>true</code> if method has a return type.
 */
default boolean hasReturnValue() {
  return getReturnType().getOpcode() != AsmUtil.TYPE_VOID;
}
origin: oblac/jodd

/**
 * Visits replacement code for {@link ProxyTarget#targetMethodAnnotation(String, String)}.
 */
public static void targetMethodAnnotation(final MethodVisitor mv, final MethodInfo methodInfo, final String[] args) {
  AnnotationInfo[] anns = methodInfo.getAnnotations();
  if (anns != null) {
    targetAnnotation(mv, anns, args);
  }
}
origin: oblac/jodd

@Test
void testMethodSignature10() throws IOException {
  MethodInfo msv = getMethodSignatureForSingleMethod(M10.class);
  assertEquals(2, msv.getArgumentsCount());
  assertEquals(0, msv.getArgument(1).getAnnotations().length);
  assertEquals(1, msv.getArgument(2).getAnnotations().length);
  assertEquals("jodd.proxetta.fixtures.data.FooAnn", msv.getArgument(2).getAnnotations()[0].getAnnotationClassname());
  assertEquals("macka", msv.getMethodName());
  assertEquals(1, msv.getAnnotations().length);
  assertEquals("jodd.proxetta.fixtures.data.FooAnn", msv.getAnnotations()[0].getAnnotationClassname());
}
origin: oblac/jodd

  @Override
  public boolean apply(final MethodInfo methodInfo) {
    return
        methodInfo.isPublicMethod()
        && methodInfo.matchMethodName("set*")
        && methodInfo.hasOneArgument()
        ;
  }
}
origin: oblac/jodd

/**
 * Inserts total number of method's arguments.
 */
public static int argumentsCount() {
  throw new ProxettaException();
}
origin: oblac/jodd

/**
 * Defines class or interface to wrap.
 * For setting the interface of the resulting class,
 * use {@link #setTargetInterface(Class)}.
 */
@Override
public WrapperProxettaFactory setTarget(final Class target) {
  super.setTarget(target);
  this.targetClassOrInterface = target;
  return this;
}
origin: oblac/jodd

/**
 * Returns <code>true</code> if method has no argument.
 */
default boolean hasNoArguments() {
  return getArgumentsCount() == 0;
}
origin: oblac/jodd

  public Object execute() throws Exception {
    Object returnValue = null;

    if (returnValue != null) {
      returnValue = "1";
    }
    return ProxyTarget.returnValue(returnValue);
  }
}
origin: oblac/jodd

/**
 * Performs AND operation on this and the next proxy.
 */
default ProxyPointcut and(final ProxyPointcut otherProxyPointcut) {
  return (t) -> apply(t) && otherProxyPointcut.apply(t);
}
origin: oblac/jodd

/**
 * Sets variable proxy class name so every time when new proxy class is created
 * its name will be different,so one classloader may load it without a problem.
 * Otherwise, sets constant proxy class name so each time created proxy
 * class will have the same name. Such class can be loaded only once by a classloader.
 * <p>
 * This prevents "<code>java.lang.LinkageError: duplicate class definition</code>" errors.
 */
public T setVariableClassName(final boolean variableClassName) {
  this.variableClassName = variableClassName;
  return _this();
}
origin: oblac/jodd

/**
 * Returns proxy class name.
 */
public String getProxyClassName() {
  assertProxyIsCreated();
  return proxyClassName;
}
origin: oblac/jodd

/**
 * Returns <code>true</code> if method's return type is <code>void</code>.
 */
default boolean hasNoReturnValue() {
  return getReturnType().getOpcode() == AsmUtil.TYPE_VOID;
}
origin: oblac/jodd

/**
 * 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();
}
origin: oblac/jodd

/**
 * Delegates to aspects pointcut.
 */
boolean apply(final MethodInfo msign) {
  return pointcut.apply(msign);
}
origin: oblac/jodd

/**
 * Specifies custom classname suffix to be added to the class name of created proxy.
 * Warning: when class name suffix is not used, full classname has to be
 * specified that differs from target class name.
 */
public T setClassNameSuffix(final String suffix) {
  this.classNameSuffix = suffix;
  return _this();
}
origin: oblac/jodd

/**
 * 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();
}
origin: oblac/jodd

/**
 * Specifies classloaders for loading created classes.
 * If classloader not specified, default one will be used.
 */
public T setClassLoader(final ClassLoader classLoader) {
  this.classLoader = classLoader;
  return _this();
}
origin: oblac/jodd

/**
 * Inserts populated {@link jodd.proxetta.ProxyTargetInfo} instance.
 */
public static ProxyTargetInfo info() {
  throw new ProxettaException();
}
origin: oblac/jodd

/**
 * Checks if target is not defined yet.
 */
private void assertTargetIsNotDefined() {
  if (targetInputStream != null) {
    throw new ProxettaException("Target already defined");
  }
}
jodd.proxetta

Most used classes

  • Proxetta
    Proxetta creates dynamic proxy classes in the run-time. To wrap a class with proxy Proxetta needs a
  • ProxyTarget
    Marker class for ProxyAdvice implementations.
  • ProxyAspect
    Proxy aspect contains advice and pointcut rules for applying advice.
  • ProxyProxetta
    Proxetta that creates proxies.
  • MethodInfo
    Method info provides various information about the method. Used in jodd.proxetta.ProxyPointcut defin
  • ProxyPointcut,
  • WrapperProxetta,
  • MethodWithAnnotationPointcut,
  • ProxettaException,
  • ProxettaUtil,
  • TypeInfo,
  • ProxettaAsmUtil,
  • ProxyProxettaFactory,
  • WrapperProxettaFactory,
  • AnnotationInfo,
  • ClassInfo,
  • InvokeInfo,
  • InvokeReplacer,
  • MethodSignatureVisitor
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now