|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonathan.tools.Kcf2java
Kcf2java (formerly called XML2Kernel) is a utility that compiles an XML configuration file into a java
class, and possibly compiles it and adds the compiled file to a jar archive.
This utility expects that the javac
and jar
commands
are available locally.
The name of the java class to generate should be specified as the "generated"
attribute of the configuration element; the class used to create the actual
bootstrap configuration should be specified using the "bootstrap" attribute,
like in :
Usage: java org.objectweb.jonathan.tools.Kcf2java [options] configuration-file
where options are:
-noc
:
if the generated java file should not be compiled.
-s srcdir
:
srcdir
is the (existing) directory where
the java file should be generated;
-d classdir
:
If classdir ends with ".jar", the java file is compiled locally (with
option -d .
) and the generated file is added to the mentioned
jar file; otherwise, this option is passed to javac when compilation
occurs.
-p properties_file
:
where Kcf2java finds which custom XML tag compilers it should
also use.
-verbose
:
tells Kcf2java to output messages on stderr.
Kcf2java has already a built-in configuration decoder, and already knows the following default tag compilers:
tag compiler
tag compiler
tag compiler
,
tag compiler
tag compiler
tag compiler
tag compiler
TagCompiler
interface
and to be provided as a line like the next one in the Kcf2java
properties file:
Constructor Summary | |
Kcf2java()
|
Method Summary | |
static void |
compile(java.io.InputStream _is,
java.lang.String _src_dir,
boolean _add_package_path_to_src_dir,
java.util.Properties _custom_properties,
boolean _verbose,
boolean _compile)
Compilation method to be used when Kcf2java is embedded in some application. |
static void |
main(java.lang.String[] args)
The main method. |
static java.lang.String |
normalize(java.lang.String str)
Normalizes the provided string, by trimming and handling backslashes |
static java.lang.String |
writeComponent(nanoxml.XMLElement _current_component,
java.lang.String _element_name,
java.lang.String _configuration_var_name,
java.io.Writer _writer,
java.lang.String _configuration_name)
Compiles the provided component using the provided writer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Kcf2java()
Method Detail |
public static void main(java.lang.String[] args)
args
- see the description of the Kcf2java
class.public static void compile(java.io.InputStream _is, java.lang.String _src_dir, boolean _add_package_path_to_src_dir, java.util.Properties _custom_properties, boolean _verbose, boolean _compile) throws JonathanException
_is
- an InputStream to the configuration to compile;_src_dir
- the directory where the source files should be generated;_add_package_path_to_src_dir
- true if Kcf2java should generate
the file taking into account the package name of the class to
generate, false if the file should be generated directly in _src_dir
_custom_properties
- the properties representing custom tag decoders;_verbose
- indicates whether error messages and warnings should be
output to stderr_compile
- indicates whether the generated Java file should be compiled.
JonathanException
- if something goes wrong.public static java.lang.String normalize(java.lang.String str)
str
- the string to normalize
public static java.lang.String writeComponent(nanoxml.XMLElement _current_component, java.lang.String _element_name, java.lang.String _configuration_var_name, java.io.Writer _writer, java.lang.String _configuration_name) throws java.io.IOException
_current_component
- the component to compile_element_name
- its name in the current configuration_configuration_var_name
- the variable name of the current configuration (may be null)_writer
- the writer to which the compiled version is output_configuration_name
- the absolute name of the current configuration
java.io.IOException
- if something goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |