org.jscience.architecture.traffic.xml
Interface InstantiationAssistant

All Known Implementing Classes:
ACGJ1, ACGJ2, ACGJ3, ACGJ3FixedValue, ACGJ4, ACGJ5, EdgeNode, GenNeuralTLC, Junction, NetTunnel, Node, NonTLJunction, SL1TLC, SL2TLC, SL3TLC, SL4TLC, SL5TLC, SL6TLC, SPData, SpecialNode, TC1B1, TC1TLCDestless, TC1TLCFix, TC1TLCOpt, TC2B1, TC2Final, TC2TLCDestless, TC2TLCOpt, TC3B1, TC3Opt, TC3TLCWorkInProgress

public interface InstantiationAssistant

The GLD user documentation defines InstantiationAssistant as "Your friendly class creator who gives you a warm and fuzzy feeling inside". The technical documentation says that it is just another interface which classes can implement if they can create classes that the XML Parser cannot instantiate. For instance non-static inner classes. The parser has to figure out which InstantiationAssistant to use : for an inner class it will normally use the parent class.


Method Summary
 boolean canCreateInstance(java.lang.Class request)
          Tell our parser if we can create an instance of a certain class
 java.lang.Object createInstance(java.lang.Class request)
          Create an instance of a certain class for our parser
 

Method Detail

canCreateInstance

boolean canCreateInstance(java.lang.Class request)
Tell our parser if we can create an instance of a certain class

Parameters:
request - The class of the object that the parser wants
Returns:
Can we create that?

createInstance

java.lang.Object createInstance(java.lang.Class request)
                                throws java.lang.ClassNotFoundException,
                                       java.lang.InstantiationException,
                                       java.lang.IllegalAccessException
Create an instance of a certain class for our parser

Parameters:
request - The class of the object that the parser wants
Returns:
An instance of that object
Throws:
java.lang.ClassNotFoundException - If we don't know that class
java.lang.InstantiationException - In case something goes wrong
java.lang.IllegalAccessException - DOCUMENT ME!