logger.log(TreeLogger.ERROR, typeName + "." + method.getName()
+ " must return DateTimeFormat");
throw new UnableToCompleteException();
}
String pattern;
Pattern annotation = method.getAnnotation(Pattern.class);
if (annotation == null) {
com.google.gwt.i18n.client.CustomDateTimeFormat.Pattern oldAnnotation
= method.getAnnotation(com.google.gwt.i18n.client.CustomDateTimeFormat.Pattern.class);
if (oldAnnotation == null) {
logger.log(TreeLogger.ERROR, typeName + "." + method.getName()
+ " must have an @Pattern annotation");
throw new UnableToCompleteException();
}
pattern = oldAnnotation.value();
} else {
pattern = annotation.value();
}
pattern = dtpg.getBestPattern(pattern);
writer.println();
String retTypeName = method.getReturnType().getQualifiedSourceName();
writer.println("public " + retTypeName + " " + method.getName() + "() {");