public static String toFTLTopLevelIdentifierReference(String name) { return backslashEscapeIdentifier(name); }
public static String toFTLIdentifierReferenceAfterDot(String name) { return backslashEscapeIdentifier(name); }
public static String toFTLTopLevelTragetIdentifier(final String name) { char quotationType = 0; scanForQuotationType: for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); if (!(i == 0 ? StringUtil.isFTLIdentifierStart(c) : StringUtil.isFTLIdentifierPart(c)) && c != '@') { if ((quotationType == 0 || quotationType == '\\') && (c == '-' || c == '.' || c == ':')) { quotationType = '\\'; } else { quotationType = '"'; break scanForQuotationType; } } } switch (quotationType) { case 0: return name; case '"': return StringUtil.ftlQuote(name); case '\\': return backslashEscapeIdentifier(name); default: throw new BugException(); } }
public static String toFTLTopLevelIdentifierReference(String name) { return backslashEscapeIdentifier(name); }
public static String toFTLIdentifierReferenceAfterDot(String name) { return backslashEscapeIdentifier(name); }
public static String toFTLTopLevelIdentifierReference(String name) { return backslashEscapeIdentifier(name); }
public static String toFTLIdentifierReferenceAfterDot(String name) { return backslashEscapeIdentifier(name); }
public static String toFTLTopLevelTragetIdentifier(final String name) { char quotationType = 0; scanForQuotationType: for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); if (!(i == 0 ? StringUtil.isFTLIdentifierStart(c) : StringUtil.isFTLIdentifierPart(c)) && c != '@') { if ((quotationType == 0 || quotationType == '\\') && (c == '-' || c == '.' || c == ':')) { quotationType = '\\'; } else { quotationType = '"'; break scanForQuotationType; } } } switch (quotationType) { case 0: return name; case '"': return StringUtil.ftlQuote(name); case '\\': return backslashEscapeIdentifier(name); default: throw new BugException(); } }
public static String toFTLTopLevelTragetIdentifier(final String name) { char quotationType = 0; scanForQuotationType: for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); if (!(i == 0 ? StringUtil.isFTLIdentifierStart(c) : StringUtil.isFTLIdentifierPart(c)) && c != '@') { if ((quotationType == 0 || quotationType == '\\') && (c == '-' || c == '.' || c == ':')) { quotationType = '\\'; } else { quotationType = '"'; break scanForQuotationType; } } } switch (quotationType) { case 0: return name; case '"': return StringUtil.ftlQuote(name); case '\\': return backslashEscapeIdentifier(name); default: throw new BugException(); } }