|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.legstar.coxb.common.CBinding
com.legstar.coxb.common.CChoiceBinding
public abstract class CChoiceBinding
Represents a choice between 2 or more elements. A choice results from a cobol REDEFINES clause exposed as an xs:choice in the corresponding XML schema
| Constructor Summary | |
|---|---|
CChoiceBinding(String bindingName,
CobolElement cobolAnnotations,
ICobolComplexBinding parentBinding)
A choice element gets created when a redefined item is encountered. |
|
| Method Summary | |
|---|---|
void |
accept(CobolElementVisitor cev)
Visitor pattern accept method. |
void |
addAlternative(ICobolBinding ce)
When alternatives are discovered dynamically, this method allows other classes to participate in the alternative list buildup. |
int |
calcByteLength()
The method calculates the exact host byte length for this Cobol binding. |
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. |
Object |
getParentJaxbObject()
Deprecated. |
Object |
getParentValueObject()
This method is meant to be overridden. |
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 |
setJaxbPropertyValue(int index)
Deprecated. |
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)
This method is meant to be overridden. |
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 class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.legstar.coxb.ICobolChoiceBinding |
|---|
getParentBinding, setAlternativesValues |
| Methods inherited from interface com.legstar.coxb.ICobolBinding |
|---|
getBindingName, getJaxbName, getJaxbType, getObjectValue, isBound, isSet, setObjectValue |
| Constructor Detail |
|---|
public CChoiceBinding(String bindingName,
CobolElement cobolAnnotations,
ICobolComplexBinding parentBinding)
bindingName - the identifier for this bindingcobolAnnotations - the cobol annotations for the first alternativeparentBinding - a reference to the parent binding if any| Method Detail |
|---|
public void addAlternative(ICobolBinding ce)
addAlternative in interface ICobolChoiceBindingce - redefined or redefining cobol element descriptionpublic List<ICobolBinding> getAlternativesList()
getAlternativesList in interface ICobolChoiceBinding
public void accept(CobolElementVisitor cev)
throws HostException
accept in interface ICobolBindingcev - The visitor
HostException - visitor request cannot be acceptedpublic int calcByteLength()
calcByteLength in interface ICobolBindingpublic ICobolBinding getAlternativeByName(String name)
getAlternativeByName in interface ICobolChoiceBindingname - the alternative name
public ICobolBinding getAlternativeByCobolName(String cobolName)
getAlternativeByCobolName in interface ICobolChoiceBindingcobolName - the field name
public ICobolMarshalChoiceStrategy getMarshalChoiceStrategy()
throws HostException
getMarshalChoiceStrategy in interface ICobolChoiceBindingHostException - if strategy cannot be loadedpublic void setMarshalChoiceStrategy(ICobolMarshalChoiceStrategy strategy)
setMarshalChoiceStrategy in interface ICobolChoiceBindingstrategy - a choice strategy implementation
public ICobolUnmarshalChoiceStrategy getUnmarshalChoiceStrategy()
throws HostException
getUnmarshalChoiceStrategy in interface ICobolChoiceBindingHostException - if strategy cannot be loadedpublic void setUnmarshalChoiceStrategy(ICobolUnmarshalChoiceStrategy strategy)
setUnmarshalChoiceStrategy in interface ICobolChoiceBindingstrategy - a choice strategy implementation
public Object getParentJaxbObject()
throws HostException
getParentJaxbObject in interface ICobolChoiceBindingHostException - if parent jaxb object cannot be retrieved
public void setPropertyValue(int index)
throws HostException
setJaxbPropertyValue Request choice binding to set to set a property of the bound value object
to the value of a corresponding alternative.
child value.
setPropertyValue in interface ICobolChoiceBindingindex - the position of the child in the alternatives list
HostException - if bound object values cannot be set
public void setJaxbPropertyValue(int index)
throws HostException
setPropertyValue.
setJaxbPropertyValue in interface ICobolChoiceBindingindex - the position of the child in the alternatives list
HostException - if bound object values cannot be set
public Object getParentValueObject()
throws HostException
getParentJaxbObject 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.
getParentValueObject in interface ICobolChoiceBindingHostException - if parent's value object cannot be retrieved
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||