public abstract class Policy extends Object implements Serializable, Comparable<Policy>
Modifier and Type | Class and Description |
---|---|
static class |
Policy.MappingXdiEntityPolicyAndIterator |
static class |
Policy.MappingXdiEntityPolicyIterator |
static class |
Policy.MappingXdiEntityPolicyNotIterator |
static class |
Policy.MappingXdiEntityPolicyOrIterator |
static class |
Policy.MappingXdiEntityPolicyRootIterator |
Modifier | Constructor and Description |
---|---|
protected |
Policy(XdiEntity xdiEntity) |
Modifier and Type | Method and Description |
---|---|
static Policy |
castCondition(Policy policy)
Factory method that casts a Policy to the right subclass, e.g. to a PolicyAnd.
|
int |
compareTo(Policy other) |
PolicyAnd |
createAndPolicy(boolean singleton)
Creates an XDI $and policy.
|
PolicyNot |
createNotPolicy(boolean singleton)
Creates an XDI $not policy.
|
PolicyOr |
createOrPolicy(boolean singleton)
Creates an XDI $or policy.
|
boolean |
equals(Object object) |
boolean |
evaluate(PolicyEvaluationContext policyEvaluationContext)
Checks if the XDI policy evaluates to true or false.
|
protected abstract boolean |
evaluateInternal(PolicyEvaluationContext policyEvaluationContext) |
static Policy |
fromXdiEntity(XdiEntity xdiEntity)
Factory method that creates an XDI policy bound to a given XDI entity.
|
ContextNode |
getContextNode()
Returns the underlying context node to which this XDI policy is bound.
|
ReadOnlyIterator<Operator> |
getOperators()
Returns the XDI operators underneath this XDI policy.
|
ReadOnlyIterator<Policy> |
getPolicies()
Returns the XDI policies underneath this XDI policy.
|
XDIArc |
getPolicyXDIArc()
Returns the policy arc of the XDI policy (e.g.
|
XdiEntity |
getXdiEntity()
Returns the underlying XDI entity to which this XDI policy is bound.
|
int |
hashCode() |
static boolean |
isValid(XdiEntity xdiEntity)
Checks if an XDI entity is a valid XDI policy.
|
String |
toString() |
protected Policy(XdiEntity xdiEntity)
public static boolean isValid(XdiEntity xdiEntity)
xdiEntity
- The XDI entity to check.public static Policy fromXdiEntity(XdiEntity xdiEntity)
xdiEntity
- The XDI entity that is an XDI policy.public static Policy castCondition(Policy policy)
policy
- The Policy to be cast.public XdiEntity getXdiEntity()
public ContextNode getContextNode()
public XDIArc getPolicyXDIArc()
public PolicyAnd createAndPolicy(boolean singleton)
public PolicyOr createOrPolicy(boolean singleton)
public PolicyNot createNotPolicy(boolean singleton)
public ReadOnlyIterator<Policy> getPolicies()
public ReadOnlyIterator<Operator> getOperators()
public final boolean evaluate(PolicyEvaluationContext policyEvaluationContext)
policyEvaluationContext
- An object that can locate context nodes.protected abstract boolean evaluateInternal(PolicyEvaluationContext policyEvaluationContext)
public int compareTo(Policy other)
compareTo
in interface Comparable<Policy>
Copyright © 2017. All rights reserved.