X hits on this document

333 views

0 shares

0 downloads

0 comments

97 / 120

of a COBOL program from Java by

**

establishing an XML bridge leveraging **

JAXB, JNI, and COBOL XML support.

**

Teodoro Cipresso tcipress@hotmail.com

** **

****************************************************

** Author: **

****************************************************

** Program: Java Front-end to COBOL Calculator ** Purpose: Demonstrate reengineering and reuse

** ** **

** **

Select a task from the following menu:

  • (1)

    Addition

  • (2)

    Subtraction

  • (3)

    Multiplication

  • (4)

    Toggle Debug ON

  • (5)

    Quit Program

Specify selection: 3 Specify integer operand #1: 12 Specify integer operand #2: 12 [***] COBOL multiplication result: 144

Figure 9.5. Console-based Java interface to the legacy COBOL program.

5) Use the Java command-line utility xjc, in combination with the XML Schema created in Step 2, to generate Java to XML marshalling code (JAXB). Update

JSimpleCalculator.java to call this marshalling code.

The xjc command-line utility generates two types of artifacts for each global (top

level) element in an XML Schema: (1) Java classes that expose getters and setters for the

data contained in instances of the XML Schema (XML documents), (2) Java classes that

serve as metadata for the JAXB XML marshalling engine. In the solution archive file,

the two classes generated by JAXB are: SmplCalcJaxbFactory.java (getters and setters)

and SmplCalcJaxbMarshaller.java (JAXB XML marshalling metadata). Note these are

not the default class names generated by xjc.

89

Document info
Document views333
Page views334
Page last viewedMon Dec 05 17:13:50 UTC 2016
Pages120
Paragraphs2913
Words25794

Comments