Xvcl Pages; [ Cjos Audience]
Contributed by Gilbert Herschberger (3 September 2005, updated 23 April 2007).
Overview
Introduction
Convert from Java source code (.java) to XVCL-compatible files.
Example 1
The following URI invokes the java2xvcl command:
run:command:java2xvcl
Example 2
Let's say that the src/jos/demo directory contains Demo.java. Display the generated XVCL script with the following URI:
run:command:java2xvcl?source=src/jos/demo
Example 3
The following URI writes demo.xvcl to the target directory.
run:command:java2xvcl?source=src/jos/demo&target=dest&confirm=true
Parameter: extension
This parameter is part of the target filename. By default, the 'xvcl' extension is used.
extension=txt
Parameter: doctype
This parameter is used when emitting the doctype. By default, the 'default' doctype is used.
<!DOCTYPE x-frame SYSTEM "doctype">
Parameter: license
This parameter is used when emitting the license x-frame. By default, the 'license' x-frame is used.
<!-- adapt x-frame="license" -->
Parameter: showall
This parameter includes source subdirectories. By default, showall is false.
Parameter: tree
This parameter includes target subdirectories. By default, tree is false.
Example: Ant summary
The following example illustrates how to invoke the java2xvcl command from an Ant script.
<target name="taskdef">
<taskdef name="smartapi" classname="gchii.tools.ant.SmartApiTask"/>
</target>
<target name="java2xvcl" depends="taskdef">
<smartapi spec="run:command:java2xvcl
?confirm=true
&source=${source.dir}
&target=${target.dir}"/>
</target>
Mechanism
The java2xvcl command
- Replaces & with &,
- Replaces < with <,
- Replaces > with *gt;, and
- Demo.java becomes output="Demo.java".
Contents
This document contains the following sections:
- Version 1a
- Version 2a
- Section A - Using Ant
Version 1a
Program
The following class is a program.
gchii.tools.java2xvcl1a.Java2XvclProgram
Settings
<!-- java2xvcl settings -->
<property name="java2xvcl.program" value="gchii.tools.java2xvcl.Java2XvclProgram"/>
<property name="java2xvcl.confirm" value="true"/>
<property name="java2xvcl.source" value="${basedir}/src"/>
<property name="java2xvcl.target" value="${basedir}/build/"/>
java2xvcl target
<target name="java2xvcl" depends="taskdef">
<smartapi spec="run:program:${java2xvcl.program}
?confirm=${java2xvcl.confirm}
&source=${java2xvcl.source}
&target=${java2xvcl.target}"/>
</target>
Confirm parameter
When confirm=true, the XVCL documents are written to the target directory. Otherwise, the XVCL documents are written to standard output.
Source parameter
This parameter is the source location of the Java source code.
Target parameter
This parameter is the target location of the XVCL documents.
Version 2a
Program
The following class is a subprogram.
gchii.tools.java2xvcl2a.Java2XvclProgram
META-INF/command/xvcl resource
gchii.tools.java2xvcl2a.Java2XvclProgram
Version 2b
Program
The following class is a subprogram.
gchii.tools.java2xvcl2b.Java2XvclProgram
META-INF/command/xvcl resource
gchii.tools.java2xvcl2b.Java2XvclProgram
Section A - Using Ant
Introduction
This section describes how to use an Ant script to generate XVCL frames from Java source code.
java2xvcl.confirm property
This property corresponds to the confirm parameter.
<property name="java2xvcl.confirm" value="true"/>
java2xvcl.source property
This property corresponds to the source parameter.
<property name="java2xvcl.source" value="${basedir}/src"/>
java2xvcl.target property
This property corresponds to the source parameter.
<property name="java2xvcl.target" value="${basedir}/build"/>
Smart API Task
Define the smartapi task.
<target name="taskdef">
<taskdef name="smartapi" classname="gchii.tools.ant.SmartApiTask"/>
</target>
java2xvcl target
<target name="java2xvcl" depends="taskdef">
<smartapi spec="run:command:java2xvcl
?confirm=${java2xvcl.confirm}
&source=${java2xvcl.source}
&target=${java2xvcl.target}"/>
</target>
java2xvcl target (Deprecated)
<property name="java2xvcl.program" value="gchii.tools.java2xvcl.Java2XvclProgram"/>
<target name="java2xvcl" depends="taskdef">
<smartapi spec="run:program:${java2xvcl.program}
?confirm=${java2xvcl.confirm}
&source=${java2xvcl.source}
&target=${java2xvcl.target}"/>
</target>
|