// use child customizations to amend the generated extensions
int size = getChildren().size();
for (int i = 0; i < size; i++) {
ComponentCustom custom = (ComponentCustom)getChildren().get(i);
SchemaPath path = custom.buildPath(vctx);
if (path != null) {
if (path.isWildStart()) {
vctx.addError("Top level customizations cannot use wildcard as first step", custom);
} else {
// match only the first path step
OpenAttrBase match = path.partialMatchUnique(0, 0, m_schema);
if (s_logger.isDebugEnabled()) {
if (match == null) {
s_logger.debug("No global schema component found for customization " + custom);
} else {
s_logger.debug("Matched customization " + custom + " to global schema component "
+ SchemaUtils.describeComponent(match));
}
}
if (match != null) {
String name = ((INamed)match).getName();
GlobalExtension exten = (GlobalExtension)match.getExtension();
if (custom.isExcluded()) {
// check if customization applies to descendant of global definition component
if (path.getPathLength() == 1) {
// force exclude if generation skipped by customization
if (exten.isIncluded()) {
vctx.addWarning("Name '" + name
+ "' is on include list for schema, but excluded by customization", custom);
}
exten.setIncluded(false);
exten.setRemoved(true);
} else {
// apply customization to target component extension(s)
applyRemainingCustomizationPath(path, match, custom, vctx);
}
} else {
// check for customization for global excluded at schema level
if (exten.isRemoved()) {
vctx.addWarning("Name '" + name
+ "' is on excludes list for schema, but has a customization", custom);
exten.setRemoved(false);
extendGlobal(builder, wlkr, exten);
}
// check if customization applies to descendant of global definition component
if (path.getPathLength() > 1) {
applyRemainingCustomizationPath(path, match, custom, vctx);
} else {
custom.apply((ComponentExtension)match.getExtension(), vctx);
}