예제 #1
0
 public String format(Locale locale, String annotationName) {
   DynamicTypeImpl type = getType();
   ParsedText parsedAnnotation = type.getParsedAnnotation(annotationName);
   if (parsedAnnotation == null) {
     return "";
   }
   EvalContext evalContext = type.createEvalContext(locale, annotationName, this);
   String nameString = parsedAnnotation.formatName(evalContext).trim();
   return nameString;
 }
예제 #2
0
 public String format(Locale locale, String annotationName) {
   DynamicTypeImpl type = (DynamicTypeImpl) getType();
   ParsedText parsedAnnotation = type.getParsedAnnotation(annotationName);
   if (parsedAnnotation == null) {
     return "";
   }
   EvalContext evalContext =
       new EvalContext(locale, annotationName, Collections.singletonList(this));
   String nameString = parsedAnnotation.formatName(evalContext).trim();
   return nameString;
 }
예제 #3
0
    public String getName(Locale locale, String keyNameFormat) {
      DynamicTypeImpl type = (DynamicTypeImpl) getType();
      ParsedText parsedAnnotation = type.getParsedAnnotation(keyNameFormat);
      if (parsedAnnotation == null) {
        return type.toString();
      }

      if (nameString != null) {
        if (parsedAnnotation.equals(lastParsedAnnotation)) return nameString;
      }
      lastParsedAnnotation = parsedAnnotation;
      nameString = format(locale, keyNameFormat);
      return nameString;
    }