public AssetDescriptor (String fileName, Class<T> assetType, AssetLoaderParameters<T> params) { this.fileName = fileName.replaceAll("\\\\", "/"); this.type = assetType; this.params = params; }
public AssetDescriptor (String fileName, Class<T> assetType, AssetLoaderParameters<T> params) { this.fileName = fileName.replaceAll("\\\\", "/"); this.type = assetType; this.params = params; }
static String splitCamelCase(String s) { return s.replaceAll( String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])", "(?<=[A-Za-z])(?=[^A-Za-z])" ), " " ); }
/** * 驼峰转下划线(简单写法,效率低于{@link #humpToLine(String)}) * @param str * @return */ public static String humpToLine2(String str) { return str.replaceAll("[A-Z]", "_$0").toLowerCase(); }
private static String normalize(String value) { return value.toLowerCase(Locale.US).replaceAll("[^a-z0-9]+", ""); }
String[] tests = { " x ", // [x] " 1 2 3 ", // [1 2 3] "", // [] " ", // [] }; for (String test : tests) { System.out.format("[%s]%n", test.replaceAll("^ +| +$|( )+", "$1") ); }
public void output(StringBuffer buf) { if ((this.text == null) || (this.text.length() == 0)) { buf.append("NULL"); return; } buf.append("N'"); buf.append(this.text.replaceAll("'", "''")); buf.append("'"); }
@Override public String apply(String value) { return value.replaceAll("[\\r\\n]", ""); } });
/** * This is used to convert a configuration nodePath into a key * TODO doc * * @param path * @return key (nodePath less the config root path) */ private String pathToKey(String path) { if (StringUtils.isEmpty(path)) { return path; } return path.replace(rootPath + "/", "").replaceAll("/", "."); } }
/** * This is used to convert a configuration nodePath into a key * TODO doc * * @param path * @return key (nodePath less the config root path) */ private String pathToKey(String path) { if (StringUtils.isEmpty(path)) { return path; } return path.replace(rootPath + "/", "").replaceAll("/", "."); } }
/** Creates an AssetDescriptor with an already resolved name. */ public AssetDescriptor (FileHandle file, Class<T> assetType, AssetLoaderParameters<T> params) { this.fileName = file.path().replaceAll("\\\\", "/"); this.file = file; this.type = assetType; this.params = params; }
/** Creates an AssetDescriptor with an already resolved name. */ public AssetDescriptor (FileHandle file, Class<T> assetType, AssetLoaderParameters<T> params) { this.fileName = file.path().replaceAll("\\\\", "/"); this.file = file; this.type = assetType; this.params = params; }
private static String sanitizeName(RType rType, AaptResourceCollector resourceCollector, String rawName) { String sanitizeName = rawName.replaceAll("[.:]", "_"); resourceCollector.putSanitizeName(rType, sanitizeName, rawName); return sanitizeName; }
public String resolve(String name) { final String value = original.resolve(name); if (value == null) return null; // Substitute one backslash with two return value.replaceAll("\\\\", "\\\\\\\\"); } };
private static boolean isOsx0() { String osname = SystemPropertyUtil.get("os.name", "").toLowerCase(Locale.US) .replaceAll("[^a-z0-9]+", ""); boolean osx = osname.startsWith("macosx") || osname.startsWith("osx"); if (osx) { logger.debug("Platform: MacOS"); } return osx; }
protected void printChars(String text) { if (text == null) { print0(ucase ? "NULL" : "null"); } else { print('\''); int index = text.indexOf('\''); if (index >= 0) { text = text.replaceAll("'", "''"); } print0(text); print('\''); } }
@Override public TextureAtlas load (AssetManager assetManager, String fileName, FileHandle file, TextureAtlasParameter parameter) { for (Page page : data.getPages()) { Texture texture = assetManager.get(page.textureFile.path().replaceAll("\\\\", "/"), Texture.class); page.texture = texture; } TextureAtlas atlas = new TextureAtlas(data); data = null; return atlas; }
@Override public TextureAtlas load (AssetManager assetManager, String fileName, FileHandle file, TextureAtlasParameter parameter) { for (Page page : data.getPages()) { Texture texture = assetManager.get(page.textureFile.path().replaceAll("\\\\", "/"), Texture.class); page.texture = texture; } TextureAtlas atlas = new TextureAtlas(data); data = null; return atlas; }
public void testToString() { for (String inputName : SOMEWHERE_UNDER_PS) { InternetDomainName domain = InternetDomainName.from(inputName); /* * We would ordinarily use constants for the expected results, but * doing it by derivation allows us to reuse the test case definitions * used in other tests. */ String expectedName = Ascii.toLowerCase(inputName); expectedName = expectedName.replaceAll("[\u3002\uFF0E\uFF61]", "."); if (expectedName.endsWith(".")) { expectedName = expectedName.substring(0, expectedName.length() - 1); } assertEquals(expectedName, domain.toString()); } }
public void testGetKeyMatchesString() { for (StandardSystemProperty property : StandardSystemProperty.values()) { String fieldName = property.name(); String expected = Ascii.toLowerCase(fieldName).replaceAll("_", "."); assertEquals(expected, property.key()); } }