}
if (!(obj instanceof CommandBuilder)) {
throw new MorphlineCompilationException("Type of command " + cmdName + " must be an instance of "
+ CommandBuilder.class.getName() + " but is: " + cmdClass.getName(), cmdConfig);
}
CommandBuilder builder = (CommandBuilder) obj;
Command cmd = builder.build(cmdConfig.getConfig(cmdName), currentParent, finalChild, getContext());
return cmd;
}