builder.setDescriptor(styleDefDesc);
builder.setLocation(source.getSystemId(), source.getLastModified());
builder.setClassName(className);
builder.setOwnHash(source.getHash());
ParserResult result = CssPreprocessor
.initial()
.source(source.getContents())
.resourceName(source.getSystemId())
.componentClass(className, shouldValidate(descriptor.getName()))
.allowedConditions(allowedConditions)
.themes(styleDefDesc)
.parse();
builder.setContent(result.content());
builder.setThemeExpressions(result.themeExpressions());
return (D) builder.build();
} else if (descriptor.getDefType() == DefType.RESOURCE) {
return (D) new ResourceDefHandler<ResourceDef>((DefDescriptor<ResourceDef>) descriptor,
(Source<ResourceDef>) source).createDefinition();