org.javagroups.conf
Class ClassConfigurator

java.lang.Object
  |
  +--org.javagroups.conf.ClassConfigurator

public class ClassConfigurator
extends java.lang.Object

This class will be replaced with the class that read info from the magic number configurator that reads info from the xml file

Author:
Filip Hanik, Bela Ban

Method Summary
 java.lang.Class get(int magic)
          Returns a class for a magic number.
 java.lang.Class get(java.lang.String clazzname)
          Loads and returns the class from the class name
static ClassConfigurator getInstance()
           
 int getMagicNumber(java.lang.Class clazz)
          Returns the magic number for the class.
static void main(java.lang.String[] args)
           
 java.lang.String printClassMap()
           
 java.lang.String printMagicMap()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static ClassConfigurator getInstance()

get

public java.lang.Class get(int magic)
Returns a class for a magic number. Returns null if no class is found
Parameters:
magic - the magic number that maps to the class
Returns:
a Class object that represents a class that implements java.io.Externalizable

get

public java.lang.Class get(java.lang.String clazzname)
Loads and returns the class from the class name
Parameters:
clazzname - a fully classified class name to be loaded
Returns:
a Class object that represents a class that implements java.io.Externalizable

getMagicNumber

public int getMagicNumber(java.lang.Class clazz)
Returns the magic number for the class.
Parameters:
clazz - a class object that we want the magic number for
Returns:
the magic number for a class, -1 if no mapping is available

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

printMagicMap

public java.lang.String printMagicMap()

printClassMap

public java.lang.String printClassMap()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception


Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.