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

Method getPCCText

code/src/java/pcgen/cdom/helper/Aspect.java:293–330  ·  view source on GitHub ↗

Gets the Aspect tag in PCC format. @return A String in LST file format for this description.

()

Source from the content-addressed store, hash-verified

291 *
292 */
293 public String getPCCText()
294 {
295 final StringBuilder buf = new StringBuilder();
296
297 for (final String str : theComponents)
298 {
299 if (str.startsWith(VAR_MARKER))
300 {
301 final int ind = Integer.parseInt(str.substring(VAR_MARKER.length()));
302 buf.append('%').append(ind);
303 }
304 else if (str.equals("%"))
305 {
306 //reescape
307 buf.append("%%");
308 }
309 else
310 {
311 buf.append(EntityEncoder.encode(str));
312 }
313 }
314 if (theVariables != null)
315 {
316 for (final String var : theVariables)
317 {
318 buf.append(Constants.PIPE);
319 buf.append(var);
320 }
321 }
322
323 if (hasPrerequisites())
324 {
325 buf.append(Constants.PIPE);
326 buf.append(new PrerequisiteWriter().getPrerequisiteString(getPrerequisiteList(), Constants.PIPE));
327 }
328
329 return buf.toString();
330 }
331
332 @Override
333 public String toString()

Callers 1

toStringMethod · 0.95

Calls 8

encodeMethod · 0.95
parseIntMethod · 0.80
equalsMethod · 0.65
hasPrerequisitesMethod · 0.65
getPrerequisiteStringMethod · 0.65
getPrerequisiteListMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected