示例#1
0
 private static String maybeGetJsExportName(Annotation[] annotations, String calculatedName) {
   AnnotationBinding jsExport = JdtUtil.getAnnotation(annotations, JSEXPORT_CLASS);
   if (jsExport == null) {
     return null;
   }
   String value = JdtUtil.getAnnotationParameterString(jsExport, "value");
   return Strings.isNullOrEmpty(value) ? calculatedName : value;
 }
示例#2
0
  public static String resolveExpression(
      String instance, String path, String prefix, String suffix) {
    String expression = path.replace(".", "().") + "()";

    if (!Strings.isNullOrEmpty(instance)) {
      expression = instance + "." + expression;
    }

    if (!Strings.isNullOrEmpty(prefix)) {
      expression = "\"" + Generator.escape(prefix) + "\" + " + expression;
    }

    if (!Strings.isNullOrEmpty(suffix)) {
      expression += " + \"" + Generator.escape(suffix) + "\"";
    }

    return expression;
  }