• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

evolvedbinary / j8xu / 16

02 May 2024 01:02PM UTC coverage: 93.082%. First build
16

push

circleci

adamretter
[feature] Initial version of a String implementation of the XML Builder API

142 of 153 new or added lines in 9 files covered. (92.81%)

148 of 159 relevant lines covered (93.08%)

0.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/evolvedbinary/j8xu/builder/impl/string/StringXmlDocumentBuilder.java
1
/*
2
 * Copyright © 2024, Evolved Binary Ltd. <tech@evolvedbinary.com>
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *     * Redistributions of source code must retain the above copyright
8
 *       notice, this list of conditions and the following disclaimer.
9
 *     * Redistributions in binary form must reproduce the above copyright
10
 *       notice, this list of conditions and the following disclaimer in the
11
 *       documentation and/or other materials provided with the distribution.
12
 *     * Neither the name of the <organization> nor the
13
 *       names of its contributors may be used to endorse or promote products
14
 *       derived from this software without specific prior written permission.
15
 *
16
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
 * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
20
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 */
27
package com.evolvedbinary.j8xu.builder.impl.string;
28

29
import com.evolvedbinary.j8xu.builder.api.XmlChildNodeBuilder;
30
import com.evolvedbinary.j8xu.builder.api.XmlDocumentBuilder;
31

32
public class StringXmlDocumentBuilder implements XmlDocumentBuilder<String> {
33
  private final StringContext context;
34
  private final XmlChildNodeBuilder<String>[] children;
35

NEW
36
  StringXmlDocumentBuilder(final StringContext context, final XmlChildNodeBuilder<String>[] children) {
×
NEW
37
    this.context = context;
×
NEW
38
    this.children = children;
×
NEW
39
  }
×
40

41
  @Override
42
  public String build() {
NEW
43
    final StringBuilder buffer = new StringBuilder();
×
NEW
44
    for (final XmlChildNodeBuilder child : children) {
×
NEW
45
      buffer.append(child.build()); // TODO(AR) indent and ws
×
46
    }
NEW
47
    return buffer.toString();
×
48
  }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc