1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.neethi;
17
18 import javax.xml.stream.XMLStreamException;
19 import javax.xml.stream.XMLStreamWriter;
20
21 /**
22 * This is an interface which any component of the framework must implement.
23 */
24 public interface PolicyComponent {
25
26 /**
27 * Serializes the PolicyComponent using an XMLStreamWriter.
28 *
29 * @param writer the writer that the component should write itself
30 * @throws XMLStreamException if an errors in the process of serialization of the
31 * PolicyComponent.
32 */
33 public void serialize(XMLStreamWriter writer) throws XMLStreamException;
34
35 /**
36 * Returns a short value which uniquely identify the type of the
37 * PolicyComponent.
38 *
39 * @return Constants.POLICY for Policy type PolicyComponent
40 * Constants.EXACTLYONE for ExactlyOne type PolicyComponent
41 * Constants.ALL for All type PolicyComponent
42 * Constants.ASSERTION for Assertion type PolicyComponent
43 */
44 public short getType();
45
46 /**
47 * Returns true if the argument is equal to self.
48 *
49 * @param policyComponent the PolicyComponent to check whether self is
50 * logically equal or not
51 * @return ture if the argument is equal to self.
52 */
53 public boolean equal(PolicyComponent policyComponent);
54 }