Package com.helger.xml.serialize.read
Class DOMReaderSettings
java.lang.Object
com.helger.xml.serialize.read.DOMReaderSettings
- All Implemented Interfaces:
com.helger.commons.lang.ICloneable<DOMReaderSettings>,IBaseXMLReaderSettings,IDOMReaderSettings
@NotThreadSafe
public class DOMReaderSettings
extends Object
implements com.helger.commons.lang.ICloneable<DOMReaderSettings>, IDOMReaderSettings
DOM reader settings
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor using the default settings fromDOMReaderDefaultSettings.DOMReaderSettings(IDOMReaderSettings aOther) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyToDocumentBuilder(DocumentBuilder aDocumentBuilder) Apply settings of this object onto the specifiedDocumentBuilderobject.voidapplyToDocumentBuilderFactory(DocumentBuilderFactory aDocumentBuilderFactory) Apply settings of this object onto the specifiedDocumentBuilderFactoryobject.com.helger.commons.callback.CallbackList<com.helger.commons.callback.exception.IExceptionCallback<Throwable>> com.helger.commons.collection.impl.ICommonsMap<EXMLParserFeature, Boolean> com.helger.commons.collection.impl.ICommonsMap<EXMLParserProperty, Object> getClone()getFeatureValue(EXMLParserFeature eFeature) Get the value of the specified parser featuregetPropertyValue(EXMLParserProperty eProperty) Get the value of the specified parser propertybooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanfinal DOMReaderSettingsfinal DOMReaderSettingsfinal DOMReaderSettingsremoveFeature(EXMLParserFeature eFeature) final DOMReaderSettingsremoveFeatures(EXMLParserFeature... aFeatures) final DOMReaderSettingsremovePropertyValue(EXMLParserProperty eProperty) booleanCheck if the current settings require a separateDocumentBuilderFactoryor if a pooled default object can be used.final DOMReaderSettingssetCoalescing(boolean bCoalescing) final DOMReaderSettingssetEntityResolver(EntityResolver aEntityResolver) final DOMReaderSettingssetErrorHandler(ErrorHandler aErrorHandler) final DOMReaderSettingssetExpandEntityReferences(boolean bExpandEntityReferences) final DOMReaderSettingssetFeatureValue(EXMLParserFeature eFeature, boolean bValue) final DOMReaderSettingssetFeatureValue(EXMLParserFeature eFeature, Boolean aValue) final DOMReaderSettingssetFeatureValues(Map<EXMLParserFeature, Boolean> aValues) final DOMReaderSettingssetIgnoringComments(boolean bIgnoringComments) final DOMReaderSettingssetIgnoringElementContentWhitespace(boolean bIgnoringElementContentWhitespace) final DOMReaderSettingssetNamespaceAware(boolean bNamespaceAware) final DOMReaderSettingssetPropertyValue(EXMLParserProperty eProperty, Object aPropertyValue) final DOMReaderSettingssetPropertyValues(Map<EXMLParserProperty, ?> aProperties) final DOMReaderSettingssetRequiresNewXMLParserExplicitly(boolean bRequiresNewXMLParserExplicitly) final DOMReaderSettingsfinal DOMReaderSettingssetValidating(boolean bValidating) final DOMReaderSettingssetXIncludeAware(boolean bXIncludeAware) toString()
-
Constructor Details
-
DOMReaderSettings
public DOMReaderSettings()Constructor using the default settings fromDOMReaderDefaultSettings. -
DOMReaderSettings
Copy constructor.- Parameters:
aOther- The settings object to copy from. May not benull.
-
-
Method Details
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAwarein interfaceIDOMReaderSettings- Returns:
trueif the parser should be namespace aware,falseif not.
-
setNamespaceAware
-
isValidating
public boolean isValidating()- Specified by:
isValidatingin interfaceIDOMReaderSettings- Returns:
trueif the parser should be validating,falseif not.
-
setValidating
-
isIgnoringElementContentWhitespace
public boolean isIgnoringElementContentWhitespace()- Specified by:
isIgnoringElementContentWhitespacein interfaceIDOMReaderSettings- Returns:
trueif the parser should be element content whitespace ignoring,falseif not.
-
setIgnoringElementContentWhitespace
@Nonnull public final DOMReaderSettings setIgnoringElementContentWhitespace(boolean bIgnoringElementContentWhitespace) -
isExpandEntityReferences
public boolean isExpandEntityReferences()- Specified by:
isExpandEntityReferencesin interfaceIDOMReaderSettings- Returns:
trueif the parser should expand entity references,falseif not.
-
setExpandEntityReferences
-
isIgnoringComments
public boolean isIgnoringComments()- Specified by:
isIgnoringCommentsin interfaceIDOMReaderSettings- Returns:
trueif the parser should ignore comments,falseif not.
-
setIgnoringComments
-
isCoalescing
public boolean isCoalescing()- Specified by:
isCoalescingin interfaceIDOMReaderSettings- Returns:
trueif the parser should read CDATA as text,falseif not.
-
setCoalescing
-
getSchema
- Specified by:
getSchemain interfaceIDOMReaderSettings- Returns:
- A special XML schema to be used or
nullif none should be used.
-
setSchema
-
isXIncludeAware
public boolean isXIncludeAware()- Specified by:
isXIncludeAwarein interfaceIDOMReaderSettings- Returns:
trueif the parser should be XInclude aware,falseif not.
-
setXIncludeAware
-
hasAnyProperties
public boolean hasAnyProperties()- Specified by:
hasAnyPropertiesin interfaceIBaseXMLReaderSettings- Returns:
trueif at least one parser property is defined
-
getPropertyValue
Description copied from interface:IBaseXMLReaderSettingsGet the value of the specified parser property- Specified by:
getPropertyValuein interfaceIBaseXMLReaderSettings- Parameters:
eProperty- The property to use. May benull.- Returns:
nullif no such property was found.
-
getAllPropertyValues
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsMap<EXMLParserProperty,Object> getAllPropertyValues()- Specified by:
getAllPropertyValuesin interfaceIBaseXMLReaderSettings- Returns:
- A copy of all contained parser property values. Never
null.
-
setPropertyValue
@Nonnull public final DOMReaderSettings setPropertyValue(@Nonnull EXMLParserProperty eProperty, @Nullable Object aPropertyValue) -
setPropertyValues
@Nonnull public final DOMReaderSettings setPropertyValues(@Nullable Map<EXMLParserProperty, ?> aProperties) -
removePropertyValue
-
removeAllPropertyValues
-
getLocale
- Specified by:
getLocalein interfaceIBaseXMLReaderSettings- Returns:
- The locale to be used for error messages. By default it is
nulland therefore the XML parser will use the system default locale.
-
setLocale
-
hasAnyFeature
public boolean hasAnyFeature()- Specified by:
hasAnyFeaturein interfaceIBaseXMLReaderSettings- Returns:
trueif at least one parser feature is defined,falseif not
-
getFeatureValue
Description copied from interface:IBaseXMLReaderSettingsGet the value of the specified parser feature- Specified by:
getFeatureValuein interfaceIBaseXMLReaderSettings- Parameters:
eFeature- The feature to search. May benull.- Returns:
nullif this feature is undefined.
-
getAllFeatureValues
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsMap<EXMLParserFeature,Boolean> getAllFeatureValues()- Specified by:
getAllFeatureValuesin interfaceIBaseXMLReaderSettings- Returns:
- A copy of all defined parser features at the associated values.
-
setFeatureValue
@Nonnull public final DOMReaderSettings setFeatureValue(@Nonnull EXMLParserFeature eFeature, boolean bValue) -
setFeatureValue
@Nonnull public final DOMReaderSettings setFeatureValue(@Nonnull EXMLParserFeature eFeature, @Nullable Boolean aValue) -
setFeatureValues
@Nonnull public final DOMReaderSettings setFeatureValues(@Nullable Map<EXMLParserFeature, Boolean> aValues) -
removeFeature
-
removeFeatures
-
removeAllFeatures
-
requiresNewXMLParser
public boolean requiresNewXMLParser()Description copied from interface:IDOMReaderSettingsCheck if the current settings require a separateDocumentBuilderFactoryor if a pooled default object can be used.- Specified by:
requiresNewXMLParserin interfaceIBaseXMLReaderSettings- Specified by:
requiresNewXMLParserin interfaceIDOMReaderSettings- Returns:
trueif a separateDocumentBuilderFactoryis required,falseif not.
-
getEntityResolver
- Specified by:
getEntityResolverin interfaceIBaseXMLReaderSettings- Returns:
- The special entity resolver to be used. May be
null.
-
setEntityResolver
-
getErrorHandler
- Specified by:
getErrorHandlerin interfaceIBaseXMLReaderSettings- Returns:
- A special error handler to be used or
nullif no special error handler is needed.
-
setErrorHandler
-
exceptionCallbacks
@Nonnull public com.helger.commons.callback.CallbackList<com.helger.commons.callback.exception.IExceptionCallback<Throwable>> exceptionCallbacks()- Specified by:
exceptionCallbacksin interfaceIBaseXMLReaderSettings- Returns:
- A special exception handler to be used. Never
null.
-
isRequiresNewXMLParserExplicitly
public boolean isRequiresNewXMLParserExplicitly()- Specified by:
isRequiresNewXMLParserExplicitlyin interfaceIDOMReaderSettings- Returns:
trueif a new XML parser is explicitly required for this instance.
-
setRequiresNewXMLParserExplicitly
@Nonnull public final DOMReaderSettings setRequiresNewXMLParserExplicitly(boolean bRequiresNewXMLParserExplicitly) -
getClone
- Specified by:
getClonein interfacecom.helger.commons.lang.ICloneable<DOMReaderSettings>
-
applyToDocumentBuilderFactory
Description copied from interface:IDOMReaderSettingsApply settings of this object onto the specifiedDocumentBuilderFactoryobject.- Specified by:
applyToDocumentBuilderFactoryin interfaceIDOMReaderSettings- Parameters:
aDocumentBuilderFactory- TheDocumentBuilderFactoryto apply the settings onto. May not benull.
-
applyToDocumentBuilder
Description copied from interface:IDOMReaderSettingsApply settings of this object onto the specifiedDocumentBuilderobject.- Specified by:
applyToDocumentBuilderin interfaceIDOMReaderSettings- Parameters:
aDocumentBuilder- TheDocumentBuilderto apply the settings onto. May not benull.
-
toString
-