org.apache.neethi
Class PolicyReference

java.lang.Object
  extended by org.apache.neethi.PolicyReference
All Implemented Interfaces:
PolicyComponent

public class PolicyReference
extends Object
implements PolicyComponent

PolicyReference is a wrapper that holds explicit PolicyReferences.


Constructor Summary
PolicyReference()
           
PolicyReference(PolicyBuilder p)
           
 
Method Summary
 boolean equal(PolicyComponent policyComponent)
          Returns true if the argument is equal to self.
 Policy getRemoteReferencedPolicy(String u)
           
 short getType()
          Returns short value of Constants.TYPE_POLICY_REF
 String getURI()
          Gets the Policy URI that is referred by self.
 PolicyComponent normalize()
          Throws an UnsupportedOperationException since PolicyReference.normalize() can't resolve the Policy that it refers to unless a PolicyRegistry is provided.
 PolicyComponent normalize(PolicyRegistry reg, boolean deep)
          Returns normalized version of the Policy that is referred by self.
 void serialize(javax.xml.stream.XMLStreamWriter writer)
          Serializes the PolicyComponent using an XMLStreamWriter.
 void setURI(String uri)
          Sets the Policy URI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyReference

public PolicyReference()

PolicyReference

public PolicyReference(PolicyBuilder p)
Method Detail

setURI

public void setURI(String uri)
Sets the Policy URI

Parameters:
uri - the Policy URI

getURI

public String getURI()
Gets the Policy URI that is referred by self.

Returns:
a String that is the Policy URI referred by self

equal

public boolean equal(PolicyComponent policyComponent)
Description copied from interface: PolicyComponent
Returns true if the argument is equal to self.

Specified by:
equal in interface PolicyComponent
Parameters:
policyComponent - the PolicyComponent to check whether self is logically equal or not
Returns:
true if the argument is equal to self.

getType

public short getType()
Returns short value of Constants.TYPE_POLICY_REF

Specified by:
getType in interface PolicyComponent
Returns:
Constants.TYPE_POLICY for Policy type PolicyComponent Constants.TYPE_EXACTLYONE for ExactlyOne type PolicyComponent Constants.TYPE_ALL for All type PolicyComponent Constants.TYPE_ASSERTION for Assertion type PolicyComponent

normalize

public PolicyComponent normalize()
Throws an UnsupportedOperationException since PolicyReference.normalize() can't resolve the Policy that it refers to unless a PolicyRegistry is provided.


normalize

public PolicyComponent normalize(PolicyRegistry reg,
                                 boolean deep)
Returns normalized version of the Policy that is referred by self. The specified PolicyRegistry is used to lookup for the Policy that is referred and deep indicates the level of normalization for the returning Policy.

Parameters:
reg - the PolicyRegistry that is used to resolved the Policy referred by self
deep - the flag to indicate whether returning Policy should be fully normalized
Returns:
the normalized version for the Policy refered by self

serialize

public void serialize(javax.xml.stream.XMLStreamWriter writer)
               throws javax.xml.stream.XMLStreamException
Description copied from interface: PolicyComponent
Serializes the PolicyComponent using an XMLStreamWriter.

Specified by:
serialize in interface PolicyComponent
Parameters:
writer - the writer that the component should write itself
Throws:
javax.xml.stream.XMLStreamException - if an errors in the process of serialization of the PolicyComponent.

getRemoteReferencedPolicy

public Policy getRemoteReferencedPolicy(String u)


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.