예제 #1
0
 public String getLanguageNameAbbreviation() {
   String[] packageNames = this.languageName.split("\\.");
   final String[] _converted_packageNames = (String[]) packageNames;
   String _last =
       IterableExtensions.<String>last(
           ((Iterable<String>) Conversions.doWrapArray(_converted_packageNames)));
   return Strings.toFirstUpper(_last);
 }
예제 #2
0
 /** This test assumes that an EPackage with indexed references is no longer available. */
 public void testExternalFormOfEReferenceNoNPE() throws Exception {
   EReference reference = EcorePackage.Literals.EATTRIBUTE__EATTRIBUTE_TYPE;
   URI uri = EcoreUtil.getURI(reference);
   String externalForm = uri.toString();
   EReference foundReference =
       EcoreUtil2.getEReferenceFromExternalForm(EPackage.Registry.INSTANCE, externalForm);
   assertSame(reference, foundReference);
   String brokenExternalFrom = Strings.toFirstUpper(externalForm);
   assertNull(
       EcoreUtil2.getEReferenceFromExternalForm(EPackage.Registry.INSTANCE, brokenExternalFrom));
   String shortExternalForm = EcoreUtil2.toExternalForm(reference);
   foundReference =
       EcoreUtil2.getEReferenceFromExternalForm(EPackage.Registry.INSTANCE, shortExternalForm);
   assertSame(reference, foundReference);
   String brokenShortExternalFrom = Strings.toFirstUpper(shortExternalForm);
   assertNull(
       EcoreUtil2.getEReferenceFromExternalForm(
           EPackage.Registry.INSTANCE, brokenShortExternalFrom));
   brokenShortExternalFrom = shortExternalForm.replace('A', 'a');
   assertNull(
       EcoreUtil2.getEReferenceFromExternalForm(
           EPackage.Registry.INSTANCE, brokenShortExternalFrom));
 }
예제 #3
0
  public static String getPojoDefinitions(List<Class<?>> pojoClasses) {
    if (pojoClasses == null) return null;
    TreeMap<String, String> map = new TreeMap<String, String>();
    for (Class<?> clazz : pojoClasses) {
      map.put(toCamelCase(clazz), clazz.getName());
    }

    StringBuilder builder = new StringBuilder();
    for (Entry<String, String> pojo : map.entrySet()) {
      builder
          .append("is-pojo ")
          .append(Strings.toFirstUpper(pojo.getKey()))
          .append(' ')
          .append(pojo.getValue())
          .append(";\n");
    }
    return builder.toString();
  }
예제 #4
0
 protected String toTitle(final String string) {
   String _decode = this.decode(string);
   return Strings.toFirstUpper(_decode);
 }