ConverterInfo.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. *
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. *
  20. */
  21. using System;
  22. namespace log4net.Util
  23. {
  24. /// <summary>
  25. /// Wrapper class used to map converter names to converter types
  26. /// </summary>
  27. /// <remarks>
  28. /// <para>
  29. /// Pattern converter info class used during configuration by custom
  30. /// PatternString and PatternLayer converters.
  31. /// </para>
  32. /// </remarks>
  33. public sealed class ConverterInfo
  34. {
  35. private string m_name;
  36. private Type m_type;
  37. private readonly PropertiesDictionary properties = new PropertiesDictionary();
  38. /// <summary>
  39. /// default constructor
  40. /// </summary>
  41. public ConverterInfo()
  42. {
  43. }
  44. /// <summary>
  45. /// Gets or sets the name of the conversion pattern
  46. /// </summary>
  47. /// <remarks>
  48. /// <para>
  49. /// The name of the pattern in the format string
  50. /// </para>
  51. /// </remarks>
  52. public string Name
  53. {
  54. get { return m_name; }
  55. set { m_name = value; }
  56. }
  57. /// <summary>
  58. /// Gets or sets the type of the converter
  59. /// </summary>
  60. /// <remarks>
  61. /// <para>
  62. /// The value specified must extend the
  63. /// <see cref="PatternConverter"/> type.
  64. /// </para>
  65. /// </remarks>
  66. public Type Type
  67. {
  68. get { return m_type; }
  69. set { m_type = value; }
  70. }
  71. /// <summary>
  72. ///
  73. /// </summary>
  74. /// <param name="entry"></param>
  75. public void AddProperty(PropertyEntry entry)
  76. {
  77. properties[entry.Key] = entry.Value;
  78. }
  79. /// <summary>
  80. ///
  81. /// </summary>
  82. public PropertiesDictionary Properties
  83. {
  84. get { return properties; }
  85. }
  86. }
  87. }