|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.legstar.coxb.CobolElementVisitor
public abstract class CobolElementVisitor
This class is a super-class of all visitors (visitor pattern) involved in converting java object trees instances to host data buffers.
Constructor Summary | |
---|---|
CobolElementVisitor()
No-arg constructor. |
|
CobolElementVisitor(byte[] hostBytes,
int offset,
ICobolConverters cobolConverters)
Constructor for a given host buffer and converters set. |
Method Summary | |
---|---|
ICobolBinding |
chooseDefaultAlternative(ICobolChoiceBinding ce)
Default alternative selection logic. |
boolean |
exists(ICobolBinding ce)
This deals with a special case of elements which have a dependingOn clause but their maxOccurs is 1. |
ICobolConverters |
getCobolConverters()
|
byte[] |
getHostBytes()
|
int |
getMaxAlternaliveLength(ICobolChoiceBinding ce)
Given a choice, evaluate the largest alternative size. |
int |
getOffset()
|
int |
getStartOffset()
COBOL items are usually expected at a certain offset (fixed position). |
Hashtable<String,Object> |
getVariablesMap()
|
boolean |
isCandidateAlternative(ICobolBinding alt)
Should an alternative be considered for visiting. |
void |
setChosenAlternative(ICobolChoiceBinding ce,
ICobolBinding chosenAlternative)
If chosen alternative is shorter than the max, keep record of the difference because next item (if any) is not variably located. |
void |
setCobolConverters(ICobolConverters cobolConverters)
|
void |
setHostBytes(byte[] hostBytes)
|
void |
setOffset(int offset)
|
void |
setVariablesMap(Hashtable<String,Object> variablesMap)
|
void |
storeCustomVariable(ICobolBinding binding)
Store the value of a binding in the custom variables map for later referral by custom code. |
abstract void |
visit(ICobolArrayBinaryBinding ce)
Visit method of visitor pattern for Binary arrays. |
abstract void |
visit(ICobolArrayComplexBinding ce)
Visit method of visitor pattern for arrays of complex elements. |
abstract void |
visit(ICobolArrayDbcsBinding ce)
Visit method of visitor pattern for Dbcs arrays. |
abstract void |
visit(ICobolArrayDoubleBinding ce)
Visit method of visitor pattern for Double arrays. |
abstract void |
visit(ICobolArrayFloatBinding ce)
Visit method of visitor pattern for Float arrays. |
abstract void |
visit(ICobolArrayNationalBinding ce)
Visit method of visitor pattern for National arrays. |
abstract void |
visit(ICobolArrayOctetStreamBinding ce)
Visit method of visitor pattern for Octet stream arrays. |
abstract void |
visit(ICobolArrayPackedDecimalBinding ce)
Visit method of visitor pattern for packed decimal arrays. |
abstract void |
visit(ICobolArrayStringBinding ce)
Visit method of visitor pattern for String arrays. |
abstract void |
visit(ICobolArrayZonedDecimalBinding ce)
Visit method of visitor pattern for zoned decimal arrays. |
abstract void |
visit(ICobolBinaryBinding ce)
Visit method of visitor pattern for single Binary elements. |
abstract void |
visit(ICobolChoiceBinding ce)
Visit method of visitor pattern for choice elements. |
abstract void |
visit(ICobolComplexBinding ce)
Visit method of visitor pattern for complex elements. |
abstract void |
visit(ICobolDbcsBinding ce)
Visit method of visitor pattern for single Dbcs. |
abstract void |
visit(ICobolDoubleBinding ce)
Visit method of visitor pattern for single Double elements. |
abstract void |
visit(ICobolFloatBinding ce)
Visit method of visitor pattern for single Float elements. |
abstract void |
visit(ICobolNationalBinding ce)
Visit method of visitor pattern for single Nationals. |
abstract void |
visit(ICobolOctetStreamBinding ce)
Visit method of visitor pattern for single Octet streams. |
abstract void |
visit(ICobolPackedDecimalBinding ce)
Visit method of visitor pattern for single packed decimals. |
abstract void |
visit(ICobolStringBinding ce)
Visit method of visitor pattern for single Strings. |
abstract void |
visit(ICobolZonedDecimalBinding ce)
Visit method of visitor pattern for single zoned decimals. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CobolElementVisitor()
public CobolElementVisitor(byte[] hostBytes, int offset, ICobolConverters cobolConverters)
hostBytes
- host buffer used by visitoroffset
- offset in host buffercobolConverters
- set of converters to use for cobol elementsMethod Detail |
---|
public abstract void visit(ICobolComplexBinding ce) throws HostException
ce
- complex element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolChoiceBinding ce) throws HostException
ce
- choice element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayComplexBinding ce) throws HostException
ce
- complex array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolStringBinding ce) throws HostException
ce
- String element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayStringBinding ce) throws HostException
ce
- String array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolNationalBinding ce) throws HostException
ce
- National element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayNationalBinding ce) throws HostException
ce
- National array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolDbcsBinding ce) throws HostException
ce
- Dbcs element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayDbcsBinding ce) throws HostException
ce
- Dbcs array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolZonedDecimalBinding ce) throws HostException
ce
- Zoned decimal element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayZonedDecimalBinding ce) throws HostException
ce
- Zoned decimal array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolPackedDecimalBinding ce) throws HostException
ce
- Packed decimal element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayPackedDecimalBinding ce) throws HostException
ce
- Packed dcimal array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolBinaryBinding ce) throws HostException
ce
- Binary element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayBinaryBinding ce) throws HostException
ce
- Binary array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolFloatBinding ce) throws HostException
ce
- Float element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayFloatBinding ce) throws HostException
ce
- Float array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolDoubleBinding ce) throws HostException
ce
- Double element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayDoubleBinding ce) throws HostException
ce
- Double array element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolOctetStreamBinding ce) throws HostException
ce
- Octet stream element descriptor
HostException
- error while visitingpublic abstract void visit(ICobolArrayOctetStreamBinding ce) throws HostException
ce
- Octet stream element descriptor
HostException
- error while visitingpublic ICobolConverters getCobolConverters()
public void setCobolConverters(ICobolConverters cobolConverters)
cobolConverters
- The CobolConverters to set.public byte[] getHostBytes()
public void setHostBytes(byte[] hostBytes)
hostBytes
- The mHostBytes to set.public int getOffset()
public void setOffset(int offset)
offset
- The mOffset to set.public Hashtable<String,Object> getVariablesMap()
public void setVariablesMap(Hashtable<String,Object> variablesMap)
variablesMap
- the variables map to setpublic void storeCustomVariable(ICobolBinding binding) throws HostException
binding
- the current binding
HostException
- if value cannot be storedpublic boolean exists(ICobolBinding ce) throws HostException
ce
- the binding object
HostException
- if existence test failspublic int getStartOffset()
public int getMaxAlternaliveLength(ICobolChoiceBinding ce) throws HostException
ce
- the choice binding
HostException
- if size cannot be evaluatedpublic ICobolBinding chooseDefaultAlternative(ICobolChoiceBinding ce) throws HostException
ce
- the choice binding
HostException
- if no alternative could be chosenpublic boolean isCandidateAlternative(ICobolBinding alt)
alt
- the proposed candidate alternative
public void setChosenAlternative(ICobolChoiceBinding ce, ICobolBinding chosenAlternative) throws HostException
ce
- the choice bindingchosenAlternative
- the chosen alternative
HostException
- if size cannot be evaluated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |