org.jibx.binding.def
Class NestedCollection.AddStore

java.lang.Object
  extended byorg.jibx.binding.def.NestedCollection.CollectionBase
      extended byorg.jibx.binding.def.NestedCollection.CollectionStore
          extended byorg.jibx.binding.def.NestedCollection.AddStore
Enclosing class:
NestedCollection

static class NestedCollection.AddStore
extends NestedCollection.CollectionStore

Collection item store strategy for collection with add method.


Field Summary
private  ClassItem m_addMethod
          Method used to add item to collection.
private  boolean m_isReturned
          Flag for method returns result.
 
Constructor Summary
(package private) NestedCollection.AddStore(ClassItem add, boolean doubword, boolean ret)
          Constructor.
 
Method Summary
protected  void appendPOP(MethodBuilder mb)
          Append the appropriate instruction to pop the item value (which may be one or two words, as configured for this collection) from the top of the stack.
protected  void appendSWAP(MethodBuilder mb)
          Append the appropriate instruction to swap the top of the stack (which must be a single-word value) with an item value (which may be one or two words, as configured for this collection).
protected  void genStoreDone(ContextMethodBuilder mb)
          Generate code to clean up after storing items to collection.
protected  void genStoreInit(ContextMethodBuilder mb)
          Generate code to initialize collection for storing items.
protected  void genStoreItem(ContextMethodBuilder mb)
          Generate code to store next item to collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_addMethod

private final ClassItem m_addMethod
Method used to add item to collection.


m_isReturned

private final boolean m_isReturned
Flag for method returns result.

Constructor Detail

NestedCollection.AddStore

NestedCollection.AddStore(ClassItem add,
                          boolean doubword,
                          boolean ret)
Constructor.

Parameters:
add - method used to add item to collection
doubword - double word value flag
ret - value returned by add flag
Method Detail

genStoreItem

protected void genStoreItem(ContextMethodBuilder mb)
                     throws JiBXException
Description copied from class: NestedCollection.CollectionStore
Generate code to store next item to collection. This generates the necessary code for handling the store operation, removing the item from the stack. The NestedCollection.CollectionStore.genStoreInit(org.jibx.binding.classes.ContextMethodBuilder) method must be called before calling this method, and the NestedCollection.CollectionStore.genStoreDone(org.jibx.binding.classes.ContextMethodBuilder) method must be called after the last call to this method. This method must be overridden by each subclass.

Specified by:
genStoreItem in class NestedCollection.CollectionStore
Parameters:
mb - method builder
Throws:
JiBXException - if error in configuration

genStoreInit

protected void genStoreInit(ContextMethodBuilder mb)
                     throws JiBXException
Generate code to initialize collection for storing items. This generates the necessary code for handling the initialization, including creating the collection object if appropriate. It must be called before attempting to call the NestedCollection.CollectionStore.genStoreItem(org.jibx.binding.classes.ContextMethodBuilder) method. The base class implementation does nothing.

Parameters:
mb - method builder
Throws:
JiBXException - if error in configuration

genStoreDone

protected void genStoreDone(ContextMethodBuilder mb)
                     throws JiBXException
Generate code to clean up after storing items to collection. This generates the necessary code for handling the clean up. It must be called after the last call to NestedCollection.CollectionStore.genStoreItem(org.jibx.binding.classes.ContextMethodBuilder). The base class implementation does nothing.

Parameters:
mb - method builder
Throws:
JiBXException - if error in configuration

appendSWAP

protected void appendSWAP(MethodBuilder mb)
Append the appropriate instruction to swap the top of the stack (which must be a single-word value) with an item value (which may be one or two words, as configured for this collection).

Parameters:
mb - method

appendPOP

protected void appendPOP(MethodBuilder mb)
Append the appropriate instruction to pop the item value (which may be one or two words, as configured for this collection) from the top of the stack.

Parameters:
mb - method


Project Web Site