com.legstar.coxb
Interface ICobolChoiceBinding

All Superinterfaces:
ICobolBinding, ICobolElement
All Known Implementing Classes:
CChoiceBinding

public interface ICobolChoiceBinding
extends ICobolBinding

This interface groups methods that are common to choice elements.

Author:
Fady Moussallam

Method Summary
 void addAlternative(ICobolBinding ce)
          When alternatives are discovered dynamically, this method allows other classes to participate in the alternative list buildup.
 ICobolBinding getAlternativeByCobolName(String cobolName)
          Retrieves an alternative identified by its cobol field name.
 ICobolBinding getAlternativeByName(String name)
          Retrieves an alternative identified by its name.
 List<ICobolBinding> getAlternativesList()
          Returns the current list of alternatives for this choice element.
 ICobolMarshalChoiceStrategy getMarshalChoiceStrategy()
          Gets an instance of a class providing additional logic to select an alternative within a choice element at marshaling (Java to Host) time.
 ICobolComplexBinding getParentBinding()
          A choice element always belongs to a complex element (roots can never be choices).
 Object getParentJaxbObject()
          Deprecated. Retrieves the parent jaxb object. Choice bindings are not directly bound to a jaxb object themselves but they are always children of a complex binding. Since bindings can now be bound to arbitrary value objects, use method getParentValueObject instead of this one.
 Object getParentValueObject()
          Retrieves the parent's value object.
 ICobolUnmarshalChoiceStrategy getUnmarshalChoiceStrategy()
          Gets an instance of a class providing additional logic to select an alternative within a choice element at unmarshaling (Host to Java) time.
 void setAlternativesValues()
          Requests choice binding to set its alternatives values from bound value objects.
 void setJaxbPropertyValue(int index)
          Deprecated. Request choice binding to set to set a property of the bound Jaxb object to the value of a corresponding alternative. child value. Since bindings can now be bound to arbitrary value objects, use method setPropertyValue instead of this one.
 void setMarshalChoiceStrategy(ICobolMarshalChoiceStrategy strategy)
          Sets a instance of a class providing additional logic to select an alternative within a choice element at marshaling (Java to Host) time.
 void setPropertyValue(int index)
          Request choice binding to set to set a property of the bound value object to the value of a corresponding alternative.
 void setUnmarshalChoiceStrategy(ICobolUnmarshalChoiceStrategy strategy)
          Sets a instance of a class providing additional logic to select an alternative within a choice element at unmarshaling (Host to Java) time.
 
Methods inherited from interface com.legstar.coxb.ICobolBinding
accept, calcByteLength, getBindingName, getJaxbName, getJaxbType, getObjectValue, 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
 

Method Detail

setAlternativesValues

void setAlternativesValues()
                           throws HostException
Requests choice binding to set its alternatives values from bound value objects.

Throws:
HostException - if reading from bound object values fails

setJaxbPropertyValue

void setJaxbPropertyValue(int index)
                          throws HostException
Deprecated. Request choice binding to set to set a property of the bound Jaxb object to the value of a corresponding alternative. child value. Since bindings can now be bound to arbitrary value objects, use method setPropertyValue instead of this one.

Parameters:
index - the position of the child in the alternatives list
Throws:
HostException - if bound object values cannot be set

setPropertyValue

void setPropertyValue(int index)
                      throws HostException
Request choice binding to set to set a property of the bound value object to the value of a corresponding alternative. child value.

Parameters:
index - the position of the child in the alternatives list
Throws:
HostException - if bound object values cannot be set

getAlternativesList

List<ICobolBinding> getAlternativesList()
                                        throws HostException
Returns the current list of alternatives for this choice element.

Returns:
Ordered list of alternatives
Throws:
HostException - if list cannot be created

getAlternativeByName

ICobolBinding getAlternativeByName(String name)
Retrieves an alternative identified by its name.

Parameters:
name - the alternative name
Returns:
corresponding alternative or null if not found

getAlternativeByCobolName

ICobolBinding getAlternativeByCobolName(String cobolName)
Retrieves an alternative identified by its cobol field name.

Parameters:
cobolName - the field name
Returns:
corresponding alternative or null if not found

addAlternative

void addAlternative(ICobolBinding ce)
When alternatives are discovered dynamically, this method allows other classes to participate in the alternative list buildup.

Parameters:
ce - redefined or redefining cobol element description

getParentBinding

ICobolComplexBinding getParentBinding()
A choice element always belongs to a complex element (roots can never be choices). This method returns a reference to the complex parent binding.

Specified by:
getParentBinding in interface ICobolBinding
Returns:
a reference to the parent binding

getParentJaxbObject

Object getParentJaxbObject()
                           throws HostException
Deprecated. Retrieves the parent jaxb object. Choice bindings are not directly bound to a jaxb object themselves but they are always children of a complex binding. Since bindings can now be bound to arbitrary value objects, use method getParentValueObject instead of this one.

Returns:
the parent bound jaxb object
Throws:
HostException - if parent jaxb object cannot be retrieved

getParentValueObject

Object getParentValueObject()
                            throws HostException
Retrieves the parent's value object. Choice bindings are not directly bound to a value object themselves but they are always children of a complex binding.

Returns:
the parent's bound value object
Throws:
HostException - if parent's value object cannot be retrieved

setMarshalChoiceStrategy

void setMarshalChoiceStrategy(ICobolMarshalChoiceStrategy strategy)
Sets a instance of a class providing additional logic to select an alternative within a choice element at marshaling (Java to Host) time.

Parameters:
strategy - a choice strategy implementation

getMarshalChoiceStrategy

ICobolMarshalChoiceStrategy getMarshalChoiceStrategy()
                                                     throws HostException
Gets an instance of a class providing additional logic to select an alternative within a choice element at marshaling (Java to Host) time.

Returns:
a choice strategy implementation
Throws:
HostException - if strategy cannot be loaded

setUnmarshalChoiceStrategy

void setUnmarshalChoiceStrategy(ICobolUnmarshalChoiceStrategy strategy)
Sets a instance of a class providing additional logic to select an alternative within a choice element at unmarshaling (Host to Java) time.

Parameters:
strategy - a choice strategy implementation

getUnmarshalChoiceStrategy

ICobolUnmarshalChoiceStrategy getUnmarshalChoiceStrategy()
                                                         throws HostException
Gets an instance of a class providing additional logic to select an alternative within a choice element at unmarshaling (Host to Java) time.

Returns:
a choice strategy implementation
Throws:
HostException - if strategy cannot be loaded


Copyright © 2015 LegSem. All Rights Reserved.