/** * Splits a string using the default delimiter of ','. */ public static String[] split(String input) { return split(input, ','); }
/** * Splits a string using the default delimiter of ','. */ public static String[] split(String input) { return split(input, ','); }
/** * {@inheritDoc} */ public Object convertValue(Object value) { String input = (String)value; String[] values = TapestryUtils.split(input); return Arrays.asList(values); }
/** * {@inheritDoc} */ public Object convertValue(Object value) { String input = (String)value; String[] values = TapestryUtils.split(input); return Arrays.asList(values); }
private Locale constructLocale(String name) { String[] terms = TapestryUtils.split(name, '_'); switch (terms.length) { case 1: return new Locale(terms[0], ""); case 2: return new Locale(terms[0], terms[1]); case 3: return new Locale(terms[0], terms[1], terms[2]); default: throw new IllegalArgumentException(); } }
private Locale constructLocale(String name) { String[] terms = TapestryUtils.split(name, '_'); switch (terms.length) { case 1: return new Locale(terms[0], ""); case 2: return new Locale(terms[0], terms[1]); case 3: return new Locale(terms[0], terms[1], terms[2]); default: throw new IllegalArgumentException(); } }
public void initializeService() { String[] names = TapestryUtils.split(_acceptedLocales); if (names.length == 0) return; _defaultLocale = getLocale(names[0]); _acceptedLocaleNamesSet.addAll(Arrays.asList(names)); }
public Object convertValue(Object value) { String input = (String) value; String[] terms = TapestryUtils.split(input); return new StringConvertedPropertySelectionModel(terms); }
/** @since 4.0 */ public void setAliases(String nameList) { if (HiveMind.isNonBlank(nameList)) { String[] names = TapestryUtils.split(nameList); _aliasNames = Arrays.asList(names); } }
/** @since 4.0 */ public void setAliases(String nameList) { if (HiveMind.isNonBlank(nameList)) { String[] names = TapestryUtils.split(nameList); _aliasNames = Arrays.asList(names); } }
public Object convertValue(Object value) { String input = (String) value; String[] terms = TapestryUtils.split(input); return new StringConvertedPropertySelectionModel(terms); }
public void initializeService() { String[] names = TapestryUtils.split(_acceptedLocales); if (names.length == 0) return; _defaultLocale = getLocale(names[0]); _acceptedLocaleNamesSet.addAll(Arrays.asList(names)); }
private List buildAssetList(String files, String name) { String[] js = TapestryUtils.split(files); List list = new ArrayList(js.length); for (int i=0; i<js.length; i++) { list.add(findAsset(js[i], name + i)); } return list; }
/** * Builds a {@link PropertyChange} instance for the given key and value pulled from the * {@link org.apache.tapestry.web.WebSession}. * * @param key * a key, previously created by * {@link #buildChangeKey(String, String, String, String, String)}, consisting of a * strategy id, application id, page name, id path (optional), and a property name, * all seperated by commas. * @param value * the value stored in the session with this key * @return a {@link PropertyChange} storing the property name and id path (if any), and the * value */ public static PropertyChange buildChange(String key, Object value) { String[] tokens = TapestryUtils.split(key); // Either strategy-id, app-name,page-name,id-path,property // or strategy-id,app-name,page-name,property String idPath = (tokens.length == 5) ? tokens[3] : null; String propertyName = tokens[tokens.length - 1]; return new PropertyChangeImpl(idPath, propertyName, value); }
public Class findClass(String packageList, String className) { String[] packages = TapestryUtils.split(packageList); for (int i = 0; i < packages.length; i++) { String fullName = packages[i].trim() + "." + className; Class result = _classResolver.checkForClass(fullName); if (result != null) return result; } return _classResolver.checkForClass(className); }
/** * Builds a {@link List} of {@link IAsset} from a comma * separated input string. * * @param files A comma separated string. * @param name Description of assets. * @return */ protected List buildAssetList(String files, String name) { String[] js = TapestryUtils.split(files); List list = new ArrayList(js.length); for (int i=0; i<js.length; i++) { list.add(findAsset(js[i], name + i)); } return list; }
public Class findClass(String packageList, String className) { String[] packages = TapestryUtils.split(packageList); for (int i = 0; i < packages.length; i++) { String fullName = packages[i].trim() + "." + className; Class result = _classResolver.checkForClass(fullName); if (result != null) return result; } return _classResolver.checkForClass(className); }
public static IdAllocator fromExternalString(String seed) { Defense.notNull(seed, "seed"); String[] values = TapestryUtils.split(seed); if (values.length == 0) { return new IdAllocator(); } String namespace = values[0]; IdAllocator idAllocator = new IdAllocator(namespace); for (int i=1; i < values.length; i++) { int index = values[i].lastIndexOf(NAME_SEPARATOR); if (index < 0) continue; String baseId = values[i].substring(0, index); int valueIndex = Integer.parseInt(values[i].substring(index + 1, values[i].length())); idAllocator.addSeed(baseId, valueIndex); } return idAllocator; } }
public String[] getPackages() { INamespace namespace = getSpecificationSource().getApplicationNamespace(); String pages = namespace.getPropertyValue(getPagePackages()); String comps = namespace.getPropertyValue(getComponentPackages()); StringBuffer sb = new StringBuffer(); if (pages != null) { sb.append(pages); if (comps!=null) sb.append(","); } if (comps != null) sb.append(comps); return TapestryUtils.split(sb.toString(), ','); } }
public String[] getPackages() { INamespace namespace = getSpecificationSource().getApplicationNamespace(); String pages = namespace.getPropertyValue(getPagePackages()); String comps = namespace.getPropertyValue(getComponentPackages()); StringBuffer sb = new StringBuffer(); if (pages != null) { sb.append(pages); if (comps!=null) sb.append(","); } if (comps != null) sb.append(comps); return TapestryUtils.split(sb.toString(), ','); } }