+ if (nullable == null) {
+ throw childNullException(child, message, args);
+ }
+ return nullable;
+ }
+
+ protected final <V> @NonNull V childNonNull(final @Nullable V nullable, final Class<?> childClass,
+ final String message, final Object... args) {
+ if (nullable == null) {
+ throw childNullException(childClass, message, args);
+ }
+ return nullable;
+ }
+
+ private IllegalArgumentException childNullException(final QName child, final String message, final Object... args) {
+ final QNameModule module = child.getModule();
+ if (!factory().getRuntimeContext().getEffectiveModelContext().findModule(module).isPresent()) {
+ throw new MissingSchemaException("Module " + module + " is not present in current schema context.");