| java.lang.Object fr.dyade.koala.xml.kbml.KBMLDeserializer
All known Subclasses: fr.dyade.koala.xml.kbml.KBMLDeserializerDefaultErrorHandler,
KBMLDeserializer | public class KBMLDeserializer (Code) | | The class enables to create JavaBeans from an XML document. Example of use:
FileInputStream istream = new FileInputStream("test.kbml");
KBMLDeserializer bxi = new KBMLDeserializer(istream);
bean1 = bxi.readBean();
bean2 = bxi.readBean();
bxi.close();
author: Thierry.Kormann@sophia.inria.fr |
Inner Class :public interface ErrorHandler | |
Constructor Summary | |
public | KBMLDeserializer(InputStream istream) Constructs a new deserializer with the specified input
stream. | public | KBMLDeserializer(InputStream istream, ErrorHandler handler) Constructs a new deserializer with the specified input stream
and error handler.
Parameters: istream - the input stream Parameters: handler - the handler to track the no-fatal error exception: ClassNotFoundException - if the SAX parser can't befound (check your CLASSPATH) exception: InstantiationException - if the SAX parser can't beinstanciated (it's an interface or abstract class) exception: IllegalAccessException - The SAX parser class wasfound, but you do not have permission to load it. exception: java.lang.ClassCastException - The SAX parser classwas found and instantiated, but does not implementorg.xml.sax.Parser. | public | KBMLDeserializer(Reader reader) Constructs a new deserializer with the specified reader. | public | KBMLDeserializer(Reader reader, ErrorHandler handler) Constructs a new deserializer with the specified reader
and error handler.
Parameters: reader - the reader Parameters: handler - the handler to track the no-fatal errort exception: ClassNotFoundException - if the SAX parser can't befound (check your CLASSPATH) exception: InstantiationException - if the SAX parser can't beinstanciated (it's an interface or abstract class) exception: IllegalAccessException - The SAX parser class wasfound, but you do not have permission to load it. exception: java.lang.ClassCastException - The SAX parser classwas found and instantiated, but does not implementorg.xml.sax.Parser. |
VERSION | final public static String VERSION(Code) | | The KBML version.
|
beansCache | protected Hashtable beansCache(Code) | | The Hashtable where keys are Object and values are ID.
|
handler | protected ErrorHandler handler(Code) | | The error handler used to notify no-fatal errors.
|
istream | protected InputStream istream(Code) | | The underlying input stream where to get the beans.
|
reader | protected Reader reader(Code) | | The underlying reader where to get the beans.
|
getBeansCache | public Hashtable getBeansCache()(Code) | | Returns the internal cache used by the deserializer. Use the ID of
an element as a key to get its associated bean.
|
instanciateBean | protected Object instanciateBean(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodError, IOException(Code) | | Returns an instance that corresponds to the specified
classname. This method is invoked each time the class attribute
is specified while parsing a bean element from the XML
document. Default behavior use the default class loader to
instanciate the bean.
Override to have the opportunity to use custom class
loaders. For example, the class name can be an URL that points
to a class file. This method parses the class name and use an
URL class loader to create the right instance.
See Also: KBMLSerializer.getBeanClassName(java.lang.Object) exception: IOException - if the bean can't be instantiate by theBeans.instanciate(ClassLoader, String) method exception: ClassNotFoundException - if the bean can't befound (check your CLASSPATH) exception: InstantiationException - if the bean can't beinstanciated (it's an interface or abstract class) exception: IllegalAccessException - The bean class wasfound, but you do not have permission to load it. exception: NoSuchMethodError - The zero-argument constructor ofthe bean was not found. a new bean instance corresponding to the specified class name. since: KBML 2.2 |
|
|