*/
public void validate(SymbolTable symbolTable, NameMappings nameMappings,
StandardDefs standardDefs, Set<String> themeNames, Set<String> addedCSSFiles)
{
Set<String> classNames;
TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(MxmlCompiler.TYPE_TABLE);
if (typeTable == null)
{
typeTable = new TypeTable(symbolTable, nameMappings, standardDefs, themeNames);
}
if (qualifiedTypeSelectors)
{
classNames = symbolTable.getClassNames();
}
else
{
classNames = new HashSet<String>();
for (String className : symbolTable.getClassNames())
{
if (qualifiedTypeSelectors)
classNames.add(NameFormatter.toDot(className));
else
classNames.add(className.replaceFirst(".*:", ""));
}
}
// Strip off the leading '[' and trailing ']'.
String themeNamesString = themeNames.toString();
themeNamesString = themeNamesString.substring(1, themeNamesString.length() - 1);
for (Entry<String, StyleDef> entry : styleDefs.entrySet())
{
String styleName = entry.getKey();
StyleDef styleDef = entry.getValue();
String typeName = StyleDef.dehyphenize(styleName);
Map<String, StyleDeclaration> declarations = styleDef.getDeclarations();
if (declarations != null)
{
for (StyleDeclaration styleDeclaration : declarations.values())
{
Collection<StyleDeclarationBlock> blocks = styleDeclaration.getDeclarationBlocks();
for (StyleDeclarationBlock block : blocks)
{
Map<String, StyleProperty> styleProperties = block.getProperties();
if (addedCSSFiles == null || addedCSSFiles.contains(styleDeclaration.getPath()))
{
if (styleDef.isTypeSelector())
{
if (qualifiedTypeSelectors && mxmlConfiguration.showInvalidCssPropertyWarnings())
{
Type type = typeTable.getType(NameFormatter.toColon(typeName));
if (type != null)
{
validateTypeSelectorProperties(styleProperties, type, styleDef,
typeName, themeNamesString);
}
}
}
if (mxmlDocumentQName != null)
{
// Don't use getType(QName), because that
// tries to lookup the class name in the
// manifest. Use getType(String) instead.
Type mxmlDocumentType = typeTable.getType(mxmlDocumentQName.toString());
assert mxmlDocumentType != null;
validatePropertyReferences(styleProperties, mxmlDocumentType);
}
}
}