org.apache.xml.security.encryption
Class ReferenceList

java.lang.Object
  extended byorg.apache.xml.security.encryption.ReferenceList

public class ReferenceList
extends java.lang.Object

ReferenceList is an element that contains pointers from a key value of an EncryptedKey to items encrypted by that key value (EncryptedData or EncryptedKey elements).

It is defined as follows:

<element name='ReferenceList'> <complexType> <choice minOccurs='1' maxOccurs='unbounded'> <element name='DataReference' type='xenc:ReferenceType'/> <element name='KeyReference' type='xenc:ReferenceType'/> </choice> </complexType> </element>

Author:
Axl Mattheus
See Also:
Reference.

Field Summary
static int DATA_REFERENCE
           
static int KEY_REFERENCE
           
 
Constructor Summary
ReferenceList(int type)
          Returns an instance of ReferenceList, initialized with the appropriate parameters.
 
Method Summary
 void add(Reference reference)
          Adds a reference to this reference list.
 java.util.Iterator getReferences()
          Returns an Iterator over all the References contatined in this ReferenceList.
 boolean isEmpty()
          Indicates if the ReferenceList is empty.
static Reference newDataReference(java.lang.String uri)
          DataReference factory method.
static Reference newKeyReference(java.lang.String uri)
          KeyReference factory method.
 void remove(Reference reference)
          Removes a reference from the ReferenceList.
 int size()
          Returns the size of the ReferenceList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_REFERENCE

public static final int DATA_REFERENCE
See Also:
Constant Field Values

KEY_REFERENCE

public static final int KEY_REFERENCE
See Also:
Constant Field Values
Constructor Detail

ReferenceList

public ReferenceList(int type)
Returns an instance of ReferenceList, initialized with the appropriate parameters.

Parameters:
type - the type of references this ReferenceList will hold.
Method Detail

add

public void add(Reference reference)
Adds a reference to this reference list.

Parameters:
reference - the reference to add.
Throws:
IllegalArgurmentException - if the Reference is not an instance of DataReference or KeyReference.

remove

public void remove(Reference reference)
Removes a reference from the ReferenceList.

Parameters:
reference - the reference to remove.

size

public int size()
Returns the size of the ReferenceList.

Returns:
the size of the ReferenceList.

isEmpty

public boolean isEmpty()
Indicates if the ReferenceList is empty.

Returns:
true if the ReferenceList is empty, else false.

getReferences

public java.util.Iterator getReferences()
Returns an Iterator over all the References contatined in this ReferenceList.

Returns:
Iterator.

newDataReference

public static Reference newDataReference(java.lang.String uri)
DataReference factory method. Returns a DataReference.


newKeyReference

public static Reference newKeyReference(java.lang.String uri)
KeyReference factory method. Returns a KeyReference.