Class XMLBuilderParametersImpl
- java.lang.Object
-
- org.apache.commons.configuration2.builder.BasicBuilderParameters
-
- org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl
-
- org.apache.commons.configuration2.builder.HierarchicalBuilderParametersImpl
-
- org.apache.commons.configuration2.builder.XMLBuilderParametersImpl
-
- All Implemented Interfaces:
Cloneable,BasicBuilderProperties<BasicBuilderParameters>,BuilderParameters,FileBasedBuilderProperties<FileBasedBuilderParametersImpl>,HierarchicalBuilderProperties<HierarchicalBuilderParametersImpl>,XMLBuilderProperties<XMLBuilderParametersImpl>
public class XMLBuilderParametersImpl extends HierarchicalBuilderParametersImpl implements XMLBuilderProperties<XMLBuilderParametersImpl>
A specialized parameters class for XML configuration.
This parameters class defines some properties which allow customizing the parsing of XML documents. The location of the XML document to be loaded can be specified, too.
This class is not thread-safe. It is intended that an instance is constructed and initialized by a single thread during configuration of a
ConfigurationBuilder.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from interface org.apache.commons.configuration2.builder.BuilderParameters
RESERVED_PARAMETER_PREFIX
-
-
Constructor Summary
Constructors Constructor Description XMLBuilderParametersImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityResolvergetEntityResolver()Gets theEntityResolverstored in this parameters object.voidinheritFrom(Map<String,?> source)Inherits properties from the specified map.XMLBuilderParametersImplsetDocumentBuilder(DocumentBuilder docBuilder)Allows setting theDocumentBuilderfor parsing an XML document.XMLBuilderParametersImplsetEntityResolver(EntityResolver resolver)Allows setting theEntityResolverwhich maps entity references during XML parsing.XMLBuilderParametersImplsetPublicID(String pubID)Sets the public ID of the DOCTYPE declaration.XMLBuilderParametersImplsetSchemaValidation(boolean f)Sets the value of the schemaValidation flag.XMLBuilderParametersImplsetSystemID(String sysID)Sets the system ID of the DOCTYPE declaration.XMLBuilderParametersImplsetValidating(boolean f)Sets a flag whether schema/DTD validation should be performed.-
Methods inherited from class org.apache.commons.configuration2.builder.HierarchicalBuilderParametersImpl
setExpressionEngine
-
Methods inherited from class org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl
clone, fromMap, fromParameters, fromParameters, getFileHandler, getParameters, getReloadingDetectorFactory, getReloadingRefreshDelay, setBasePath, setEncoding, setFile, setFileName, setFileSystem, setLocationStrategy, setPath, setReloadingDetectorFactory, setReloadingRefreshDelay, setURL, setURL
-
Methods inherited from class org.apache.commons.configuration2.builder.BasicBuilderParameters
copyPropertiesFrom, fetchBeanHelper, fetchInterpolatorSpecification, fetchProperty, merge, setBeanHelper, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setSynchronizer, setThrowExceptionOnMissing, storeProperty
-
-
-
-
Constructor Detail
-
XMLBuilderParametersImpl
public XMLBuilderParametersImpl()
-
-
Method Detail
-
inheritFrom
public void inheritFrom(Map<String,?> source)
Description copied from class:HierarchicalBuilderParametersImplInherits properties from the specified map. This can be used for instance to reuse parameters from one builder in another builder - also in parent-child relations in which a parent builder creates child builders. The purpose of this method is to let a concrete implementation decide which properties can be inherited. Because parameters are basically organized as a map it would be possible to simply copy over all properties from the source object. However, this is not appropriate in all cases. For instance, some properties - like aConfigurationInterpolator- are tightly connected to a configuration and cannot be reused in a different context. For other properties, e.g. a file name, it does not make sense to copy it. Therefore, an implementation has to be explicit in the properties it wants to take over. This implementation takes some properties defined in this class into account. This implementation copies some more properties defined by this class.- Overrides:
inheritFromin classHierarchicalBuilderParametersImpl- Parameters:
source- the source properties to inherit from
-
setDocumentBuilder
public XMLBuilderParametersImpl setDocumentBuilder(DocumentBuilder docBuilder)
Description copied from interface:XMLBuilderPropertiesAllows setting theDocumentBuilderfor parsing an XML document. This is the most flexible way of customizing XML processing.- Specified by:
setDocumentBuilderin interfaceXMLBuilderProperties<XMLBuilderParametersImpl>- Parameters:
docBuilder- theDocumentBuilderto use- Returns:
- a reference to this object for method chaining
-
setEntityResolver
public XMLBuilderParametersImpl setEntityResolver(EntityResolver resolver)
Description copied from interface:XMLBuilderPropertiesAllows setting theEntityResolverwhich maps entity references during XML parsing.- Specified by:
setEntityResolverin interfaceXMLBuilderProperties<XMLBuilderParametersImpl>- Parameters:
resolver- theEntityResolverto use- Returns:
- a reference to this object for method chaining
-
getEntityResolver
public EntityResolver getEntityResolver()
Gets theEntityResolverstored in this parameters object. Result is null if no such object has been set.- Returns:
- the
EntityResolveror null
-
setPublicID
public XMLBuilderParametersImpl setPublicID(String pubID)
Description copied from interface:XMLBuilderPropertiesSets the public ID of the DOCTYPE declaration.- Specified by:
setPublicIDin interfaceXMLBuilderProperties<XMLBuilderParametersImpl>- Parameters:
pubID- the public ID- Returns:
- a reference to this object for method chaining
-
setSystemID
public XMLBuilderParametersImpl setSystemID(String sysID)
Description copied from interface:XMLBuilderPropertiesSets the system ID of the DOCTYPE declaration.- Specified by:
setSystemIDin interfaceXMLBuilderProperties<XMLBuilderParametersImpl>- Parameters:
sysID- the system ID- Returns:
- a reference to this object for method chaining
-
setValidating
public XMLBuilderParametersImpl setValidating(boolean f)
Description copied from interface:XMLBuilderPropertiesSets a flag whether schema/DTD validation should be performed.- Specified by:
setValidatingin interfaceXMLBuilderProperties<XMLBuilderParametersImpl>- Parameters:
f- the validation flag- Returns:
- a reference to this object for method chaining
-
setSchemaValidation
public XMLBuilderParametersImpl setSchemaValidation(boolean f)
Description copied from interface:XMLBuilderPropertiesSets the value of the schemaValidation flag. This flag determines whether DTD or Schema validation should be used.- Specified by:
setSchemaValidationin interfaceXMLBuilderProperties<XMLBuilderParametersImpl>- Parameters:
f- the flag value, true for schema validation, false for DTD validation- Returns:
- a reference to this object for method chaining
-
-