com.legstar.coxb
Interface ICobolBinding

All Superinterfaces:
ICobolElement
All Known Subinterfaces:
ICobolArrayBinaryBinding, ICobolArrayBinding, ICobolArrayComplexBinding, ICobolArrayDbcsBinding, ICobolArrayDoubleBinding, ICobolArrayFloatBinding, ICobolArrayNationalBinding, ICobolArrayNumericBinding, ICobolArrayOctetStreamBinding, ICobolArrayPackedDecimalBinding, ICobolArrayStringBinding, ICobolArrayZonedDecimalBinding, ICobolBinaryBinding, ICobolChoiceBinding, ICobolComplexBinding, ICobolDbcsBinding, ICobolDoubleBinding, ICobolFloatBinding, ICobolNationalBinding, ICobolNumericBinding, ICobolOctetStreamBinding, ICobolPackedDecimalBinding, ICobolStringBinding, ICobolZonedDecimalBinding
All Known Implementing Classes:
CArrayBinding, CArrayComplexBinding, CBinding, CChoiceBinding, CComplexBinding

public interface ICobolBinding
extends ICobolElement

This interface represents the binding between a java type and a cobol element.

Author:
Fady Moussallam

Method Summary
 void accept(CobolElementVisitor cev)
          Visitor pattern accept method.
 int calcByteLength()
          The method calculates the exact host byte length for this Cobol binding.
 String getBindingName()
          Returns the name of this binding element.
 String getJaxbName()
          Returns the java name of the property bound to this Cobol element.
 Class<?> getJaxbType()
          Returns the java type of the property bound to this Cobol element.
 Object getObjectValue(Class<?> type)
          Retrieves the binding value as an object of the requested type.
 ICobolComplexBinding getParentBinding()
          A binding element might belong to another complex element .
 boolean isBound()
          Determines if this Cobol element is bound to a Jaxb property.
 boolean isSet()
          When a binding value has been explicitly set, this method will return true.
 void setObjectValue(Object value)
          Sets the binding internal value.
 
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

getBindingName

String getBindingName()
Returns the name of this binding element.

Returns:
the name of this binding element

getParentBinding

ICobolComplexBinding getParentBinding()
A binding element might belong to another complex element . This method returns a reference to the complex parent binding if any, null otherwise.

Returns:
a reference to the parent binding

getJaxbName

String getJaxbName()
Returns the java name of the property bound to this Cobol element.

Returns:
the java name of the property bound to this Cobol element

getJaxbType

Class<?> getJaxbType()
Returns the java type of the property bound to this Cobol element.

Returns:
the java type of the property bound to this Cobol element

accept

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

Parameters:
cev - The visitor
Throws:
HostException - visitor request cannot be accepted

calcByteLength

int calcByteLength()
The method calculates the exact host byte length for this Cobol binding.

Returns:
the host byte length of this binding

setObjectValue

void setObjectValue(Object value)
                    throws HostException
Sets the binding internal value. This method is used when the value type is not known in advance. More strongly typed methods exist in each binding category.

Parameters:
value - the value to set the binding
Throws:
HostException - if value is not compatible with binding type

getObjectValue

Object getObjectValue(Class<?> type)
                      throws HostException
Retrieves the binding value as an object of the requested type.

Parameters:
type - the type of object to produce
Returns:
an object of the requested type
Throws:
HostException - if value cannot be converted to the requested type

isSet

boolean isSet()
When a binding value has been explicitly set, this method will return true. This is useful for the choice default strategy that only considers alternatives that have been explicitly set.

Returns:
true if this binding value has been set

isBound

boolean isBound()
Determines if this Cobol element is bound to a Jaxb property.

Returns:
true if element is bound to a jaxb property which name and type are known


Copyright © 2015 LegSem. All Rights Reserved.