// matching the most common expected usages of imports vs. declared vars.
if (!builder.vars().isEmpty()) {
error("tag %s must come before all declared vars", ThemeDefRefHandler.TAG);
}
ThemeDefRef def = new ThemeDefRefHandler<ThemeDef>(this, xmlReader, source).getElement();
if (builder.imports().contains(def.getThemeDescriptor())) {
error("Duplicate theme import %s", def.getName());
}
builder.addImport(def.getThemeDescriptor());
} else {
error("Found unexpected tag %s", tag);
}
}