org.opennms.netmgt.config.translator
Class Mapping

java.lang.Object
  extended by org.opennms.netmgt.config.translator.Mapping
All Implemented Interfaces:
Serializable

public class Mapping
extends Object
implements Serializable

A mapping for a given event. This translation is only applied if it is the first that matches

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
Mapping()
           
 
Method Summary
 void addAssignment(Assignment vAssignment)
           
 void addAssignment(int index, Assignment vAssignment)
           
 Enumeration<Assignment> enumerateAssignment()
          Method enumerateAssignment.
 Assignment[] getAssignment()
          Method getAssignment.Returns the contents of the collection in an Array.
 Assignment getAssignment(int index)
          Method getAssignment.
 List<Assignment> getAssignmentCollection()
          Method getAssignmentCollection.Returns a reference to '_assignmentList'.
 int getAssignmentCount()
          Method getAssignmentCount.
 boolean isValid()
          Method isValid.
 Iterator<Assignment> iterateAssignment()
          Method iterateAssignment.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllAssignment()
           
 boolean removeAssignment(Assignment vAssignment)
          Method removeAssignment.
 Assignment removeAssignmentAt(int index)
          Method removeAssignmentAt.
 void setAssignment(Assignment[] vAssignmentArray)
           
 void setAssignment(int index, Assignment vAssignment)
           
 void setAssignment(List<Assignment> vAssignmentList)
          Sets the value of '_assignmentList' by copying the given Vector.
 void setAssignmentCollection(List<Assignment> assignmentList)
          Deprecated.  
static Mapping unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping()
Method Detail

addAssignment

public void addAssignment(Assignment vAssignment)
                   throws IndexOutOfBoundsException
Parameters:
vAssignment -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addAssignment

public void addAssignment(int index,
                          Assignment vAssignment)
                   throws IndexOutOfBoundsException
Parameters:
index -
vAssignment -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateAssignment

public Enumeration<Assignment> enumerateAssignment()
Method enumerateAssignment.

Returns:
an Enumeration over all possible elements of this collection

getAssignment

public Assignment getAssignment(int index)
                         throws IndexOutOfBoundsException
Method getAssignment.

Parameters:
index -
Returns:
the value of the org.opennms.netmgt.config.translator.Assignment at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getAssignment

public Assignment[] getAssignment()
Method getAssignment.Returns the contents of the collection in an Array.

Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.

Returns:
this collection as an Array

getAssignmentCollection

public List<Assignment> getAssignmentCollection()
Method getAssignmentCollection.Returns a reference to '_assignmentList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getAssignmentCount

public int getAssignmentCount()
Method getAssignmentCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateAssignment

public Iterator<Assignment> iterateAssignment()
Method iterateAssignment.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(ContentHandler handler)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllAssignment

public void removeAllAssignment()

removeAssignment

public boolean removeAssignment(Assignment vAssignment)
Method removeAssignment.

Parameters:
vAssignment -
Returns:
true if the object was removed from the collection.

removeAssignmentAt

public Assignment removeAssignmentAt(int index)
Method removeAssignmentAt.

Parameters:
index -
Returns:
the element removed from the collection

setAssignment

public void setAssignment(int index,
                          Assignment vAssignment)
                   throws IndexOutOfBoundsException
Parameters:
index -
vAssignment -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setAssignment

public void setAssignment(Assignment[] vAssignmentArray)
Parameters:
vAssignmentArray -

setAssignment

public void setAssignment(List<Assignment> vAssignmentList)
Sets the value of '_assignmentList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vAssignmentList - the Vector to copy.

setAssignmentCollection

public void setAssignmentCollection(List<Assignment> assignmentList)
Deprecated. 

Sets the value of '_assignmentList' by setting it to the given Vector. No type checking is performed.

Parameters:
assignmentList - the Vector to set.

unmarshal

public static Mapping unmarshal(Reader reader)
                         throws org.exolab.castor.xml.MarshalException,
                                org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.config.translator.Mapping
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright ? 2008. All Rights Reserved.