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

How to use
CachingIntrospector
in
jodd.introspector

Best Java code snippets using jodd.introspector.CachingIntrospector (Showing top 5 results out of 315)

origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public ClassDescriptor register(Class type) {
  ClassDescriptor cd = describeClass(type);
  cache.put(type, cd);
  return cd;
}
origin: oblac/jodd

  @Test
  void testFieldPrefix2() {
    BeanUtilBean beanUtilBean = new BeanUtilBean();

    LifeBean lifeBean = new LifeBean();

    String bar = beanUtilBean.getProperty(lifeBean, "bar").toString();

    assertEquals("bar", bar);

    beanUtilBean.setIntrospector(new CachingIntrospector(true, true, true, new String[] {"_"}));

    bar = beanUtilBean.getProperty(lifeBean, "bar").toString();

    assertEquals("_bar", bar);
  }
}
origin: oblac/jodd

@Test
void testFieldPrefix1() {
  LifeBean lifeBean = new LifeBean();
  String foo = BeanUtil.pojo.getProperty(lifeBean, "foo").toString();
  assertEquals("foo", foo);
  ClassIntrospector.Implementation.set(new CachingIntrospector(true, true, true, new String[] {"_"}));
  foo = BeanUtil.pojo.getProperty(lifeBean, "foo").toString();
  assertEquals("foo", foo);
  ClassDescriptor cd = ClassIntrospector.get().lookup(LifeBean.class);
  PropertyDescriptor[] pds = cd.getAllPropertyDescriptors();
  assertEquals(3, pds.length);
  assertEquals("bar", pds[0].getName());
  assertEquals("_bar", pds[0].getFieldDescriptor().getName());
  assertEquals("www", pds[2].getName());
  assertEquals(null, pds[2].getFieldDescriptor());
  ClassIntrospector.Implementation.set(new CachingIntrospector());
}
origin: oblac/jodd

@Test
void testFieldPrefix1withEmpty() {
  LifeBean lifeBean = new LifeBean();
  String foo = BeanUtil.pojo.getProperty(lifeBean, "foo").toString();
  assertEquals("foo", foo);
  ClassIntrospector.Implementation.set(new CachingIntrospector(true, true, true, new String[] {"_", ""}));
  foo = BeanUtil.pojo.getProperty(lifeBean, "foo").toString();
  assertEquals("foo", foo);
  ClassDescriptor cd = ClassIntrospector.get().lookup(LifeBean.class);
  PropertyDescriptor[] pds = cd.getAllPropertyDescriptors();
  assertEquals(3, pds.length);
  assertEquals("bar", pds[0].getName());
  assertEquals("_bar", pds[0].getFieldDescriptor().getName());
  assertEquals("www", pds[2].getName());
  assertEquals("www", pds[2].getFieldDescriptor().getName());
  ClassIntrospector.Implementation.set(new CachingIntrospector());
}
origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public ClassDescriptor lookup(Class type) {
  ClassDescriptor cd = cache.get(type);
  if (cd != null) {
    cd.increaseUsageCount();
    return cd;
  }
  cd = describeClass(type);
  cache.put(type, cd);
  return cd;
}
jodd.introspectorCachingIntrospector

Javadoc

Default jodd.introspector.Introspector that caches all class descriptors. It can examine either accessible or supported fields/methods/constructors.

It simply caches all class descriptors.

Most used methods

  • <init>
    Creates new caching ClassIntrospector. It may scanaccessible or supported fields, methods or constr
  • describeClass
    Describes a class by creating a new instance of ClassDescriptorthat examines all accessible methods

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JButton (javax.swing)
  • Top Vim plugins
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