com.legstar.coxb.common
Class CArrayComplexBinding

java.lang.Object
  extended by com.legstar.coxb.common.CBinding
      extended by com.legstar.coxb.common.CArrayBinding
          extended by com.legstar.coxb.common.CArrayComplexBinding
All Implemented Interfaces:
ICobolArrayBinding, ICobolArrayComplexBinding, ICobolBinding, ICobolElement

public abstract class CArrayComplexBinding
extends CArrayBinding
implements ICobolArrayComplexBinding

This class is a superclass of all arrays of complex element types implementing binding between a java type and cobol.

Author:
Fady Moussallam

Constructor Summary
CArrayComplexBinding(String bindingName, String jaxbName, Class<?> jaxbType, CobolElement cobolAnnotations, ICobolComplexBinding parentBinding, ICobolComplexBinding complexItemBinding)
          Constructor for a cobol element to java binding.
 
Method Summary
 void accept(CobolElementVisitor cev)
          Visitor pattern accept method.
 void addJaxbPropertyValue(int index)
          Deprecated.  
 void addPropertyValue(int index)
          This method is meant to be overridden.
 int calcItemByteLength()
          The method calculates the exact host byte length for one individual item of this Cobol binding.
 void createJaxbObject()
          Deprecated.  
 void createValueObject()
          This method is meant to be overridden.
 ICobolComplexBinding getComplexItemBinding()
          Returns the complex binding used for items of this array.
 String getValueObjectClassName()
          Complex bindings can be bound to JAXB objects or arbitrary POJOs jointly referred to as value objects.
 String getValueObjectsFactoryClassName()
          Optional factory class name used to create bound value objects.
 void setComplexItemBinding(ICobolComplexBinding complexItemBinding)
           
 void setValueObjectClassName(String valueObjectClassName)
          
 void setValueObjectsFactoryClassName(String valueObjectsFactoryClassName)
          
 
Methods inherited from class com.legstar.coxb.common.CArrayBinding
calcByteLength, getByteLength, getCurrentOccurs, getItemByteLength, isVariableSize, setItemByteLength
 
Methods inherited from class com.legstar.coxb.common.CBinding
cast, getBindingName, getCobolName, getCobolType, getDefaultValue, getDependingOn, getFractionDigits, getJaxbName, getJaxbType, getLevelNumber, getMarshalChoiceStrategyClassName, getMaxOccurs, getMinOccurs, getParentBinding, getPicture, getRedefines, getSrceLine, getTotalDigits, getUnmarshalChoiceStrategyClassName, getUsage, isBound, isCustomVariable, isGeneratedBinding, isJustifiedRight, isODOObject, isRedefined, isSigned, isSignLeading, isSignSeparate, setBindingName, setByteLength, setCobolName, setCobolType, setDefaultValue, setDependingOn, setFractionDigits, setIsCustomVariable, setIsJustifiedRight, setIsODOObject, setIsRedefined, setIsSigned, setIsSignLeading, setIsSignSeparate, setJaxbName, setJaxbType, setLevelNumber, setMarshalChoiceStrategyClassName, setMaxOccurs, setMinOccurs, setParentBinding, setPicture, setRedefines, setSrceLine, setTotalDigits, setUnmarshalChoiceStrategyClassName, setUsage, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.legstar.coxb.ICobolArrayComplexBinding
getObjectList, setItemValue, setObjectList
 
Methods inherited from interface com.legstar.coxb.ICobolArrayBinding
getCurrentOccurs, getItemByteLength, setItemByteLength
 
Methods inherited from interface com.legstar.coxb.ICobolBinding
calcByteLength, getBindingName, getJaxbName, getJaxbType, getObjectValue, getParentBinding, isBound, isSet, setObjectValue
 
Methods inherited from interface com.legstar.coxb.ICobolElement
getByteLength, getCobolName, getCobolType, getDefaultValue, getDependingOn, getFractionDigits, getLevelNumber, getMarshalChoiceStrategyClassName, getMaxOccurs, getMinOccurs, getPicture, getRedefines, getSrceLine, getTotalDigits, getUnmarshalChoiceStrategyClassName, getUsage, isCustomVariable, isJustifiedRight, isODOObject, isRedefined, isSigned, isSignLeading, isSignSeparate, setByteLength, setCobolName, setCobolType, setDefaultValue, setDependingOn, setFractionDigits, setIsCustomVariable, setIsJustifiedRight, setIsODOObject, setIsRedefined, setIsSigned, setIsSignLeading, setIsSignSeparate, setLevelNumber, setMarshalChoiceStrategyClassName, setMaxOccurs, setMinOccurs, setPicture, setRedefines, setSrceLine, setTotalDigits, setUnmarshalChoiceStrategyClassName, setUsage
 

