/** * Tells if this instance acts like if its class introspection cache is sharable with other {@link BeansWrapper}-s. * A restricted cache denies certain too "antisocial" operations, like {@link #clearClassIntrospecitonCache()}. * The value depends on how the instance * was created; with a public constructor (then this is {@code false}), or with {@link BeansWrapperBuilder} * (then it's {@code true}). Note that in the last case it's possible that the introspection cache * will not be actually shared because there's no one to share with, but this will {@code true} even then. * * @since 2.3.21 */ public boolean isClassIntrospectionCacheRestricted() { return classIntrospector.getHasSharedInstanceRestrictons(); }
/** * Corresponds to {@link BeansWrapper#clearClassIntrospecitonCache()}. * * @since 2.3.20 */ void clearCache() { if (getHasSharedInstanceRestrictons()) { throw new IllegalStateException( "It's not allowed to clear the whole cache in a read-only " + this.getClass().getName() + "instance. Use removeFromClassIntrospectionCache(String prefix) instead."); } forcedClearCache(); }
/** * Tells if this instance acts like if its class introspection cache is sharable with other {@link BeansWrapper}-s. * A restricted cache denies certain too "antisocial" operations, like {@link #clearClassIntrospecitonCache()}. * The value depends on how the instance * was created; with a public constructor (then this is {@code false}), or with {@link BeansWrapperBuilder} * (then it's {@code true}). Note that in the last case it's possible that the introspection cache * will not be actually shared because there's no one to share with, but this will {@code true} even then. * * @since 2.3.21 */ public boolean isClassIntrospectionCacheRestricted() { return classIntrospector.getHasSharedInstanceRestrictons(); }
/** * Tells if this instance acts like if its class introspection cache is sharable with other {@link BeansWrapper}-s. * A restricted cache denies certain too "antisocial" operations, like {@link #clearClassIntrospecitonCache()}. * The value depends on how the instance * was created; with a public constructor (then this is {@code false}), or with {@link BeansWrapperBuilder} * (then it's {@code true}). Note that in the last case it's possible that the introspection cache * will not be actually shared because there's no one to share with, but this will {@code true} even then. * * @since 2.3.21 */ public boolean isClassIntrospectionCacheRestricted() { return classIntrospector.getHasSharedInstanceRestrictons(); }
/** * Corresponds to {@link BeansWrapper#clearClassIntrospecitonCache()}. * * @since 2.3.20 */ void clearCache() { if (getHasSharedInstanceRestrictons()) { throw new IllegalStateException( "It's not allowed to clear the whole cache in a read-only " + this.getClass().getName() + "instance. Use removeFromClassIntrospectionCache(String prefix) instead."); } forcedClearCache(); }
/** * Corresponds to {@link BeansWrapper#clearClassIntrospecitonCache()}. * * @since 2.3.20 */ void clearCache() { if (getHasSharedInstanceRestrictons()) { throw new IllegalStateException( "It's not allowed to clear the whole cache in a read-only " + this.getClass().getName() + "instance. Use removeFromClassIntrospectionCache(String prefix) instead."); } forcedClearCache(); }