Search in sources :

Example 1 with SerializationFilterBase

use of com.intellij.util.xmlb.SerializationFilterBase in project intellij-community by JetBrains.

the class LoggerInitializedWithForeignClassInspectionBase method writeSettings.

@Override
public void writeSettings(@NotNull Element element) throws WriteExternalException {
    loggerClassName = formatString(loggerFactoryClassNames);
    loggerFactoryMethodName = formatString(loggerFactoryMethodNames);
    XmlSerializer.serializeInto(this, element, new SerializationFilterBase() {

        @Override
        protected boolean accepts(@NotNull Accessor accessor, @NotNull Object bean, @Nullable Object beanValue) {
            if ("loggerClassName".equals(accessor.getName()) && DEFAULT_LOGGER_CLASS_NAMES.equals(beanValue)) {
                return false;
            }
            if ("loggerFactoryMethodNames".equals(accessor.getName()) && DEFAULT_FACTORY_METHOD_NAMES.equals(beanValue)) {
                return false;
            }
            return true;
        }
    });
}
Also used : SerializationFilterBase(com.intellij.util.xmlb.SerializationFilterBase) Accessor(com.intellij.util.xmlb.Accessor)

Aggregations

Accessor (com.intellij.util.xmlb.Accessor)1 SerializationFilterBase (com.intellij.util.xmlb.SerializationFilterBase)1