---
title: "@IgnoreVisibility"
---

`@IgnoreVisiblity` tells the serializer that it should not ignore non-public fields. It will attempt to access widen private, protected, etc. fields while performing de/serialization.

<Callout variant="info">
This can also be used on a <code>ConfigSection</code>, or a class wrapped by a <code>ValidatedAny</code>, to enable the class type to be less-than-public.
</Callout>

<CodeTabs>

```java !!tabs Java
@IgnoreVisibility
public class ConfigImpl extends Config {
    public ConfigImpl {
        super(new Identifier("example", "config"));
    }

    private int myPrivateField = 0;

    @IgnoreVisibility
    private static class SecretBit { /* stuff goes here */ }

    // this ValidatedAny will work, thanks to the IgnoreVisibility on the SecretBit class. Otherwise the class would have to be public.
    // note that the IgnoreVisiblity of the SecretBit is not responsible for the mySecretBit visibiltity; that is handled by the ConfigImpl annotation
    private ValidatedAny<SecretBit> mySecretBit = new ValidatedAny(new SecretBit());
}
```

```kotlin !!tabs Kotlin
@IgnoreVisibility
class ConfigImpl: Config(Identifier.of("example", "config")) {
    
    private var myPrivateProperty = 0

    @IgnoreVisibility
    private class SecretBit { /* stuff goes here */ }

    // this ValidatedAny will work, thanks to the IgnoreVisibility on the SecretBit class. Otherwise the class would have to be public.
    // note that the IgnoreVisiblity of the SecretBit is not responsible for the mySecretBit visibiltity; that is handled by the ConfigImpl annotation
    private var mySecretBit = ValidatedAny(SecretBit())
}
```

</CodeTabs>

<Callout>
See the documentation page <a target="_blank" rel="noopener" href="https://fzzyhmstrs.github.io/fconfig/-fzzy%20-config/me.fzzyhmstrs.fzzy_config.annotations/-ignore-visibility/index.html">here 🗗</a>
</Callout>