Blocks statements
Flow controls
Constructions of selection
Constructions of iteration
Management of the exceptions
Instanze and assignment variable
Method invocation
Other
<!ELEMENT block %BLOCK_STATEMENT;>
Cases |
JPML |
Java |
block |
<block> statements.inJPML() </block> |
{ statements.inJava() } |
-- synchronized
<!ELEMENT synchronized %BLOCK_STATEMENT;>
<!ATTLIST synchronized
mutex CDATA #REQUIRED>
Cases |
JPML |
Java |
synchronized |
<synchronized mutex=#{vObject}> statements.inJPML() </synchronized> |
synchronized (vObject) { statements.inJava() } |
-- label
<!ELEMENT label EMPTY>
<!ATTLIST label
identifier CDATA #REQUIRED>
Cases |
JPML |
Java |
label |
<label identifier=lName /> statements.inJPML() |
lName: statements.inJava() |
-- return
<!ELEMENT return (#PCDATA)>
<!ATTLIST return
value CDATA #IMPLIED>
Cases |
JPML |
Java |
return void |
<return />
|
return; |
return value |
<return value=#{vValue}/>
|
return vValue; |
return value |
<return>#{vValue}</return>
|
return vValue; |
return String |
<return value=sValue/>
|
Return sValue; |
-- continue
<!ELEMENT continue EMPTY>
<!ATTLIST continue
identifier CDATA #IMPLIED>
Cases |
JPML |
Java |
continue |
<continue />
|
continue;
|
continue at |
<continue identifier=lName />
|
continue lName;
|
-- break
<!ELEMENT break EMPTY>
<!ATTLIST break
identifier CDATA #IMPLIED>
Cases |
JPML |
Java |
break |
<break />
|
break;
|
break at |
<break identifier=lName />
|
break lName;
|
-- if
<!ELEMENT if (%BLOCK_STATEMENT; | (then , elseif*, else?))>
<!ATTLIST if
test CDATA #REQUIRED>
<!ELEMENT then %BLOCK_STATEMENT;>
<!ELEMENT else %BLOCK_STATEMENT;>
<!ELEMENT elseif %BLOCK_STATEMENT;>
<!ATTLIST elseif
test CDATA #REQUIRED>
Cases |
JPML |
Java |
if |
<if test=%{vTest} > statements.inJPML() </if> |
if (vTest) { statements.inJava() } |
if-then-else |
<if test=%{vTest} > <then> statements1.inJPML() </then> <else> statements2.inJPML() </else> </if> |
if (vTest) { statements1.inJava() } else { statements2.inJava() } |
if-elseif |
<if test=%{vTest1} > <then> statements1.inJPML() </then> <elseif test=%{vTest2} > statements2.inJPML() </esleif> <elseif test=%{vTest3} > statements3.inJPML() </esleif> <else> statements4.inJPML() </else> </if> |
if (vTest1) { statements1.inJava() } else if(vTest2) { statements2.inJava() } else if(vTest3) { statements3.inJava() } else { statements4.inJava() } |
-- choose
<!ELEMENT choose (when+ , otherwise?) >
<!ELEMENT when %BLOCK_STATEMENT;>
<!ATTLIST when
test CDATA #REQUIRED>
<!ELEMENT otherwise %BLOCK_STATEMENT;>
Cases |
JPML |
Java |
choose |
<choose> <when test=%{vTest1} > statements1.inJPML() </when> <when test=%{vTest2} > statements2.inJPML() </when> <when test=%{vTest3} > statements3.inJPML() </when> <otherwise> statements4.inJPML() </otherwise> </choose> |
if (vTest1) { statements1.inJava() } else if(vTest2) { statements2.inJava() } else if(vTest3) { statements3.inJava() } else { statements4.inJava() } |
-- switch
<!ELEMENT switch ( (case , %BLOCK_STATEMENT; )+ , (default , %BLOCK_STATEMENT;)? ) >
<!ATTLIST switch
vartest CDATA #REQUIRED>
<!ELEMENT case EMPTY>
<!ATTLIST case
value CDATA #REQUIRED>
<!ELEMENT default EMPTY>
Cases |
JPML |
Java |
switch |
<switch vartest=%{vVarTest} > <case value=%{vValue1} /> statements1.inJPML() <case value=%{vValue2} /> statements2.inJPML() <case value=%{vValue3} /> statements3.inJPML() <case value=%{vValue4} /> statements4.inJPML() <default/> statements5.inJPML() </switch> |
switch (vVarTest) { case vValue1: statements1.inJava() case vValue2: statements2.inJava() case vValue3: statements3.inJava() case vValue4: statements4.inJava() default: statements5.inJava() } |
-- while
<!ELEMENT while %BLOCK_STATEMENT;>
<!ATTLIST while
test CDATA #REQUIRED>
Cases |
JPML |
Java |
while |
<while test=%{vTest} > statements.inJPML() </while> |
while (vTest) { statements.inJava() } |
-- dowhile
<!ELEMENT dowhile %BLOCK_STATEMENT;>
<!ATTLIST dowhile
test CDATA #REQUIRED>
Cases |
JPML |
Java |
do-while |
<dowhile test=%{vTest} > statements.inJPML() </dowhile> |
do { statements.inJava() } while (vTest); |
-- for
<!ELEMENT for %BLOCK_STATEMENT;>
<!ATTLIST for
init CDATA #REQUIRED
while CDATA #REQUIRED
repeat CDATA #REQUIRED>
Cases |
JPML |
Java |
for |
<for init=sInit while=sWhile repeat=sRepeat> statements.inJPML() </for> |
for(sInit; sWhile; sRepeat) { statements.inJava() } |
-- foreach
<!ELEMENT foreach %BLOCK_STATEMENT;>
<!ATTLIST foreach
type CDATA #REQUIRED
var CDATA #REQUIRED
items CDATA #REQUIRED>
Cases |
JPML |
Java |
for-each |
<foreach type=sType var=sVar items=#{vItems}> statements.inJPML() </foreach> |
for(sType sVar : vItems) { statements.inJava() } |
-- try
<!ELEMENT try (block , (catch+ | (catch* , finally)))>
<!ELEMENT catch %BLOCK_STATEMENT;>
<!ATTLIST catch
type CDATA #REQUIRED
var CDATA #REQUIRED>
<!ELEMENT finally %BLOCK_STATEMENT;>
Cases |
JPML |
Java |
try-catch |
<try> <block> statements1.inJPML() </block> <catch type=sType1 var=sVar1> statements2.inJPML() </cath> <catch type=sType2 var=sVar2> statements3.inJPML() </cath> </try> |
try { statements1.inJava() } catch (sType1 sVar1) { statements2.inJava() } catch (sType2 sVar2) { statements3.inJava() } |
try-catch-finally |
<try> <block> statements1.inJPML() </block> <catch type=sType1 var=sVar1> statements2.inJPML() </cath> <finally> statements3.inJPML() </cath> </try> |
try { statements1.inJava() } catch (sType sVar) { statements2.inJava() } finally { statements3.inJava() } |
-- throw
<!ELEMENT throw (#PCDATA)>
<!ATTLIST throw
value CDATA #IMPLIED>
Cases |
JPML |
Java |
throw |
<throw value=#{vValue}/>
|
throw vValue;
|
throw |
<throw>#{vValue}</throw>
|
throw vValue;
|
-- assert
<!ELEMENT assert (#PCDATA)>
<!ATTLIST assert
test CDATA #REQUIRED>
Cases |
JPML |
Java |
assert |
<assert test=#{vTest}/>
|
assert vTest;
|
assert msg |
<assert test=#{vTest}/> sMsg </assert> |
assert vTest : sMsg;
|
-- instanze
<!ELEMENT instanze (#PCDATA)>
<!ATTLIST instanze
type CDATA #REQUIRED
var CDATA #REQUIRED
final (no | yes) "no"
value CDATA #IMPLIED>
Cases |
JPML |
Java |
instanze |
<instanze type=sType var=sVar />
|
sType sVar;
|
instanze value |
<instanze type=sType var=sVar value=#{vValue}/>
|
sType sVar = vValue;
|
instanze value |
<instanze type=sType var=sVar > #{vValue} </instanze>
|
sType sVar = vValue;
|
instanze final value |
<instanze type=sType var=sVar final=yes value=#{vValue}/>
|
final sType sVar = vValue;
|
-- set
<!ELEMENT set (#PCDATA)>
<!ATTLIST set
var CDATA #REQUIRED
value CDATA #IMPLIED>
Cases |
JPML |
Java |
set value |
<set var=#{vVar} value=#{vValue}/>
|
vVar = vValue;
|
set value |
<set var=#{vVar}>#{vValue}</set>
|
vVar = vValue;
|
set String |
<set var=#{vVar} value=sValue/>
|
vVar = sValue;
|
-- assignment
<!ELEMENT assignment (#PCDATA)>
<!ATTLIST assignment
var CDATA #REQUIRED
operator CDATA "="
value CDATA #IMPLIED>
Cases |
JPML |
Java |
assignment value |
<assignment var=#{vVar} operator=sOp value=#{vValue}/>
|
vVar sOp vValue;
|
assignment value |
<assignment var=#{vVar} operator=sOp> #{vValue} </ assignment > |
vVar sOp vValue;
|
-- invoke
<!ELEMENT invoke (argument)*>
<!ATTLIST invoke
object CDATA "this"
method CDATA #REQUIRED>
<!ELEMENT argument (#PCDATA)>
<!ATTLIST argument
value CDATA #IMPLIED>
Cases |
JPML |
Java |
invoke |
<invoke object=#{vObj} method=sMethod />
|
vObj.sMethod();
|
invoke |
<invoke object=#{vObj} method=sMethod > <argument value=#{vValue1}/> <argument value=#{vValue2}/> <argument value=#{vValue3}/> </invoke> |
vObj.sMethod(vValue1, vValue2, vValue3);
|
-- scriptlet
<!ELEMENT scriptlet (#PCDATA)>
Cases |
JPML |
Java |
scriptlet |
<scriptlet> statements.inJava() </scriptlet> |
{ statements.inJava() } |
-- outxml
<!-- statement: output facilitated xml -->
<!-- statement: outxml: setting out (type PrintStream) and namespace -->
<!ELEMENT outxml %BLOCK_STATEMENT;>
<!ATTLIST outxml
prefixout CDATA #IMPLIED
out CDATA #IMPLIED>
<!-- statement: outxml: write on output doctype xml -->
<!ELEMENT outxml_doctype (#PCDATA)>
<!ATTLIST outxml_doctype
rootElement CDATA #REQUIRED
uRIreference CDATA #IMPLIED
publicIdentifier CDATA #IMPLIED>
<!-- statement: outxml: write on output processinginst xml -->
<!ELEMENT outxml_processinginst (#PCDATA)>
<!ATTLIST outxml_processinginst
target CDATA #REQUIRED
value CDATA #IMPLIED>
<!-- statement: outxml: write on output comment xml -->
<!ELEMENT outxml_comment (#PCDATA)>