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 *     http://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 * @since 2.0
036 * @param <T> the type of the result of all set methods for method chaining
037 */
038public interface XMLBuilderProperties<T> {
039    /**
040     * Allows setting the {@code DocumentBuilder} for parsing an XML document. This is the most flexible way of customizing
041     * XML processing.
042     *
043     * @param docBuilder the {@code DocumentBuilder} to use
044     * @return a reference to this object for method chaining
045     */
046    T setDocumentBuilder(DocumentBuilder docBuilder);
047
048    /**
049     * Allows setting the {@code EntityResolver} which maps entity references during XML parsing.
050     *
051     * @param resolver the {@code EntityResolver} to use
052     * @return a reference to this object for method chaining
053     */
054    T setEntityResolver(EntityResolver resolver);
055
056    /**
057     * Sets the public ID of the DOCTYPE declaration.
058     *
059     * @param pubID the public ID
060     * @return a reference to this object for method chaining
061     */
062    T setPublicID(String pubID);
063
064    /**
065     * Sets the value of the schemaValidation flag. This flag determines whether DTD or Schema validation should be used.
066     *
067     * @param f the flag value, <b>true</b> for schema validation, <b>false</b> for DTD validation
068     * @return a reference to this object for method chaining
069     */
070    T setSchemaValidation(boolean f);
071
072    /**
073     * Sets the system ID of the DOCTYPE declaration.
074     *
075     * @param sysID the system ID
076     * @return a reference to this object for method chaining
077     */
078    T setSystemID(String sysID);
079
080    /**
081     * Sets a flag whether schema/DTD validation should be performed.
082     *
083     * @param f the validation flag
084     * @return a reference to this object for method chaining
085     */
086    T setValidating(boolean f);
087}