Create a new {@link DocumentBuilderFactory} for the specified schema, with
the following settings: coalescing, comment ignoring and namespace aware.

@param aSchema
The schema to use. May not be <code>null</code>.
@return Never <code>null</code>.
11252
@Nonnull
  public static DocumentBuilderFactory createDocumentBuilderFactory (@Nonnull final Schema aSchema)
  {
    ValueEnforcer.notNull (aSchema, "Schema");

    final DocumentBuilderFactory aDocumentBuilderFactory = createDefaultDocumentBuilderFactory ();
    aDocumentBuilderFactory.setSchema (aSchema);
    return aDocumentBuilderFactory;
  }
888216
public ObjectSchema getObjectSchema(Set<String> objectClasses) 
        throws NamingException, ClassNotFoundException {
        
        ObjectSchema result = new ObjectSchema();
        createObjectClass(objectClasses, schemaContext, result);
        return result;
    }
66147
public static DomDocument getEmptyDocument(DocumentBuilderFactory documentBuilderFactory) {
    try {
      DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
      return new DomDocumentImpl(documentBuilder.newDocument());
    } catch (ParserConfigurationException e) {
      throw new ModelParseException("Unable to create a new document", e);
    }
  }
1331270
private static Document emptyDocument() {
        try {
            return DocumentBuilderFactory.newInstance()
                .newDocumentBuilder()
                .newDocument();
        } catch (final ParserConfigurationException ex) {
            throw new IllegalStateException(
                // @checkstyle LineLength (1 line)
                "Could not instantiate DocumentBuilderFactory and build empty Document",
                ex
            );
        }
    }
463193
public static <T> Schema<T> createFrom(RuntimeSchema<T> rs,
            Factory vf, Predicate.Factory pf,
            String... args)
    {
        return createFrom(rs, rs.instantiator, vf, pf, args);
    }
407886
public AspFactory createAspFactory(String aspName, String associationName) throws Exception {
        return this.createAspFactory(aspName, associationName, false);
    }
771114
@Nullable
  public static Schema getSchemaOfNamespace (@Nullable final String sNamespace)
  {
    final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace);
    return eDocType == null ? null : eDocType.getSchema ();
  }
639125
function findOneOrCreatePlugin(schema) {
    schema.statics.findOneOrCreate = function findOneOrCreate(condition, doc, callback) {
        var self = this;

        self.findOne(condition, function(err, result ) {
            if (result) {
                callback(err, result);
            } else {
                self.create(doc, function(err, result) {
                    callback(err, result);
                });
            }
        });
    };
}
693641
public static DocumentBuilder createDocumentBuilder() {
		final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		disableXXE(dbf);
		DocumentBuilder builder = null;
		try {
			builder = dbf.newDocumentBuilder();
		} catch (Exception e) {
			throw new UtilException(e, "Create xml document error!");
		}
		return builder;
	}
1272591
def fromSchema(self, schema):
        ''' 
        '''  
        ns = schema.getTargetNamespace()
        assert self.targetNamespace is None or self.targetNamespace == ns,\
            'SchemaDescription instance represents %s, not %s'\
            %(self.targetNamespace, ns)

        if self.targetNamespace is None:
            self.targetNamespace = ns
 
        self.classHead.ns = self.classFoot.ns = ns
        for item in [t for t in schema.types if t.getAttributeName() not in self.__types]:
            self.__types.append(item.getAttributeName())
            self.items.append(TypeWriter(do_extended=self.do_extended, extPyClasses=self.extPyClasses))
            self.items[-1].fromSchemaItem(item)

        for item in [e for e in schema.elements if e.getAttributeName() not in self.__elements]:
            self.__elements.append(item.getAttributeName())
            self.items.append(ElementWriter(do_extended=self.do_extended))
            self.items[-1].fromSchemaItem(item)
973861
private DocumentBuilder getDocumentBuilderFromPool()
            throws ParserConfigurationException {
        DocumentBuilder builder = documentBuilderPool.pollFirst();
        if (builder == null){
            builder = getDomFactory().newDocumentBuilder();
        }
        builder.setErrorHandler(errorHandler);
        return builder;
    }
