View Javadoc
1   /*
2    * Copyright 2009 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.commons.xml;
17  
18  import java.util.Map;
19  
20  /**
21   * Interface for combined (XML Schema + Schematron) validation profiles.
22   * @author Dmytro Rud
23   */
24  public interface CombinedXmlValidationProfile {
25  
26      /**
27       * @param rootElementName
28       *      local name of root XML element of the document that is being validated.
29       * @return
30       *      <code>true</code> when the given element name is acceptable,
31       *      <code>false</code> otherwise
32       */
33      boolean isValidRootElement(String rootElementName);
34  
35      /**
36       * @param rootElementName
37       *      local name of root XML element of the document that is being validated
38       *      (already checked for acceptance).
39       * @return
40       *      path to XML Schema definition for the given XML root element,
41       *      or <code>null</code>, when no XML Schema validation should be performed.
42       */
43      String getXsdPath(String rootElementName);
44  
45      /**
46       * @param rootElementName
47       *      local name of root XML element of the document that is being validated.
48       *      (already checked for acceptance).
49       * @return
50       *      path to Schematron template for the given XML root element,
51       *      or <code>null</code>, when no Schematron validation should be performed.
52       */
53      String getSchematronPath(String rootElementName);
54  
55      /**
56       * @param rootElementName
57       *      local name of root XML element of the document that is being validated.
58       *      (already checked for acceptance).
59       * @return
60       *      a map containing custom Schematron validation parameters,
61       *      or <code>null</code>, when such parameters are not necessary.
62       */
63      Map<String, Object> getCustomSchematronParameters(String rootElementName);
64  }