StandardDefs standardDefs = ThreadLocalToolkit.getStandardDefs();
try
{
String templateName = CODEGEN_TEMPLATE_PATH + standardDefs.getSkinClassTemplate();
Template template = VelocityManager.getTemplate(templateName);
if (template == null)
{
throw new TemplateException( templateName );
}
int dot = fullClassName.lastIndexOf( '.' );
String packageName;
String className;
if (dot != -1)
{
packageName = fullClassName.substring(0, dot);
className = fullClassName.substring(dot + 1);
}
else
{
packageName = "";
className = fullClassName;
}
VelocityContext velocityContext = VelocityManager.getCodeGenContext();
velocityContext.put("packageName", packageName);
velocityContext.put("baseClassName", baseClassName);
velocityContext.put("className", className);
velocityContext.put("needsIBorder", new Boolean(needsIBorder));
velocityContext.put("needsBorderMetrics", new Boolean(needsBorderMetrics));
velocityContext.put("needsIFlexDisplayObject", new Boolean(needsIFlexDisplayObject));
velocityContext.put("needsMeasuredHeight", new Boolean(needsMeasuredHeight));
velocityContext.put("needsMeasuredWidth", new Boolean(needsMeasuredWidth));
velocityContext.put("needsMove", new Boolean(needsMove));
velocityContext.put("needsSetActualSize", new Boolean(needsSetActualSize));
velocityContext.put("needsName", new Boolean(!flexMovieClipOrSprite));
velocityContext.put("needsToString", new Boolean(!flexMovieClipOrSprite));
StringWriter stringWriter = new StringWriter();
template.merge(velocityContext, stringWriter);
result = stringWriter.toString();
}
catch (Exception e)
{
if (Trace.error)