for (int i = 0; i < count; i++) {
SchemaBase child = schema.getChild(i);
if (child.getExtension() instanceof GlobalExtension) {
// create the definition
GlobalExtension global = (GlobalExtension)child.getExtension();
DefinitionItem definition = global.getDefinition();
if (definition == null) {
definition = itembuilder.buildGlobal((AnnotatedBase)child);
if (s_logger.isInfoEnabled()) {
s_logger.info("Constructed item structure for " + SchemaUtils.describeComponent(child)
+ ":\n" + definition.describe());
}
} else if (s_logger.isInfoEnabled()) {
s_logger.info("Found existing item structure for " + SchemaUtils.describeComponent(child)
+ ":\n" + definition.describe());
}
items.add(definition);
// set the names on the definition so they'll be available for inlining
NameConverter nconv = global.getNameConverter();
String dfltname = nconv.toBaseName(((INamed)child).getName());
if (!definition.isFixedName()) {
String name = global.getBaseName();
if (name == null) {
name = NameUtils.toNameLead(dfltname);
}
definition.setName(name);
}
if (!definition.isFixedClassName()) {
String name = global.getClassName();
if (name == null) {
name = global.getNameConverter().toJavaClassName(dfltname);
}
definition.setClassName(name);
}
// force class generation if required
if (global.isIncluded()) {
definition.setInlineBlocked(true);
if (s_logger.isDebugEnabled()) {
s_logger.debug("Forcing class generation for " + SchemaUtils.describeComponent(child));
}
}