|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.ejen.ext.parsers.java_1_2.JavaSourceToXML
Java source file compilation utility (static methods).
| Usage (XSL stylesheet) |
|---|
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
...
xmlns:jsx="org.ejen.ext.parsers.java_1_2.JavaSourceToXML"
version="1.0">
<xsl:output method="xml" encoding="iso-8859-1"/>
<xsl:template match="ejen">
<xsl:copy-of select="jsx: |
| Field Summary |
| Constructor Summary | |
protected |
JavaSourceToXML()
Protected constructor (prevents instanciation). |
| Method Summary | |
protected static int[] |
getMap(String arl,
int[] defaultMap,
Hashtable cache)
Returns an int array based on the 'arl' expression. |
static NodeSet |
parseJavadoc(ExpressionContext context,
String comment)
Returns a NodeSet that contains all non empty lines in a Javadoc comment.
|
protected static NodeSet |
process(Document doc,
String fileName,
String nodesArl,
String tokensArl,
boolean tokensPos)
Returns a Node that represents a java source file.
|
static NodeSet |
process(ExpressionContext context,
String fileName)
Returns a Node that represents a java source file.
|
static NodeSet |
process(ExpressionContext context,
String fileName,
boolean tokensPos)
Returns a Node that represents a java source file.
|
static NodeSet |
process(ExpressionContext context,
String fileName,
String nodesArl,
String tokensArl)
Returns a Node that represents a java source file.
|
static NodeSet |
process(ExpressionContext context,
String fileName,
String nodesArl,
String tokensArl,
boolean tokensPos)
Returns a Node that represents a java source file.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected JavaSourceToXML()
| Method Detail |
public static NodeSet process(ExpressionContext context,
String fileName)
Node that represents a java source file.
<xsl:copy-of select="jsx:process($java-file)"/> |
Token positions are not included (see
process(ExpressionContext,String,boolean)).
context - automatically passed by the xalan extension mechanism.fileName - name of the java source file.
NodeSet that represents the java source file.
WrappedRuntimeException - errors (file not found...).
public static NodeSet process(ExpressionContext context,
String fileName,
boolean tokensPos)
Node that represents a java source file.
<xsl:copy-of select="jsx:process($java-file)"/> |
context - automatically passed by the xalan extension mechanism.fileName - name of the java source file.tokensPos - if true, each "tok" or "stok" Node will include positions
coordinates (see
Token.toNode(...)).
NodeSet that represents the java source file.
WrappedRuntimeException - errors (file not found...).
public static NodeSet process(ExpressionContext context,
String fileName,
String nodesArl,
String tokensArl)
Node that represents a java source file.
<xsl:copy-of select="jsx:process($java-file,'','')"/> |
Token positions are not included (see
process(ExpressionContext,String,String,String,boolean)).
arl sequence
that defines which nodes should be accepted/removed/crossed. If the
this parameter is equals to "default", then default is used.
arl sequence
that defines which tokens should be accepted/removed/crossed. If the
this parameter is equals to "default", then default is used.
context - automatically passed by the xalan extension mechanism.fileName - name of the java source file.nodesArl - arl sequence that defines
which nodes should be accepted/removed/crossed.tokensArl - arl sequence that defines
which tokens should be accepted/removed/crossed.
NodeSet that represents the java source file.
WrappedRuntimeException - errors (file not found...).
public static NodeSet process(ExpressionContext context,
String fileName,
String nodesArl,
String tokensArl,
boolean tokensPos)
Node that represents a java source file.
<xsl:copy-of select="jsx:process($java-file,'','')"/> |
arl sequence
that defines which nodes should be accepted/removed/crossed.
arl sequence
that defines which tokens should be accepted/removed/crossed.
context - automatically passed by the xalan extension mechanism.fileName - name of the java source file.nodesArl - arl sequence that defines
which nodes should be accepted/removed/crossed. If the
this parameter is equals to "default", then default is used.tokensArl - arl sequence that defines
which tokens should be accepted/removed/crossed. If the
this parameter is equals to "default", then default is used.tokensPos - if true, each "tok" or "stok" Node will include positions
coordinates (see
Token.toNode(...)).
NodeSet that represents the java source file.
WrappedRuntimeException - errors (file not found...).
protected static NodeSet process(Document doc,
String fileName,
String nodesArl,
String tokensArl,
boolean tokensPos)
Node that represents a java source file.
fileName - name of the java source file.nodesArl - arl sequence that defines
which nodes should be accepted/removed/crossed.tokensArl - arl sequence that defines
which tokens should be accepted/removed/crossed.
NodeSet that represents the java source file.
WrappedRuntimeException - errors (file not found...).
protected static int[] getMap(String arl,
int[] defaultMap,
Hashtable cache)
int array based on the 'arl' expression. If the 'arl'
expression is already in the 'cache', just returns the existing int array, otherwise
creates a new one and puts it in the 'cache'.
arl - arl expression.defaultMap - int array used by default (if 'arl' is null).cache - cache used for this kind of arl (SimpleNode or Token).
public static NodeSet parseJavadoc(ExpressionContext context,
String comment)
NodeSet that contains all non empty lines in a Javadoc comment.
<xsl:copy-of select="jsx:parseJavadoc(tok/stok[@ki=10])"/> |
For example,
/** * Says "Hello <msg> !" * * @param msg the message to use in salutation. * @throws java.lang.IllegalArgumentException ... */ |
will be parsed into
<doc-line>
<![CDATA[ Says "Hello <msg> !"]]>
</doc-line>
<doc-line>
<![CDATA[ @param msg the message to use in salutations.]]>
</doc-line>
<doc-line>
<![CDATA[ @throws java.lang.IllegalArgumentException ...]]>
</doc-line>
|
context - automatically passed by the xalan extension mechanism.comment - the Javadoc comment to be parsed.
NodeSet with parsed lines.
WrappedRuntimeException - errors (DOM error).
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||