299296
protected void configureFactory(DocumentBuilderFactory dbf) {
    dbf.setValidating(true);
    dbf.setIgnoringComments(false);
    dbf.setIgnoringElementContentWhitespace(false);
    dbf.setNamespaceAware(true);
    protectAgainstXxeAttacks(dbf);
  }
637336
private void createSchema() throws SQLException {
		logger.entering(CLASSNAME, "createSchema");
		Connection conn = getConnectionToDefaultSchema();

		logger.log(Level.INFO, schema + " schema does not exists. Trying to create it.");
		PreparedStatement ps = null;
		ps = conn.prepareStatement("CREATE SCHEMA " + schema);
		ps.execute();

		cleanupConnection(conn, null, ps);
		logger.exiting(CLASSNAME, "createSchema");
	}
357721
private void returnDocumentBuilderToPool(DocumentBuilder db) {
        try {
            db.reset();
            documentBuilderPool.offerFirst(db);
        } catch (UnsupportedOperationException e) {
            // document builders that don't support reset() can't be pooled
        }
    }
703155
protected SQLiteDatabaseSchema createDataSource(Element databaseSchema) {
		if (databaseSchema.getKind() != ElementKind.INTERFACE) {
			String msg = String.format("Class %s: only interfaces can be annotated with @%s annotation",
					databaseSchema.getSimpleName().toString(), BindDataSource.class.getSimpleName());
			throw (new InvalidKindForAnnotationException(msg));
		}

		if (!databaseSchema.getSimpleName().toString().endsWith(BindDataSourceBuilder.SUFFIX)) {
			String msg = String.format(
					"Interface %s marked with @%s annotation must have a typeName with suffix \""
							+ BindDataSourceBuilder.SUFFIX + "\" to be used with @BindDataSource",
					databaseSchema.getSimpleName().toString(), BindDataSource.class.getSimpleName());
			throw (new InvalidNameException(msg));
		}

		// go ahead to dataSource analysis
		// ASSERT: daoElement and beanElement is element for dao and bean
		// associated
		String schemaFileName = AnnotationUtility.extractAsString(databaseSchema, BindDataSource.class,
				AnnotationAttributeType.FILENAME);
		int schemaVersion = AnnotationUtility.extractAsInt(databaseSchema, BindDataSource.class,
				AnnotationAttributeType.VERSION);
		boolean generateLog = AnnotationUtility.extractAsBoolean(databaseSchema, BindDataSource.class,
				AnnotationAttributeType.GENERATE_LOG);
		boolean generateSchema = AnnotationUtility.extractAsBoolean(databaseSchema, BindDataSource.class,
				AnnotationAttributeType.GENERATE_SCHEMA);
		boolean generateAsyncTask = AnnotationUtility.extractAsBoolean(databaseSchema, BindDataSource.class,
				AnnotationAttributeType.GENERATE_ASYNC_TASK);
		boolean generateCursorWrapper = AnnotationUtility.extractAsBoolean(databaseSchema, BindDataSource.class,
				AnnotationAttributeType.GENERATE_CURSOR_WRAPPER);
		boolean generateRx = AnnotationUtility.extractAsBoolean(databaseSchema, BindDataSource.class,
				AnnotationAttributeType.GENERATE_RX);

		// get all dao used within SQLDatabaseSchema annotation
		List<String> daoIntoDataSource = AnnotationUtility.extractAsClassNameArray(elementUtils, databaseSchema,
				BindDataSource.class, AnnotationAttributeType.DAO_SET);

		String configCursorFactory = ReferredClasses.NO_CURSOR_FACTORY_CLASS_NAME;
		String configDatabaseErrorHandler = ReferredClasses.NO_DATABASE_ERROR_HANDLER_CLASS_NAME;
		String configDatabaseLifecycleHandler = ReferredClasses.NO_DATABASE_LIFECYCLE_HANDLER_CLASS_NAME;
		boolean configInMemory = false;
		boolean configLogEnabled = true;
		String configPopulatorClass = NoPopulator.class.getName();

		// manage for annotated data-source options
		BindDataSourceOptions dataSourceOptionsAnnotation = databaseSchema.getAnnotation(BindDataSourceOptions.class);
		if (dataSourceOptionsAnnotation != null) {
			configInMemory = AnnotationUtility.extractAsBoolean(databaseSchema, BindDataSourceOptions.class,
					AnnotationAttributeType.IN_MEMORY);
			configLogEnabled = AnnotationUtility.extractAsBoolean(databaseSchema, BindDataSourceOptions.class,
					AnnotationAttributeType.LOG_ENABLED);
			configPopulatorClass = AnnotationUtility.extractAsClassName(databaseSchema, BindDataSourceOptions.class,
					AnnotationAttributeType.POPULATOR);
			configCursorFactory = AnnotationUtility.extractAsClassName(databaseSchema, BindDataSourceOptions.class,
					AnnotationAttributeType.CURSOR_FACTORY);
			configDatabaseLifecycleHandler = AnnotationUtility.extractAsClassName(databaseSchema,
					BindDataSourceOptions.class, AnnotationAttributeType.DATABASE_LIFECYCLE_HANDLER);
		}

		SQLiteDatabaseSchema schema = new SQLiteDatabaseSchema((TypeElement) databaseSchema, schemaFileName,
				schemaVersion, generateSchema, generateLog, generateAsyncTask, generateCursorWrapper, generateRx,
				daoIntoDataSource, configCursorFactory, configDatabaseErrorHandler, configDatabaseLifecycleHandler,
				configInMemory, configLogEnabled, configPopulatorClass);

		// manage for content provider generation
		BindContentProvider contentProviderAnnotation = databaseSchema.getAnnotation(BindContentProvider.class);
		if (contentProviderAnnotation != null) {
			schema.generateContentProvider = true;
			schema.contentProvider = new SQLiteModelContentProvider();
			schema.contentProvider.authority = contentProviderAnnotation.authority();
		} else {
			schema.generateContentProvider = false;
		}

		return schema;

	}
