Package com.helger.xml.serialize.read
Class SAXReaderSettings
- java.lang.Object
-
- com.helger.xml.serialize.read.SAXReaderSettings
-
- All Implemented Interfaces:
com.helger.commons.lang.ICloneable<SAXReaderSettings>,IBaseXMLReaderSettings,ISAXReaderSettings
@NotThreadSafe public class SAXReaderSettings extends Object implements ISAXReaderSettings, com.helger.commons.lang.ICloneable<SAXReaderSettings>
SAX reader settings- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description SAXReaderSettings()Default constructorSAXReaderSettings(ISAXReaderSettings aOther)Copy constructor
-
Method Summary
-
-
-
Constructor Detail
-
SAXReaderSettings
public SAXReaderSettings()
Default constructor
-
SAXReaderSettings
public SAXReaderSettings(@Nonnull ISAXReaderSettings aOther)
Copy constructor- Parameters:
aOther- the object to copy the settings from. May not benull.
-
-
Method Detail
-
getEntityResolver
@Nullable public EntityResolver getEntityResolver()
- Specified by:
getEntityResolverin interfaceIBaseXMLReaderSettings- Returns:
- The special entity resolver to be used. May be
null.
-
setEntityResolver
@Nonnull public final SAXReaderSettings setEntityResolver(@Nullable EntityResolver aEntityResolver)
-
getDTDHandler
@Nullable public DTDHandler getDTDHandler()
- Specified by:
getDTDHandlerin interfaceISAXReaderSettings- Returns:
- The special DTD handler to be used. May be
null.
-
setDTDHandler
@Nonnull public final SAXReaderSettings setDTDHandler(@Nullable DTDHandler aDTDHandler)
-
getContentHandler
@Nullable public ContentHandler getContentHandler()
- Specified by:
getContentHandlerin interfaceISAXReaderSettings- Returns:
- The special content handler to be used. May be
null.
-
setContentHandler
@Nonnull public final SAXReaderSettings setContentHandler(@Nullable ContentHandler aContentHandler)
-
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 SAXReaderSettings setErrorHandler(@Nullable ErrorHandler aErrorHandler)
-
getLexicalHandler
@Nullable public LexicalHandler getLexicalHandler()
- Specified by:
getLexicalHandlerin interfaceISAXReaderSettings- Returns:
- The special lexical handler to be used. May be
null.
-
setLexicalHandler
@Nonnull public final SAXReaderSettings setLexicalHandler(@Nullable LexicalHandler aLexicalHandler)
-
getDeclarationHandler
@Nullable public DeclHandler getDeclarationHandler()
- Specified by:
getDeclarationHandlerin interfaceISAXReaderSettings- Returns:
- The special DTD declaration event handler to be used. May be
null.
-
setDeclarationHandler
@Nonnull public final SAXReaderSettings setDeclarationHandler(@Nullable DeclHandler aDeclHandler)
-
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 SAXReaderSettings setPropertyValue(@Nonnull EXMLParserProperty eProperty, @Nullable Object aPropertyValue)
-
setPropertyValues
@Nonnull public final SAXReaderSettings 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
public SAXReaderSettings 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 SAXReaderSettings setFeatureValue(@Nonnull EXMLParserFeature eFeature, boolean bValue)
-
setFeatureValue
@Nonnull public final SAXReaderSettings setFeatureValue(@Nonnull EXMLParserFeature eFeature, @Nullable Boolean aValue)
-
setFeatureValues
@Nonnull public final SAXReaderSettings 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:ISAXReaderSettingsCheck if the current settings require a separateDocumentBuilderFactoryor if a pooled default object can be used.- Specified by:
requiresNewXMLParserin interfaceIBaseXMLReaderSettings- Specified by:
requiresNewXMLParserin interfaceISAXReaderSettings- Returns:
trueif a separateDocumentBuilderFactoryis required,falseif not.
-
exceptionCallbacks
@Nonnull @ReturnsMutableObject 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 interfaceISAXReaderSettings- Returns:
trueif a new XML parser is explicitly required for this instance.
-
setRequiresNewXMLParserExplicitly
@Nonnull public final SAXReaderSettings setRequiresNewXMLParserExplicitly(boolean bRequiresNewXMLParserExplicitly)
-
getClone
@Nonnull public SAXReaderSettings getClone()
- Specified by:
getClonein interfacecom.helger.commons.lang.ICloneable<SAXReaderSettings>
-
applyToSAXReader
public void applyToSAXReader(@Nonnull XMLReader aParser)
Description copied from interface:ISAXReaderSettingsApply all settings of this object onto the specified XMLReader object- Specified by:
applyToSAXReaderin interfaceISAXReaderSettings- Parameters:
aParser- The XML reader to apply the settings onto. May not benull.
-
createCloneOnDemand
@Nonnull public static SAXReaderSettings createCloneOnDemand(@Nullable ISAXReaderSettings aOther)
Create a clone of the passed settings, depending on the parameter. If the parameter isnulla new emptySAXReaderSettingsobject is created, otherwise a copy of the parameter is created.- Parameters:
aOther- The parameter to be used. May benull.- Returns:
- Never
null.
-
-