@Test public void testDefaultBehaviour() { SubClassSupportInstanceInitializer initializer = SubClassSupportInstanceInitializer.INSTANCE; WithoutInIndex withoutInIndex = new WithoutInIndex(); assertEquals( WithoutInIndex.class, initializer.getClass( withoutInIndex ) ); }
@SuppressWarnings("unchecked") public <T> Class<T> getClass(T entity) { Class<T> clazz = (Class<T>) entity.getClass(); if ( !clazz.isAnnotationPresent( InIndex.class ) ) { while ( (clazz = (Class<T>) clazz.getSuperclass()) != null ) { if ( clazz.isAnnotationPresent( InIndex.class ) ) { break; } } } if ( clazz != null ) { return clazz; } return this.initializer.getClass( entity ); }
SubClassSupportInstanceInitializer implements InstanceInitializer { @SuppressWarnings("unchecked") public <T> Class<T> getClass(T entity) { Class<T> clazz = (Class<T>) entity.getClass(); if ( !clazz.isAnnotationPresent( InIndex.class ) ) { while ( (clazz = (Class<T>) clazz.getSuperclass()) != null ) { if ( clazz.isAnnotationPresent( InIndex.class ) ) { break; } } } if ( clazz != null ) { return clazz; } return this.initializer.getClass( entity ); } }
SubClassSupportInstanceInitializer implements InstanceInitializer { @SuppressWarnings("unchecked") public <T> Class<T> getClass(T entity) { Class<T> clazz = (Class<T>) entity.getClass(); if ( !clazz.isAnnotationPresent( InIndex.class ) ) { while ( (clazz = (Class<T>) clazz.getSuperclass()) != null ) { if ( clazz.isAnnotationPresent( InIndex.class ) ) { break; } } } if ( clazz != null ) { return clazz; } return this.initializer.getClass( entity ); } private  SubClassSupportInstanceInitializer(); }
SubClassSupportInstanceInitializer implements InstanceInitializer { @SuppressWarnings("unchecked") public <T> Class<T> getClass(T entity) { Class<T> clazz = (Class<T>) entity.getClass(); if ( !clazz.isAnnotationPresent( InIndex.class ) ) { while ( (clazz = (Class<T>) clazz.getSuperclass()) != null ) { if ( clazz.isAnnotationPresent( InIndex.class ) ) { break; } } } if ( clazz != null ) { return clazz; } return this.initializer.getClass( entity ); } private  SubClassSupportInstanceInitializer(); Object unproxy(Object entity); Class<?> getClassFromWork(Work work); @SuppressWarnings("unchecked") Class<T> getClass(T entity); Collection<T> initializeCollection(Collection<T> value); Map<K, V> initializeMap(Map<K, V> value); Object[] initializeArray(Object[] value); }
SubClassSupportInstanceInitializer implements InstanceInitializer { @SuppressWarnings("unchecked") public <T> Class<T> getClass(T entity) { Class<T> clazz = (Class<T>) entity.getClass(); if ( !clazz.isAnnotationPresent( InIndex.class ) ) { while ( (clazz = (Class<T>) clazz.getSuperclass()) != null ) { if ( clazz.isAnnotationPresent( InIndex.class ) ) { break; } } } if ( clazz != null ) { return clazz; } return this.initializer.getClass( entity ); } private  SubClassSupportInstanceInitializer(); Object unproxy(Object entity); Class<?> getClassFromWork(Work work); @SuppressWarnings("unchecked") Class<T> getClass(T entity); Collection<T> initializeCollection(Collection<T> value); Map<K, V> initializeMap(Map<K, V> value); Object[] initializeArray(Object[] value); static SubClassSupportInstanceInitializer INSTANCE; }