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

Method replaceSubToken

code/src/java/pcgen/io/ExportHandler.java:1758–1781  ·  view source on GitHub ↗

Helper method, deals with replacing the SUB token @param tokenString the SUB token @return The altered SUB token

(String tokenString)

Source from the content-addressed store, hash-verified

1756 * @return The altered SUB token
1757 */
1758 private String replaceSubToken(String tokenString)
1759 {
1760 int iEnd = tokenString.indexOf('.');
1761 int maxLength;
1762
1763 try
1764 {
1765 maxLength = Integer.parseInt(tokenString.substring(3, iEnd));
1766 }
1767 catch (NumberFormatException ex)
1768 {
1769 // Hmm, no number?
1770 Logging.errorPrint("Number format error: " + tokenString);
1771 maxLength = -1;
1772 }
1773
1774 if (maxLength > 0)
1775 {
1776 tokenString = tokenString.substring(iEnd + 1);
1777 FileAccess.maxLength(maxLength);
1778 }
1779
1780 return tokenString;
1781 }
1782
1783 /**
1784 * Helper method that deals with Processing the FOR./DFOR. tokens as a

Callers 1

replaceTokenMethod · 0.95

Calls 4

errorPrintMethod · 0.95
maxLengthMethod · 0.95
parseIntMethod · 0.80
indexOfMethod · 0.65

Tested by

no test coverage detected