1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.neethi.builders;
17
18 import javax.xml.namespace.QName;
19
20 import org.apache.axiom.om.OMElement;
21 import org.apache.neethi.Assertion;
22 import org.apache.neethi.AssertionBuilderFactory;
23
24 /**
25 * AssertionBuilder is the interface which must implement by any
26 * CustomAssertionBuilder. It defines a single method which takes an OMElement
27 * and an AssertionFactory instace and creates an Assertion from the given
28 * OMElement. Custom AssertionBuilder authors can use the AssertionFactory
29 * specified to build Assertions for any unknown OMElements inside the given
30 * OMElement. They are given the opportunity to control the behaviour of
31 * Assertion operations based on the corresponding domain policy assertion of
32 * the given OMElement and the level of its processing.
33 *
34 */
35 public interface AssertionBuilder {
36
37 /**
38 * Constructs an assertion from a known OMElement. If that element contains
39 * other child elements that the Builder doesn't understand, it uses the
40 * AssertionBuilderFactory to construct assertions from them.
41 *
42 * @param element
43 * the known element from which an assertion can be built
44 * @param factory
45 * the factory from which AssertionBuilders are taken to build
46 * assertion from unknown child elements
47 * @return an Assertion built from the given element
48 * @throws IllegalArgumentException
49 * if the given element is malformed
50 */
51 public Assertion build(OMElement element, AssertionBuilderFactory factory)
52 throws IllegalArgumentException;
53
54 /**
55 * Returns an array of QNames of OMElements from which assertion can be
56 * built by this AssertionFactory.
57 *
58 * @return an array of QNames of known OMElements
59 */
60 public QName[] getKnownElements();
61 }