001/* 002 * Copyright 2014 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.plugins.contentio.in.xml; 017 018import java.io.IOException; 019import java.io.InputStream; 020 021import org.w3c.dom.Document; 022 023import org.ametys.plugins.contentio.in.ContentImporter; 024 025/** 026 * {@link ContentImporter} which imports contents from XML files.<br> 027 * The {@link #supports(Document)} method is used instead of the {@link #supports(InputStream, String)}, 028 * so that the XML file is parsed only once. 029 */ 030public interface XmlContentImporter extends ContentImporter 031{ 032 /** 033 * Tests if the {@link XmlContentImporter} is able to import the corresponding Document. 034 * @param document the XML {@link Document} to test. 035 * @return true if the {@link XmlContentImporter} can import the corresponding stream, false otherwise. 036 * @throws IOException if an error occurs. 037 */ 038 public boolean supports(Document document) throws IOException; 039 040}