logger.log(TreeLogger.WARN, "Unable to find value for '"
+ PROPERTY_USER_AGENT_RUNTIME_WARNING + "'", e);
}
String userAgentValue;
SelectionProperty selectionProperty;
try {
selectionProperty = propertyOracle.getSelectionProperty(logger, PROPERTY_USER_AGENT);
userAgentValue = selectionProperty.getCurrentValue();
} catch (BadPropertyValueException e) {
logger.log(TreeLogger.ERROR, "Unable to find value for '" + PROPERTY_USER_AGENT + "'", e);
throw new UnableToCompleteException();
}
String userAgentValueInitialCap = userAgentValue.substring(0, 1).toUpperCase()
+ userAgentValue.substring(1);
className = className + "Impl" + userAgentValueInitialCap;
ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(
packageName, className);
composerFactory.addImplementedInterface(userType.getQualifiedSourceName());
PrintWriter pw = context.tryCreate(logger, packageName, className);
if (pw != null) {
SourceWriter sw = composerFactory.createSourceWriter(context, pw);
sw.println();
sw.println("public boolean getUserAgentRuntimeWarning() {");
sw.indent();
sw.println("return " + userAgentRuntimeWarning + ";");
sw.outdent();
sw.println("}");
sw.println();
sw.println();
sw.println("public native String getRuntimeValue() /*-{");
sw.indent();
UserAgentPropertyGenerator.writeUserAgentPropertyJavaScript(sw,
selectionProperty.getPossibleValues());
sw.outdent();
sw.println("}-*/;");
sw.println();
sw.println();