Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

AggregateConfigProvider.java 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (c) 2006-2017 DMDirc Developers
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  5. * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
  6. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
  7. * permit persons to whom the Software is furnished to do so, subject to the following conditions:
  8. *
  9. * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
  10. * Software.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  13. * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
  14. * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. */
  17. package com.dmdirc.config.provider;
  18. import com.dmdirc.config.binding.ConfigBinder;
  19. import java.util.List;
  20. import java.util.Set;
  21. /**
  22. * A configuration provider which aggregates an ordered list of other {@link ConfigProvider}s.
  23. *
  24. * Because this provider exposes settings from multiple independent sources, it cannot change any
  25. * settings as the scope of such changes may be unclear.
  26. */
  27. public interface AggregateConfigProvider extends ReadOnlyConfigProvider {
  28. /**
  29. * Adds a change listener for the specified domain.
  30. *
  31. * @param domain The domain to be monitored
  32. * @param listener The listener to register
  33. */
  34. void addChangeListener(String domain, ConfigChangeListener listener);
  35. /**
  36. * Adds a change listener for the specified domain and key.
  37. *
  38. * @param domain The domain of the option
  39. * @param key The option to be monitored
  40. * @param listener The listener to register
  41. */
  42. void addChangeListener(String domain, String key, ConfigChangeListener listener);
  43. /**
  44. * Returns the name of all domains known by this manager.
  45. *
  46. * @return A list of domains known to this manager
  47. */
  48. Set<String> getDomains();
  49. /**
  50. * Retrieves a list of sources for this config manager.
  51. *
  52. * @return This config manager's sources.
  53. */
  54. List<ConfigProvider> getSources();
  55. /**
  56. * Removes the specified listener for all domains and options.
  57. *
  58. * @param listener The listener to be removed
  59. */
  60. void removeListener(ConfigChangeListener listener);
  61. /**
  62. * Gets a binder that may be used to bind methods or fields in a class to configuration values
  63. * known by this provider. Bound values update automatically whenever the value in this provider
  64. * changes.
  65. *
  66. * @return A config binder for use with this provider.
  67. */
  68. ConfigBinder getBinder();
  69. }