List of usage examples for com.google.common.base CaseFormat LOWER_CAMEL
CaseFormat LOWER_CAMEL
To view the source code for com.google.common.base CaseFormat LOWER_CAMEL.
Click Source Link
From source file:com.activeandroid.TableInfo.java
public TableInfo(Class<? extends Model> type) { mType = type;/*from w w w .j av a2s .c om*/ final Table tableAnnotation = type.getAnnotation(Table.class); if (tableAnnotation != null) { mTableName = tableAnnotation.name(); } else { mTableName = type.getSimpleName(); CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, mTableName); } List<Field> fields = new LinkedList<Field>(ReflectionUtils.getDeclaredColumnFields(type)); // Collections.reverse(fields); //WHY? for (Field field : fields) { final Column columnAnnotation = field.getAnnotation(Column.class); String columnName; if (columnAnnotation == null) { columnName = field.getName(); CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, columnName); } else { columnName = columnAnnotation.name(); } mColumnNames.put(field, columnName); } }
From source file:com.github.ko2ic.plugin.eclipse.taggen.common.domain.valueobject.NameRuleString.java
public String phraseConstantName() { String value = str;//from w w w. ja v a 2 s .c o m if (Character.isUpperCase(str.charAt(0))) { if (!str.contains("_")) { value = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, str); } } else { if (str.contains("_")) { value = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_UNDERSCORE, str); } else { value = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, str); } } return value; }
From source file:com.thinkbiganalytics.nifi.feedmgr.NifiEnvironmentProperties.java
/** * return the environment property in the format that can be used with NiFi * * @param envProperty the property from the application.properties * @return the formatted property to work with NiFi *///from ww w . j a va 2 s.c o m private static String environmentPropertyToNifi(String envProperty) { String name = envProperty.replaceAll("_", " "); name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name); return name; }
From source file:com.google.template.soy.shared.internal.ImpureFunction.java
private ImpureFunction(int numArgs) { this.functionName = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name()); this.numArgs = numArgs; }
From source file:com.appunity.ant.Utils.java
public static String toPinYin(String hzString) { /**//from w w w . j ava 2s . c o m * ? */ HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.setCaseType(HanyuPinyinCaseType.LOWERCASE); format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); format.setVCharType(HanyuPinyinVCharType.WITH_V); char[] hzChars = new char[hzString.length()]; for (int i = 0; i < hzString.length(); i++) { hzChars[i] = hzString.charAt(i); } int t0 = hzChars.length; StringBuilder sb = new StringBuilder(); try { for (int i = 0; i < t0; i++) { char c = hzChars[i]; String[] result = PinyinHelper.toHanyuPinyinStringArray(c, format); if (result != null && result.length > 0) { sb.append(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, result[0])); } else { sb.append(c); } } } catch (BadHanyuPinyinOutputFormatCombination e1) { if (sb.length() == 0) { sb.append("Anonymous"); } } return sb.toString(); }
From source file:com.google.template.soy.shared.internal.NonpluginFunction.java
private NonpluginFunction(int numArgs) { this.functionName = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name()); this.numArgs = numArgs; }
From source file:com.google.template.soy.shared.internal.BuiltinFunction.java
BuiltinFunction() {
this.functionName = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name());
}
From source file:org.geoserver.security.iride.service.policy.IridePolicy.java
/** * Returns the <code>IRIDE</code> "policy" <code>service name</code>, i.e.: the name of the operation. * * @return the <code>IRIDE</code> "policy" <code>service name</code>, i.e.: the name of the operation *///from www . j a va2 s. c o m public String getServiceName() { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, this.name()); }
From source file:com.ning.billing.util.dao.LowerToCamelBeanMapper.java
public LowerToCamelBeanMapper(final Class<T> type) { this.type = type; try {// www. ja v a2s. co m final BeanInfo info = Introspector.getBeanInfo(type); for (final PropertyDescriptor descriptor : info.getPropertyDescriptors()) { properties.put( CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, descriptor.getName()).toLowerCase(), descriptor); } } catch (IntrospectionException e) { throw new IllegalArgumentException(e); } }
From source file:org.apache.brooklyn.location.basic.DeprecatedKeysMappingBuilder.java
private String toHyphen(String word) { return CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_HYPHEN, word); }