com.helger.xml.serialize.read.IDOMReaderSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ph-xml Show documentation
Show all versions of ph-xml Show documentation
Java 1.8+ Library with XML handling routines
/*
* Copyright (C) 2014-2024 Philip Helger (www.helger.com)
* philip[at]helger[dot]com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.helger.xml.serialize.read;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.validation.Schema;
/**
* Read-only interface for DOM reader settings.
*
* @author Philip Helger
*/
public interface IDOMReaderSettings extends IBaseXMLReaderSettings
{
/**
* @return true
if the parser should be namespace aware,
* false
if not.
*/
boolean isNamespaceAware ();
/**
* @return true
if the parser should be validating,
* false
if not.
*/
boolean isValidating ();
/**
* @return true
if the parser should be element content
* whitespace ignoring, false
if not.
*/
boolean isIgnoringElementContentWhitespace ();
/**
* @return true
if the parser should expand entity references,
* false
if not.
*/
boolean isExpandEntityReferences ();
/**
* @return true
if the parser should ignore comments,
* false
if not.
*/
boolean isIgnoringComments ();
/**
* @return true
if the parser should read CDATA as text,
* false
if not.
*/
boolean isCoalescing ();
/**
* @return A special XML schema to be used or null
if none should
* be used.
*/
@Nullable
Schema getSchema ();
/**
* @return true
if the parser should be XInclude aware,
* false
if not.
*/
boolean isXIncludeAware ();
/**
* @return true
if a new XML parser is explicitly required for
* this instance.
*/
boolean isRequiresNewXMLParserExplicitly ();
/**
* Check if the current settings require a separate
* {@link javax.xml.parsers.DocumentBuilderFactory} or if a pooled default
* object can be used.
*
* @return true
if a separate
* {@link javax.xml.parsers.DocumentBuilderFactory} is required,
* false
if not.
*/
boolean requiresNewXMLParser ();
/**
* Apply settings of this object onto the specified
* {@link DocumentBuilderFactory} object.
*
* @param aDBF
* The {@link DocumentBuilderFactory} to apply the settings onto. May
* not be null
.
*/
void applyToDocumentBuilderFactory (@Nonnull DocumentBuilderFactory aDBF);
/**
* Apply settings of this object onto the specified {@link DocumentBuilder}
* object.
*
* @param aDB
* The {@link DocumentBuilder} to apply the settings onto. May not be
* null
.
*/
void applyToDocumentBuilder (@Nonnull DocumentBuilder aDB);
}