1 19 20 package org.netbeans.modules.lexer.gen.util; 21 22 28 29 public class LexerGenUtilities { 30 31 34 public static void appendSpaces(StringBuffer sb, int spaceCount) { 35 while (--spaceCount >= 0) { 36 sb.append(' '); 37 } 38 } 39 40 44 public static String [] splitClassName(String classFullName) { 45 int lastDotIndex = classFullName.lastIndexOf('.'); 46 return new String [] { 47 (lastDotIndex >= 0) ? classFullName.substring(0, lastDotIndex) : "", classFullName.substring(lastDotIndex + 1) }; 50 } 51 52 56 public static String idToUpperCase(String s) { 57 return s.toUpperCase().replace('-', '_'); 58 } 59 60 64 public static String idToLowerCase(String s) { 65 return s.toLowerCase().replace('_', '-'); 66 } 67 68 71 public static String fromSource(String s) { 72 return LexerGenUtilitiesImpl.fromSource(s); 73 } 74 75 81 public static String toElementContent(String text) { 82 return LexerGenUtilitiesImpl.toElementContent(text); 83 } 84 85 } 86 | Popular Tags |