public final class AssertionSet extends java.lang.Object implements java.lang.Iterable<PolicyAssertion>, java.lang.Comparable<AssertionSet>
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Comparator<PolicyAssertion> |
ASSERTION_COMPARATOR
The comparator comapres policy assertions according to their publicly accessible attributes, in the following
order of attributes:
1.
|
private java.util.List<PolicyAssertion> |
assertions |
private static AssertionSet |
EMPTY_ASSERTION_SET |
private java.util.Collection<javax.xml.namespace.QName> |
immutableVocabulary |
private java.util.Set<javax.xml.namespace.QName> |
vocabulary |
| Modifier | Constructor and Description |
|---|---|
private |
AssertionSet(java.util.Collection<AssertionSet> alternatives) |
private |
AssertionSet(java.util.List<PolicyAssertion> list) |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
add(PolicyAssertion assertion) |
private boolean |
addAll(java.util.Collection<? extends PolicyAssertion> assertions) |
private boolean |
areAssertionsCompatible(AssertionSet alternative,
PolicyIntersector.CompatibilityMode mode) |
int |
compareTo(AssertionSet that)
An
Comparable<T>.compareTo(T o) interface method implementation. |
boolean |
contains(javax.xml.namespace.QName assertionName)
Returns true if the assertion set contains the assertion name specified in its vocabulary
|
static AssertionSet |
createAssertionSet(java.util.Collection<? extends PolicyAssertion> assertions)
Creates and returns new assertion set holding a set of provided policy assertions.
|
static AssertionSet |
createMergedAssertionSet(java.util.Collection<AssertionSet> alternatives)
Creates and returns new assertion set holding content of all provided policy assertion sets.
|
static AssertionSet |
emptyAssertionSet() |
boolean |
equals(java.lang.Object obj)
An
Object.equals(Object obj) method override. |
java.util.Collection<PolicyAssertion> |
get(javax.xml.namespace.QName name)
Searches for assertions with given name.
|
(package private) java.util.Collection<PolicyAssertion> |
getAssertions()
Return all assertions contained in this assertion set.
|
(package private) java.util.Collection<javax.xml.namespace.QName> |
getVocabulary()
Retrieves the vocabulary of this policy expression.
|
int |
hashCode()
An
Object.hashCode() method override. |
(package private) boolean |
isCompatibleWith(AssertionSet alternative,
PolicyIntersector.CompatibilityMode mode)
Checks whether this policy alternative is compatible with the provided policy alternative.
|
boolean |
isEmpty()
Returns
true if this assertion set contains no assertions. |
java.util.Iterator<PolicyAssertion> |
iterator()
Returns an iterator over a set of child policy assertion objects.
|
java.lang.String |
toString()
An
Object.toString() method override. |
(package private) java.lang.StringBuffer |
toString(int indentLevel,
java.lang.StringBuffer buffer)
A helper method that appends indented string representation of this instance to the input string buffer.
|
private static final AssertionSet EMPTY_ASSERTION_SET
private static final java.util.Comparator<PolicyAssertion> ASSERTION_COMPARATOR
private final java.util.List<PolicyAssertion> assertions
private final java.util.Set<javax.xml.namespace.QName> vocabulary
private final java.util.Collection<javax.xml.namespace.QName> immutableVocabulary
private AssertionSet(java.util.List<PolicyAssertion> list)
private AssertionSet(java.util.Collection<AssertionSet> alternatives)
private boolean add(PolicyAssertion assertion)
private boolean addAll(java.util.Collection<? extends PolicyAssertion> assertions)
java.util.Collection<PolicyAssertion> getAssertions()
java.util.Collection<javax.xml.namespace.QName> getVocabulary()
boolean isCompatibleWith(AssertionSet alternative, PolicyIntersector.CompatibilityMode mode)
alternative - policy alternative used for compatibility testmode - compatibility mode to be usedtrue if the two policy alternatives are compatible, false otherwiseprivate boolean areAssertionsCompatible(AssertionSet alternative, PolicyIntersector.CompatibilityMode mode)
public static AssertionSet createMergedAssertionSet(java.util.Collection<AssertionSet> alternatives)
alternatives - collection of provided policy assertion sets which content is to be stored in the assertion set.
May be null - empty assertion set is returned in such case.public static AssertionSet createAssertionSet(java.util.Collection<? extends PolicyAssertion> assertions)
assertions - collection of provided policy assertions to be stored in the assertion set. May be null.public static AssertionSet emptyAssertionSet()
public java.util.Iterator<PolicyAssertion> iterator()
iterator in interface java.lang.Iterable<PolicyAssertion>public java.util.Collection<PolicyAssertion> get(javax.xml.namespace.QName name)
name - The fully qualified name of searched assertionnull value is never returned).public boolean isEmpty()
true if this assertion set contains no assertions.true if this assertion set contains no assertions.public boolean contains(javax.xml.namespace.QName assertionName)
assertionName - the fully qualified name of the assertiontrue, if an assertion with the given name could be found in the assertion set vocabulary false otherwise.public int compareTo(AssertionSet that)
Comparable<T>.compareTo(T o) interface method implementation.compareTo in interface java.lang.Comparable<AssertionSet>that - other alternative to compare withpublic boolean equals(java.lang.Object obj)
Object.equals(Object obj) method override.equals in class java.lang.Objectpublic int hashCode()
Object.hashCode() method override.hashCode in class java.lang.Objectpublic java.lang.String toString()
Object.toString() method override.toString in class java.lang.Objectjava.lang.StringBuffer toString(int indentLevel,
java.lang.StringBuffer buffer)
indentLevel - indentation level to be used.buffer - buffer to be used for appending string representation of this instance