org.apache.commons.betwixt.io.read
Class ArrayBindAction

java.lang.Object
  extended by org.apache.commons.betwixt.io.read.MappingAction
      extended by org.apache.commons.betwixt.io.read.MappingAction.Base
          extended by org.apache.commons.betwixt.io.read.ArrayBindAction

public class ArrayBindAction
extends MappingAction.Base

Acts to bind an array property. Note that this is intended to be used to map properties with a setter taking an array but which do not have an adder.

Note this implementation has state and therefore cannot be used concurrently (in simultaneous readings).

Version:
$Revision: 561314 $
Author:
Apache Commons Team

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.betwixt.io.read.MappingAction
MappingAction.Base
 
Field Summary
 
Fields inherited from class org.apache.commons.betwixt.io.read.MappingAction
EMPTY, IGNORE
 
Constructor Summary
ArrayBindAction()
           
 
Method Summary
 MappingAction begin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes, ReadContext context)
          Mapping arrays requires the addition of a temporary object (an ArrayList) into the stack together with an updater for that object.
static MappingAction createMappingAction(ElementDescriptor elementDescriptor)
          Factory method creates implementations to map arrays.
 void end(ReadContext context)
          Pops the ArrayList and the updater from their stacks.
 MappingAction next(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes, ReadContext context)
          Construct a delegating implmentation that wraps the real bean creator
 
Methods inherited from class org.apache.commons.betwixt.io.read.MappingAction.Base
body
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayBindAction

public ArrayBindAction()
Method Detail

createMappingAction

public static final MappingAction createMappingAction(ElementDescriptor elementDescriptor)
Factory method creates implementations to map arrays.

Parameters:
elementDescriptor - ElementDescriptor to be mapped, not null
Returns:
MappingAction, not null

begin

public MappingAction begin(java.lang.String namespace,
                           java.lang.String name,
                           org.xml.sax.Attributes attributes,
                           ReadContext context)
                    throws java.lang.Exception
Mapping arrays requires the addition of a temporary object (an ArrayList) into the stack together with an updater for that object.

Overrides:
begin in class MappingAction.Base
attributes - Attributes not null
context - Context not null
Returns:
the MappingAction to be used to map the sub-graph under this element
Throws:
java.lang.Exception
See Also:
MappingAction.begin(String, String, Attributes, ReadContext)

end

public void end(ReadContext context)
         throws java.lang.Exception
Pops the ArrayList and the updater from their stacks. The original updater is called with the result of the convertion.

Overrides:
end in class MappingAction.Base
Throws:
java.lang.Exception
See Also:
MappingAction.end(ReadContext)

next

public MappingAction next(java.lang.String namespace,
                          java.lang.String name,
                          org.xml.sax.Attributes attributes,
                          ReadContext context)
                   throws java.lang.Exception
Construct a delegating implmentation that wraps the real bean creator

Overrides:
next in class MappingAction.Base
Throws:
java.lang.Exception


Copyright 2002-2008 The Apache Software Foundation. All Rights Reserved.