}
PropertyOracle propertyOracle = context.getPropertyOracle();
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 = StringCase.toUpper(userAgentValue.substring(0, 1))
+ 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 native String getRuntimeValue() /*-{");
sw.indent();
UserAgentPropertyGenerator.writeUserAgentPropertyJavaScript(sw,
selectionProperty.getPossibleValues(), null);
sw.outdent();
sw.println("}-*/;");
sw.println();
sw.println();