Constructor Detail

CArrayComplexBinding

public CArrayComplexBinding(String bindingName,
                            String jaxbName,
                            Class<?> jaxbType,
                            CobolElement cobolAnnotations,
                            ICobolComplexBinding parentBinding,
                            ICobolComplexBinding complexItemBinding)
Constructor for a cobol element to java binding.

Parameters:
bindingName - the identifier for this binding
jaxbName - the name of the bound java property
jaxbType - the type of the bound java property
cobolAnnotations - the cobol annotations for this element
parentBinding - a reference to the parent binding if any
complexItemBinding - a binding element for array items
Method Detail

accept

public void accept(CobolElementVisitor cev)
            throws HostException
Visitor pattern accept method.

Specified by:
accept in interface ICobolBinding
Parameters:
cev - The visitor
Throws:
HostException - visitor request cannot be accepted

calcItemByteLength

public int calcItemByteLength()
The method calculates the exact host byte length for one individual item of this Cobol binding.

Specified by:
calcItemByteLength in interface ICobolArrayBinding
Returns:
the host byte length of an individual item of this binding

getComplexItemBinding

public ICobolComplexBinding getComplexItemBinding()
Description copied from interface: ICobolArrayComplexBinding
Returns the complex binding used for items of this array.

Specified by:
getComplexItemBinding in interface ICobolArrayComplexBinding
Returns:
the Complex Binding describing an item

setComplexItemBinding

public void setComplexItemBinding(ICobolComplexBinding complexItemBinding)
Parameters:
complexItemBinding - the item Complex Binding to set

createValueObject

public void createValueObject()
                       throws HostException
This method is meant to be overridden. If it is not, then we are dealing with an previous version of a binding object which did not implement this method. For backward compatibility, we route the call to the now deprecated createJaxbObject Requests array to create a complex value array.

Specified by:
createValueObject in interface ICobolArrayComplexBinding
Throws:
HostException - if initialization fails

addPropertyValue

public void addPropertyValue(int index)
                      throws HostException
This method is meant to be overridden. If it is not, then we are dealing with an previous version of a binding object which did not implement this method. For backward compatibility, we route the call to the now deprecated addJaxbPropertyValue Request complex binding item to add a value to a bound value object of the List type. The value is taken at index index in this binding array of values.

Specified by:
addPropertyValue in interface ICobolArrayComplexBinding
Parameters:
index - item index in this array.
Throws:
HostException - if bound object values cannot be set

createJaxbObject

public void createJaxbObject()
                      throws HostException
Deprecated. 

Specified by:
createJaxbObject in interface ICobolArrayComplexBinding
Throws:
HostException - if initialization fails

addJaxbPropertyValue

public void addJaxbPropertyValue(int index)
                          throws HostException
Deprecated. 

Specified by:
addJaxbPropertyValue in interface ICobolArrayComplexBinding
Parameters:
index - item index in this array.
Throws:
HostException - if bound object values cannot be set

getValueObjectClassName

public String getValueObjectClassName()
Complex bindings can be bound to JAXB objects or arbitrary POJOs jointly referred to as value objects. This property is the fully qualified java class name of the bound value object.

Specified by:
getValueObjectClassName in interface ICobolArrayComplexBinding
Returns:
the fully qualified bound value object class name

setValueObjectClassName

public void setValueObjectClassName(String valueObjectClassName)

Specified by:
setValueObjectClassName in interface ICobolArrayComplexBinding
Parameters:
valueObjectClassName - the fully qualified bound value object class name to set

getValueObjectsFactoryClassName

public String getValueObjectsFactoryClassName()
Optional factory class name used to create bound value objects. If null, value objects are assumed to have a no-argument constructor.

Specified by:
getValueObjectsFactoryClassName in interface ICobolArrayComplexBinding
Returns:
the factory class name used to create bound value objects

setValueObjectsFactoryClassName

public void setValueObjectsFactoryClassName(String valueObjectsFactoryClassName)

Specified by:
setValueObjectsFactoryClassName in interface ICobolArrayComplexBinding
Parameters:
valueObjectsFactoryClassName - the factory class name used to create bound value objects to set


Copyright © 2015 LegSem. All Rights Reserved.