Tabnine Logo
ClassInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
ClassInfo
in
jodd.proxetta

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

origin: oblac/jodd

/**
 * Finds annotation in class info. Returns <code>null</code> if annotation doesn't exist.
 */
default AnnotationInfo getAnnotation(final Class<? extends Annotation> an) {
  AnnotationInfo[] anns = getAnnotations();
  if (anns == null) {
    return null;
  }
  String anName = an.getName();
  for (AnnotationInfo ann : anns) {
    if (ann.getAnnotationClassname().equals(anName)) {
      return ann;
    }
  }
  return null;
}
origin: oblac/jodd

/**
 * Visits replacement code for {@link ProxyTarget#targetClass()}.
 */
public static void targetClass(final MethodVisitor mv, final MethodInfo methodInfo) {
  ClassInfo classInfo = methodInfo.getClassInfo();
  mv.visitLdcInsn(Type.getType('L' + classInfo.getReference() + ';'));
}
origin: oblac/jodd

firstTime.value = false;
ClassInfo ci = mi.getClassInfo();
assertEquals("BigFatJoe", ci.getClassname());
assertEquals(BigFatJoe.class.getPackage().getName(), ci.getPackage());
assertEquals("jodd/proxetta/fixtures/data/BigFatJoe", ci.getReference());
assertEquals("jodd/proxetta/fixtures/data/SmallSkinnyZoe", ci.getSuperName());
AnnotationInfo[] anns = ci.getAnnotations();
assertNotNull(anns);
assertEquals(3, anns.length);
AnnotationInfo ai = anns[0];
assertSame(ai, ci.getAnnotation(MadvocAction.class));
assertEquals(MadvocAction.class.getName(), ai.getAnnotationClassname());
assertEquals("L" + MadvocAction.class.getName().replace('.', '/') + ";", ai.getAnnotationSignature());
assertEquals("madvocAction", ai.getElement("value"));
ai = anns[1];
assertSame(ai, ci.getAnnotation(PetiteBean.class));
assertEquals(PetiteBean.class.getName(), ai.getAnnotationClassname());
assertEquals("L" + PetiteBean.class.getName().replace('.', '/') + ";", ai.getAnnotationSignature());
ai = anns[2];
assertSame(ai, ci.getAnnotation(InterceptedBy.class));
assertEquals(InterceptedBy.class.getName(), ai.getAnnotationClassname());
assertEquals("L" + InterceptedBy.class.getName().replace('.', '/') + ";", ai.getAnnotationSignature());
origin: oblac/jodd

/**
 * Returns <code>true</code> if class is annotated with one of provided annotation.
 */
default boolean hasAnnotation(final Class<? extends Annotation>... an) {
  AnnotationInfo[] anns = getAnnotations();
  if (anns == null) {
    return false;
  }
  for (Class<? extends Annotation> annotationClass : an) {
    String anName = annotationClass.getName();
    for (AnnotationInfo ann : anns) {
      if (ann.getAnnotationClassname().equals(anName)) {
        return true;
      }
    }
  }
  return false;
}
origin: org.jodd/jodd-proxetta

/**
 * Visits replacement code for {@link ProxyTarget#targetClass()}.
 */
public static void targetClass(final MethodVisitor mv, final MethodInfo methodInfo) {
  ClassInfo classInfo = methodInfo.getClassInfo();
  mv.visitLdcInsn(Type.getType('L' + classInfo.getReference() + ';'));
}
origin: oblac/jodd

/**
 * Visits replacement code for {@link ProxyTarget#targetClassAnnotation(String, String)}.
 */
public static void targetClassAnnotation(final MethodVisitor mv, final ClassInfo classInfo, final String[] args) {
  AnnotationInfo[] anns = classInfo.getAnnotations();
  if (anns != null) {
    targetAnnotation(mv, anns, args);
  } else {
    mv.visitInsn(Opcodes.ACONST_NULL);
  }
}
origin: org.jodd/jodd-proxetta

/**
 * Finds annotation in class info. Returns <code>null</code> if annotation doesn't exist.
 */
default AnnotationInfo getAnnotation(final Class<? extends Annotation> an) {
  AnnotationInfo[] anns = getAnnotations();
  if (anns == null) {
    return null;
  }
  String anName = an.getName();
  for (AnnotationInfo ann : anns) {
    if (ann.getAnnotationClassname().equals(anName)) {
      return ann;
    }
  }
  return null;
}
origin: org.jodd/jodd-wot

/**
 * Finds annotation in class info. Returns <code>null</code> if annotation doesn't exist.
 */
public AnnotationInfo getAnnotation(ClassInfo classInfo, Class<? extends Annotation> an) {
  AnnotationInfo[] anns = classInfo.getAnnotations();
  if (anns == null) {
    return null;
  }
  String anName = an.getName();
  for (AnnotationInfo ann : anns) {
    if (ann.getAnnotationClassname().equals(anName)) {
      return ann;
    }
  }
  return null;
}
origin: org.jodd/jodd-wot

/**
 * Returns <code>true</code> if class is annotated with one of provided annotation.
 */
public boolean hasAnnotation(ClassInfo classInfo, Class<? extends Annotation>... an) {
  AnnotationInfo[] anns = classInfo.getAnnotations();
  if (anns == null) {
    return false;
  }
  for (Class<? extends Annotation> annotationClass : an) {
    String anName = annotationClass.getName();
    for (AnnotationInfo ann : anns) {
      if (ann.getAnnotationClassname().equals(anName)) {
        return true;
      }
    }
  }
  return false;
}
origin: org.jodd/jodd-proxetta

/**
 * Returns <code>true</code> if class is annotated with one of provided annotation.
 */
default boolean hasAnnotation(final Class<? extends Annotation>... an) {
  AnnotationInfo[] anns = getAnnotations();
  if (anns == null) {
    return false;
  }
  for (Class<? extends Annotation> annotationClass : an) {
    String anName = annotationClass.getName();
    for (AnnotationInfo ann : anns) {
      if (ann.getAnnotationClassname().equals(anName)) {
        return true;
      }
    }
  }
  return false;
}
origin: org.jodd/jodd-proxetta

/**
 * Visits replacement code for {@link ProxyTarget#targetClassAnnotation(String, String)}.
 */
public static void targetClassAnnotation(final MethodVisitor mv, final ClassInfo classInfo, final String[] args) {
  AnnotationInfo[] anns = classInfo.getAnnotations();
  if (anns != null) {
    targetAnnotation(mv, anns, args);
  } else {
    mv.visitInsn(Opcodes.ACONST_NULL);
  }
}
jodd.proxettaClassInfo

Javadoc

Various target class information.

Most used methods

  • getAnnotations
    Returns annotation information or null if target class has no annotations.
  • getReference
    Returns class reference.
  • getAnnotation
    Finds annotation in class info. Returns null if annotation doesn't exist.
  • getClassname
    Returns simple class name.
  • getPackage
    Returns package name.
  • getSuperName
    Returns super class reference.

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • setScale (BigDecimal)
  • getSharedPreferences (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • String (java.lang)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • JList (javax.swing)
  • Github Copilot alternatives
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