383692
function (schema) {
		if (!schema.key || schema.key === 'base' || !Array.isArray(schema.fields)) {
			return null;
			// throw exception?
		}
		// store it for later reference
		Schemas[schema.key] = schema;
		// add this schema to the NPC object so we can use it as a constructor
		// this could overwrite is that ok?
		const Base = NPC[schema.key] = function () {
			// in case we add something to NPC constructor that we need to call?
			// NPC.Base.call(this);
		};
		Base.prototype = new NPC.Base();
		Base.prototype.constructor = Base;
		Base.prototype.schema = schema.key;
		Base.prototype.fields = [];
		Base.prototype.helpers = {};
		
		// initialize schema properties...
		schema.fields.forEach((f) => {
			let default_ = null;
			switch (f.type) {
				case 'string':
				case 'text':
					default_ = '';
					break;
				case 'array':
					default_ = [];
					break;
				case 'number':
				case 'modifier':
					default_ = 0;
					break;
				case undefined:
					// ?
					break;
			}
			Base.prototype.fields[f.key] = default_;
		});
		
		if (!schema.helpers || typeof schema.helpers !== 'object') { return; }
		const helpers = Object.keys(schema.helpers);
		helpers.forEach((h) => {
			// if (typeof schema.helpers[h] === 'function') {
			//	Base.prototype.helpers[h] = schema.helpers[h];
			// }
			// create a function from the array
			Base.prototype.helpers[h] = new Function(...schema.helpers[h]);
		});
	}
666772
public static Builder newSchema(GraphQLSchema existingSchema) {
        return new Builder()
                .query(existingSchema.getQueryType())
                .mutation(existingSchema.getMutationType())
                .subscription(existingSchema.getSubscriptionType())
                .codeRegistry(existingSchema.getCodeRegistry())
                .clearAdditionalTypes()
                .clearDirectives()
                .additionalDirectives(existingSchema.directives)
                .additionalTypes(existingSchema.additionalTypes);
    }