All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.phloc.commons.xml.serialize.IDOMReaderSettings Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show newest version
/**
 * Copyright (C) 2006-2015 phloc systems
 * http://www.phloc.com
 * office[at]phloc[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.phloc.commons.xml.serialize;

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 final 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 final DocumentBuilder aDB);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy