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
Constructors Constructor Description DOMReaderSettings()Constructor using the default settings fromDOMReaderDefaultSettings.DOMReaderSettings(IDOMReaderSettings aOther)Copy constructor.
-
Method Summary
-
-
-
Constructor Detail
-
DOMReaderSettings
public DOMReaderSettings()
Constructor using the default settings fromDOMReaderDefaultSettings.
-
DOMReaderSettings
public DOMReaderSettings(@Nonnull IDOMReaderSettings aOther)
Copy constructor.- Parameters:
aOther- The settings object to copy from. May not benull.
-
-
Method Detail
-
isNamespaceAware
public boolean isNamespaceAware()
- Specified by:
isNamespaceAwarein interfaceIDOMReaderSettings- Returns:
trueif the parser should be namespace aware,falseif not.
-
setNamespaceAware
@Nonnull public final DOMReaderSettings setNamespaceAware(boolean bNamespaceAware)
-
isValidating
public boolean isValidating()
- Specified by:
isValidatingin interfaceIDOMReaderSettings- Returns:
trueif the parser should be validating,falseif not.
-
setValidating
@Nonnull public final DOMReaderSettings setValidating(boolean bValidating)
-
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
@Nonnull public final DOMReaderSettings setExpandEntityReferences(boolean bExpandEntityReferences)
-
isIgnoringComments
public boolean isIgnoringComments()
- Specified by:
isIgnoringCommentsin interfaceIDOMReaderSettings- Returns:
trueif the parser should ignore comments,falseif not.
-
setIgnoringComments
@Nonnull public final DOMReaderSettings setIgnoringComments(boolean bIgnoringComments)
-
isCoalescing
public boolean isCoalescing()
- Specified by:
isCoalescingin interfaceIDOMReaderSettings- Returns:
trueif the parser should read CDATA as text,falseif not.
-
setCoalescing
@Nonnull public final DOMReaderSettings setCoalescing(boolean bCoalescing)
-
getSchema
@Nullable public Schema getSchema()
- Specified by:
getSchemain interfaceIDOMReaderSettings- Returns:
- A special XML schema to be used or
nullif none should be used.
-
setSchema
@Nonnull public final DOMReaderSettings setSchema(@Nullable Schema aSchema)
-
isXIncludeAware
public boolean isXIncludeAware()
- Specified by:
isXIncludeAwarein interfaceIDOMReaderSettings- Returns:
trueif the parser should be XInclude aware,falseif not.
-
setXIncludeAware
@Nonnull public final DOMReaderSettings setXIncludeAware(boolean bXIncludeAware)
-
hasAnyProperties
public boolean hasAnyProperties()
- Specified by:
hasAnyPropertiesin interfaceIBaseXMLReaderSettings- Returns:
trueif at least one parser property is defined
-
getPropertyValue
@Nullable public Object getPropertyValue(@Nullable EXMLParserProperty eProperty)
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
@Nonnull public final com.helger.commons.state.EChange removePropertyValue(@Nullable EXMLParserProperty eProperty)
-
removeAllPropertyValues
@Nonnull public final com.helger.commons.state.EChange removeAllPropertyValues()
-
getLocale
@Nullable public Locale 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
@Nonnull public DOMReaderSettings setLocale(@Nullable Locale aLocale)
-
hasAnyFeature
public boolean hasAnyFeature()
- Specified by:
hasAnyFeaturein interfaceIBaseXMLReaderSettings- Returns:
trueif at least one parser feature is defined,falseif not
-
getFeatureValue
@Nullable public Boolean getFeatureValue(@Nullable EXMLParserFeature eFeature)
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
@Nonnull public final com.helger.commons.state.EChange removeFeature(@Nullable EXMLParserFeature eFeature)
-
removeAllFeatures
@Nonnull public final com.helger.commons.state.EChange 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
@Nullable public EntityResolver getEntityResolver()
- Specified by:
getEntityResolverin interfaceIBaseXMLReaderSettings- Returns:
- The special entity resolver to be used. May be
null.
-
setEntityResolver
@Nonnull public final DOMReaderSettings setEntityResolver(@Nullable EntityResolver aEntityResolver)
-
getErrorHandler
@Nullable public ErrorHandler getErrorHandler()
- Specified by:
getErrorHandlerin interfaceIBaseXMLReaderSettings- Returns:
- A special error handler to be used or
nullif no special error handler is needed.
-
setErrorHandler
@Nonnull public final DOMReaderSettings setErrorHandler(@Nullable ErrorHandler aErrorHandler)
-
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
@Nonnull public DOMReaderSettings getClone()
- Specified by:
getClonein interfacecom.helger.commons.lang.ICloneable<DOMReaderSettings>
-
applyToDocumentBuilderFactory
public void applyToDocumentBuilderFactory(@Nonnull DocumentBuilderFactory aDocumentBuilderFactory)
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
public void applyToDocumentBuilder(@Nonnull DocumentBuilder aDocumentBuilder)
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.
-
-