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