org.objectweb.jonathan.libs.kernel.decoders
Class OpenXMLDecoder

java.lang.Object
  extended by org.objectweb.jonathan.libs.kernel.decoders.OpenXMLDecoder
All Implemented Interfaces:
File2Configuration

public class OpenXMLDecoder
extends java.lang.Object
implements File2Configuration

XML to runtime components translator. Has built-in alias, atom, assemblage, include & property decoders. May handle any other component types as long as their specific decoders are provided.

In order to be able to decode a given custom-made component type, a specific TagCompiler must be implemented for this type, and provided in the OpenXMLDecoder configuration context (i.e. in its constructor Context parameter) as the value of an Element named after the component type's XML tag.

An instance of OpenXMLDecoder is automatically used at startup by Jonathan's KKernel to decode Jonathan's runtime configuration file. A complete configuration of OpenXMLDecoder is therefore provided in Jonathan's compiled boot configuration.

See Also:
KKernel

Constructor Summary
OpenXMLDecoder()
           
OpenXMLDecoder(Context _decoders)
          creates a new xml decoder with the given additional specific decoders
 
Method Summary
 void importElement(Context _configuration, java.lang.String _xml_file_name, ContextFactory _context_factory, ClassPathFinder _finder)
          imports an XML file in the given configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenXMLDecoder

public OpenXMLDecoder(Context _decoders)
creates a new xml decoder with the given additional specific decoders

Parameters:
_decoders - contains the additional specific decoders; their elements have the name of their component types' XML tags.

OpenXMLDecoder

public OpenXMLDecoder()
Method Detail

importElement

public void importElement(Context _configuration,
                          java.lang.String _xml_file_name,
                          ContextFactory _context_factory,
                          ClassPathFinder _finder)
                   throws JonathanException
imports an XML file in the given configuration. First reads the root XML element, and then dispatches its decoding to a new Dispatcher.

Specified by:
importElement in interface File2Configuration
Parameters:
_configuration - the destination configuration context
_xml_file_name - the XML source file name
_context_factory - used to create new Contexts
_finder - used to find the XML file (that's all??)
Throws:
JonathanException - if something goes wrong