@Nullable @Override public Element getState() { CodeStyleScheme currentScheme = getCurrentScheme(); CURRENT_SCHEME_NAME = currentScheme == null ? null : currentScheme.getName(); return XmlSerializer.serialize(this, new SerializationFilter() { @Override public boolean accepts(@NotNull Accessor accessor, @NotNull Object bean) { if ("CURRENT_SCHEME_NAME".equals(accessor.getName())) { return !DEFAULT_SCHEME_NAME.equals(accessor.read(bean)); } else { return accessor.getValueClass().equals(String.class); } } }); }
@Override public void saveContext(Element toElement) throws WriteExternalException { XDebuggerWatchesManager.WatchesManagerState state = myWatchesManager.getState(); Element serialize = XmlSerializer.serialize(state, new SerializationFilter() { @Override public boolean accepts(@NotNull Accessor accessor, @NotNull Object bean) { return accessor.read(bean) != null; } }); toElement.addContent(serialize.removeContent()); }
@Override public void saveContext(Element toElement) throws WriteExternalException { XBreakpointManagerImpl.BreakpointManagerState state = myBreakpointManager.getState(); Element serialize = XmlSerializer.serialize(state, new SerializationFilter() { @Override public boolean accepts(@NotNull Accessor accessor, @NotNull Object bean) { return accessor.read(bean) != null; } }); toElement.addContent(serialize.removeContent()); }
@Nullable @Override public Element getState() { return XmlSerializer.serialize(this, new SerializationFilter() { @Override public boolean accepts(Accessor accessor, Object bean) { return accessor.getValueClass().equals(String.class); } }); }
@Override public void saveContext(Element toElement) throws WriteExternalException { XBreakpointManagerImpl.BreakpointManagerState state = myBreakpointManager.getState(); Element serialize = XmlSerializer.serialize(state, new SerializationFilter() { @Override public boolean accepts(Accessor accessor, Object bean) { return accessor.read(bean) != null; } }); toElement.addContent(serialize.removeContent()); }
@Nullable @Override public Element getState() { return XmlSerializer.serialize(this, new SerializationFilter() { @Override public boolean accepts(@Nonnull Accessor accessor, Object bean) { return accessor.getValueClass().equals(String.class); } }); }
/** * Returns filter used to omit default values on saving inspection settings. * Default implementation uses SkipDefaultValuesSerializationFilters. * * @return serialization filter. */ @SuppressWarnings("MethodMayBeStatic") @Nullable protected SerializationFilter getSerializationFilter() { return DEFAULT_FILTER; }