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