MCPcopy Create free account
hub / github.com/PCGen/pcgen / toString

Method toString

code/src/java/pcgen/io/PCGVer2Parser.java:5325–5342  ·  view source on GitHub ↗

Returns a string representation of the element. This string is written in XML format. @return An XML formatted string.

()

Source from the content-addressed store, hash-verified

5323 * @return An XML formatted string.
5324 */
5325 @Override
5326 public String toString()
5327 {
5328 //TODO:gorm - optimize StringBuilder size
5329 final StringBuilder buffer = new StringBuilder(1000);
5330 buffer.append('<').append(getName()).append('>').append(IOConstants.LINE_SEP);
5331 buffer.append("<text>").append(getText()) //$NON-NLS-1$
5332 .append("</text>").append(IOConstants.LINE_SEP); //$NON-NLS-1$
5333
5334 for (PCGElement child : getChildren())
5335 {
5336 buffer.append(child).append(IOConstants.LINE_SEP);
5337 }
5338
5339 buffer.append("</").append(getName()).append('>'); //$NON-NLS-1$
5340
5341 return buffer.toString();
5342 }
5343
5344 /**
5345 * Returns all the children of this element.

Callers

nothing calls this directly

Calls 5

getNameMethod · 0.95
getTextMethod · 0.95
getChildrenMethod · 0.95
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected