1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.commons.configuration2.builder;
18
19 import javax.xml.parsers.DocumentBuilder;
20
21 import org.xml.sax.EntityResolver;
22
23 /**
24 * <p>
25 * Definition of a parameters interface for XML configurations.
26 * </p>
27 * <p>
28 * The {@code XMLConfiguration} class defines a bunch of additional properties related to XML processing.
29 * </p>
30 * <p>
31 * <strong>Important note:</strong> This interface is not intended to be implemented by client code! It defines a set of
32 * available properties and may be extended even in minor releases.
33 * </p>
34 *
35 * @param <T> the type of the result of all set methods for method chaining
36 * @since 2.0
37 */
38 public interface XMLBuilderProperties<T> {
39 /**
40 * Allows setting the {@code DocumentBuilder} for parsing an XML document. This is the most flexible way of customizing
41 * XML processing.
42 *
43 * @param docBuilder the {@code DocumentBuilder} to use
44 * @return a reference to this object for method chaining
45 */
46 T setDocumentBuilder(DocumentBuilder docBuilder);
47
48 /**
49 * Allows setting the {@code EntityResolver} which maps entity references during XML parsing.
50 *
51 * @param resolver the {@code EntityResolver} to use
52 * @return a reference to this object for method chaining
53 */
54 T setEntityResolver(EntityResolver resolver);
55
56 /**
57 * Sets the public ID of the DOCTYPE declaration.
58 *
59 * @param pubID the public ID
60 * @return a reference to this object for method chaining
61 */
62 T setPublicID(String pubID);
63
64 /**
65 * Sets the value of the schemaValidation flag. This flag determines whether DTD or Schema validation should be used.
66 *
67 * @param f the flag value, <strong>true</strong> for schema validation, <strong>false</strong> for DTD validation
68 * @return a reference to this object for method chaining
69 */
70 T setSchemaValidation(boolean f);
71
72 /**
73 * Sets the system ID of the DOCTYPE declaration.
74 *
75 * @param sysID the system ID
76 * @return a reference to this object for method chaining
77 */
78 T setSystemID(String sysID);
79
80 /**
81 * Sets a flag whether schema/DTD validation should be performed.
82 *
83 * @param f the validation flag
84 * @return a reference to this object for method chaining
85 */
86 T setValidating(boolean f);
87 }