org.apache.neethi
Class PolicyReference

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

public class PolicyReference
extends java.lang.Object
implements PolicyComponent

PolicyReference is a wrapper that holds explict PolicyReferences.


Constructor Summary
PolicyReference()
           
 
Method Summary
 boolean equal(PolicyComponent policyComponent)
          Returns true if the argument is equal to self.
 short getType()
          Returns short value of Constants.TYPE_POLICY_REF
 java.lang.String getURI()
          Gets the Policy URI that is refered 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 refered by self.
 void serialize(javax.xml.stream.XMLStreamWriter writer)
          Serializes the PolicyComponent using an XMLStreamWriter.
 void setURI(java.lang.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()
Method Detail

setURI

public void setURI(java.lang.String uri)
Sets the Policy URI

Parameters:
uri - the Policy URI

getURI

public java.lang.String getURI()
Gets the Policy URI that is refered by self.

Returns:
a String that is the Policy URI refered 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:
ture 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.POLICY for Policy type PolicyComponent Constants.EXACTLYONE for ExactlyOne type PolicyComponent Constants.ALL for All type PolicyComponent Constants.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 refered by self. The specified PolicyRegistry is used to lookup for the Policy that is refered and dee indicates the level of normalization fo the returning Policy.

Parameters:
reg - the PolicyRegistry that is used to resolved the Policy refered by self
deep - the falg to indicate whether returning Policy should be fully normailized
Returns:
the normalized version fo 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.


Copyright © 2004-2009 Apache Software Foundation. All Rights Reserved.