FreeHEP API
Version current

org.freehep.xml.io
Interface XMLIORegistry

All Known Implementing Classes:
DefaultXMLIORegistry

public interface XMLIORegistry

Interface of an XMLIORegistry. The XMLIOFactories used in the restore procedure of an object and the XMLIOProxyes should be register to an XMLIORegistry that should be set in the XMLIOManager passed to the restore method.

Version:
1.0
Author:
turri
Source Code:
XMLIORegistry.java

Method Summary
 String getClassId(Class clName)
          Get the identification string corresponding to a Class.
 Class getIdClass(String objName)
          Get the Class corresponding to an identification String.
 XMLIOFactory getXMLIOFactory(Class objClass)
          Get the appropriate XMLIOFactory to create the object that wrote the xml node.
 XMLIOProxy getXMLIOProxy(Class objClass)
          Get the appropriate XMLIOProxy to restore the object that wrote the xml node.
 void register(Object obj)
          Register an XMLIOFactory or an XMLIOProxy to this Registry.
 

Method Detail

register

public void register(Object obj)
              throws IllegalArgumentException
Register an XMLIOFactory or an XMLIOProxy to this Registry.

Parameters:
obj - Either an XMLIOFactory or an XMLIOProxy to be registered.
Throws:
An - IllegalArgumentException if the object does not implement either XMLIOFactory or XMLIOProxy.
IllegalArgumentException

getXMLIOFactory

public XMLIOFactory getXMLIOFactory(Class objClass)
                             throws IllegalArgumentException
Get the appropriate XMLIOFactory to create the object that wrote the xml node. The XMLIOFactory identification string is attached to the node's attribute xmlioFactory<\code>. If this attribute is not present, the node name is taken as the identification string. The identification string is assigned by the XMLIOManager by using the object's final part of the Class name.

Parameters:
objClass - The Class of the object to be created.
Returns:
The corresponding XMLIOFactory.
Throws:
IllegalArgumentException - if the XMLIOFactory does not exist.

getXMLIOProxy

public XMLIOProxy getXMLIOProxy(Class objClass)
                         throws IllegalArgumentException
Get the appropriate XMLIOProxy to restore the object that wrote the xml node. The XMLIOProxy identification string is the node name. The identification string is assigned by the XMLIOManager by using the object's final part of the Class name.

Parameters:
objClass - The Class of the object to be restored.
Returns:
The corresponding XMLIOProxy.
Throws:
IllegalArgumentException - if the XMLIOProxy does not exist.

getClassId

public String getClassId(Class clName)
Get the identification string corresponding to a Class.

Parameters:
clName - The Class.
Returns:
The identification String.

getIdClass

public Class getIdClass(String objName)
Get the Class corresponding to an identification String.

Parameters:
objName - The object's identification String.
Returns:
The corresponding Class.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.