org.apache.ws.resource.properties
Interface ResourceProperty


public interface ResourceProperty

Represents a single resource property. A resource property can have multiple values and can be converted into a DOM Element or SOAPElement array.


Method Summary
 void add(java.lang.Object value)
          Adds a value.
 void addChangeListener(ResourcePropertyValueChangeListener listener)
          Registers the specified value-change listener on this property.
 void clear()
          Removes all values.
 java.lang.Object get(int index)
          Retrieves a value at a specific index.
 ResourcePropertyCallback getCallBack()
          Returns the callback for this property, or null if no callback has been set.
 ResourcePropertyValueChangeListener[] getChangeListeners()
          Returns the value-change listeners that are registered on this property.
 ResourcePropertyMetaData getMetaData()
          Gets meta data of this resource property.
 ResourcePropertySet getSet()
          Returns the resource property set that contains this property.
 boolean isEmpty()
          Returns true if, and only if, this property contains no elements.
 java.util.Iterator iterator()
          Returns an iterator over the property elements.
 boolean remove(java.lang.Object value)
          Removes the first property element with the specified value.
 void set(int index, java.lang.Object value)
          Sets a value at a specific index.
 void setCallback(ResourcePropertyCallback callback)
          Sets a callback for this property.
 int size()
          Returns the number of values in the resource property.
 org.w3c.dom.Element[] toElements()
          Converts the resource property into an array of DOM Elements.
 javax.xml.soap.SOAPElement[] toSOAPElements()
          Converts the resource property value into an array of SOAPElements.
 java.lang.String toXML()
          Returns the XML representation of this property (i.e.
 

Method Detail

getCallBack

public ResourcePropertyCallback getCallBack()
Returns the callback for this property, or null if no callback has been set.

Returns:
the callback for this property, or null if no callback has been set

setCallback

public void setCallback(ResourcePropertyCallback callback)
Sets a callback for this property.

Parameters:
callback - the callback

getChangeListeners

public ResourcePropertyValueChangeListener[] getChangeListeners()
Returns the value-change listeners that are registered on this property.

Returns:
the value-change listeners that are registered on this property; may be empty, but never null

isEmpty

public boolean isEmpty()
Returns true if, and only if, this property contains no elements.

Returns:
true if, and only if, this property contains no elements

getMetaData

public ResourcePropertyMetaData getMetaData()
Gets meta data of this resource property.

Returns:
meta data of this resource property.

getSet

public ResourcePropertySet getSet()
Returns the resource property set that contains this property.

Returns:
the resource property set that contains this property.

add

public void add(java.lang.Object value)
Adds a value.

Parameters:
value - the value to add.
Throws:
MetaDataViolationException - if the name of the element to be added does not match the name associated with this property

addChangeListener

public void addChangeListener(ResourcePropertyValueChangeListener listener)
Registers the specified value-change listener on this property.

Parameters:
listener - a property value-change listener

clear

public void clear()
Removes all values.


get

public java.lang.Object get(int index)
Retrieves a value at a specific index.

Parameters:
index - the index of value to retrieve.
Returns:
the value at the given index. This operation might fail if the index is out of bounds.

iterator

public java.util.Iterator iterator()
Returns an iterator over the property elements.

Returns:
an iterator over the property elements

remove

public boolean remove(java.lang.Object value)
Removes the first property element with the specified value.

Parameters:
value - value of a property element to remove
Returns:
true if, and only if, a property element was removed

set

public void set(int index,
                java.lang.Object value)
Sets a value at a specific index.

Parameters:
index - the index to set value at.
value - the new value

size

public int size()
Returns the number of values in the resource property.

Returns:
the number of values.

toElements

public org.w3c.dom.Element[] toElements()
                                 throws org.apache.commons.lang.SerializationException
Converts the resource property into an array of DOM Elements. If the RP has no values (is null), and RP element was defined as:

Returns:
the resource property as a DOM Element array
Throws:
org.apache.commons.lang.SerializationException - if conversion fails

toSOAPElements

public javax.xml.soap.SOAPElement[] toSOAPElements()
                                            throws org.apache.commons.lang.SerializationException
Converts the resource property value into an array of SOAPElements. If the RP has no values (is null), and RP element was defined as:

Returns:
the resource property as a SOAPElement array
Throws:
org.apache.commons.lang.SerializationException - if conversion fails

toXML

public java.lang.String toXML()
Returns the XML representation of this property (i.e. the resource property elements).

Returns:
the XML representation of this property


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