01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.ws.policy;
19:
20: import java.util.Collection;
21:
22: import javax.xml.namespace.QName;
23:
24: import org.w3c.dom.Element;
25:
26: import org.apache.neethi.Assertion;
27:
28: /**
29: * AssertionBuilder is an interface used to build an Assertion object from a
30: * given xml element.
31: * Domain Policy authors write custom AssertionBuilders to build Assertions for
32: * domain specific assertions.
33: * Note that assertions can include nested policy expressions. To build these,
34: * it may be necessary to obtain other AssertionBuilders.
35: * Concrete implementations should access the AssertionBuilderRegistry as a
36: * Bus extension, so the registry need not passed as an argument here.
37: */
38: public interface AssertionBuilder {
39:
40: /**
41: * Constructs an assertion from an xml element.
42: *
43: * @param element the element from which to build an assertion
44: * @return an Assertion built from the given element
45: */
46: Assertion build(Element element);
47:
48: /**
49: * Returns a collection of QNames describing the xml schema types for which this
50: * builder can build assertions.
51: *
52: * @return collection of QNames of known schema types
53: */
54: Collection<QName> getKnownElements();
55:
56: /**
57: * Returns a new assertion that is compatible with the two specified
58: * assertions or null if no compatible assertion can be built.
59: */
60: Assertion buildCompatible(Assertion a, Assertion b);
61: }
|