Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/21/10 15:58:31 (15 years ago)
Author:
epitzer
Message:

Add EasyXmlGenerator for easier review of generated XML. (#1139)

Location:
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs

    r3742 r3935  
    4040  public class XmlGenerator : GeneratorBase<string> {
    4141
    42     private int depth;
    43     private int Depth {
     42    protected int depth;
     43    protected int Depth {
    4444      get {
    4545        return depth;
     
    5151    }
    5252
    53     private string prefix;
     53    protected string prefix;
    5454
    5555
     
    6161    }
    6262
    63     private enum NodeType { Start, End, Inline } ;
    64 
    65     private static void AddXmlTagContent(StringBuilder sb, string name, Dictionary<string, object> attributes) {
     63    protected enum NodeType { Start, End, Inline } ;
     64
     65    protected static void AddXmlTagContent(StringBuilder sb, string name, Dictionary<string, object> attributes) {
    6666      sb.Append(name);
    6767      foreach (var attribute in attributes) {
     
    7676    }
    7777
    78     private static void AddXmlStartTag(StringBuilder sb, string name, Dictionary<string, object> attributes) {
     78    protected static void AddXmlStartTag(StringBuilder sb, string name, Dictionary<string, object> attributes) {
    7979      sb.Append('<');
    8080      AddXmlTagContent(sb, name, attributes);
     
    8282    }
    8383
    84     private static void AddXmlInlineTag(StringBuilder sb, string name, Dictionary<string, object> attributes) {
     84    protected static void AddXmlInlineTag(StringBuilder sb, string name, Dictionary<string, object> attributes) {
    8585      sb.Append('<');
    8686      AddXmlTagContent(sb, name, attributes);
     
    8888    }
    8989
    90     private static void AddXmlEndTag(StringBuilder sb, string name) {
     90    protected static void AddXmlEndTag(StringBuilder sb, string name) {
    9191      sb.Append("</");
    9292      sb.Append(name);
     
    9494    }
    9595
    96     private string CreateNodeStart(string name, Dictionary<string, object> attributes) {
     96    protected string CreateNodeStart(string name, Dictionary<string, object> attributes) {
    9797      StringBuilder sb = new StringBuilder();
    9898      sb.Append(prefix);
     
    103103    }
    104104
    105     private string CreateNodeStart(string name) {
     105    protected string CreateNodeStart(string name) {
    106106      return CreateNodeStart(name, new Dictionary<string, object>());
    107107    }
    108108
    109     private string CreateNodeEnd(string name) {
     109    protected string CreateNodeEnd(string name) {
    110110      Depth -= 1;
    111111      StringBuilder sb = new StringBuilder();
     
    116116    }
    117117
    118     private string CreateNode(string name, Dictionary<string, object> attributes) {
     118    protected string CreateNode(string name, Dictionary<string, object> attributes) {
    119119      StringBuilder sb = new StringBuilder();
    120120      sb.Append(prefix);
     
    124124    }
    125125
    126     private string CreateNode(string name, Dictionary<string, object> attributes, string content) {
     126    protected string CreateNode(string name, Dictionary<string, object> attributes, string content) {
    127127      StringBuilder sb = new StringBuilder();
    128128      sb.Append(prefix);
     
    148148    }
    149149
    150     private void AddTypeInfo(int typeId, Dictionary<string, object> dict) {
     150    protected void AddTypeInfo(int typeId, Dictionary<string, object> dict) {
    151151      if (lastTypeToken != null) {
    152152        if (typeId == lastTypeToken.Id) {
     
    225225    }
    226226
    227     private TypeToken lastTypeToken;
     227    protected TypeToken lastTypeToken;
    228228    /// <summary>
    229229    /// Formats the specified token.
     
    236236    }
    237237
    238     private string FlushTypeToken() {
     238    protected string FlushTypeToken() {
    239239      if (lastTypeToken == null)
    240240        return "";
Note: See TracChangeset for help on using the changeset viewer.