001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *     https://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.configuration2.builder;
018
019import javax.xml.parsers.DocumentBuilder;
020
021import org.xml.sax.EntityResolver;
022
023/**
024 * <p>
025 * Definition of a parameters interface for XML configurations.
026 * </p>
027 * <p>
028 * The {@code XMLConfiguration} class defines a bunch of additional properties related to XML processing.
029 * </p>
030 * <p>
031 * <strong>Important note:</strong> This interface is not intended to be implemented by client code! It defines a set of
032 * available properties and may be extended even in minor releases.
033 * </p>
034 *
035 * @param <T> the type of the result of all set methods for method chaining
036 * @since 2.0
037 */
038public interface XMLBuilderProperties<T> {
039
040    /**
041     * Sets the {@code DocumentBuilder} for parsing an XML document. This is the most flexible way of customizing
042     * XML processing.
043     *
044     * @param docBuilder the {@code DocumentBuilder} to use
045     * @return a reference to this object for method chaining
046     */
047    T setDocumentBuilder(DocumentBuilder docBuilder);
048
049    /**
050     * Sets the {@code EntityResolver} which maps entity references during XML parsing.
051     *
052     * @param resolver the {@code EntityResolver} to use
053     * @return a reference to this object for method chaining
054     */
055    T setEntityResolver(EntityResolver resolver);
056
057    /**
058     * Sets the public ID of the DOCTYPE declaration.
059     *
060     * @param pubID the public ID
061     * @return a reference to this object for method chaining
062     */
063    T setPublicID(String pubID);
064
065    /**
066     * Sets the value of the schemaValidation flag. This flag determines whether DTD or Schema validation should be used.
067     *
068     * @param f the flag value, <strong>true</strong> for schema validation, <strong>false</strong> for DTD validation
069     * @return a reference to this object for method chaining
070     */
071    T setSchemaValidation(boolean f);
072
073    /**
074     * Sets the system ID of the DOCTYPE declaration.
075     *
076     * @param sysID the system ID
077     * @return a reference to this object for method chaining
078     */
079    T setSystemID(String sysID);
080
081    /**
082     * Sets a flag whether schema/DTD validation should be performed.
083     *
084     * @param f the validation flag
085     * @return a reference to this object for method chaining
086     */
087    T setValidating(boolean f);
088}