|
JGraph X 1.2.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mxgraph.io.mxCodecRegistry
public class mxCodecRegistry
Singleton class that acts as a global registry for codecs. See
mxCodec
for an example.
Field Summary | |
---|---|
protected static Hashtable<String,mxObjectCodec> |
codecs
Maps from constructor names to codecs. |
protected static List<String> |
packages
Holds the list of known packages. |
Constructor Summary | |
---|---|
mxCodecRegistry()
|
Method Summary | |
---|---|
static void |
addPackage(String packagename)
Adds the given package name to the list of known package names. |
static Class |
getClassForName(String name)
Returns a class that corresponds to the given name. |
static mxObjectCodec |
getCodec(String name)
Returns a codec that handles the given object, which can be an object instance or an XML node. |
static Object |
getInstanceForName(String name)
Creates and returns a new instance for the given class name. |
static String |
getName(Object instance)
Returns the name that identifies the codec associated with the given instance.. |
static mxObjectCodec |
register(mxObjectCodec codec)
Registers a new codec and associates the name of the template constructor in the codec with the codec object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Hashtable<String,mxObjectCodec> codecs
protected static List<String> packages
Constructor Detail |
---|
public mxCodecRegistry()
Method Detail |
---|
public static mxObjectCodec register(mxObjectCodec codec)
codec
- Codec to be registered under the name returned by
getName(Object)
for the class of the codec's template.public static mxObjectCodec getCodec(String name)
name
- Java class name.public static void addPackage(String packagename)
packagename
- Name of the package to be added.public static Object getInstanceForName(String name)
name
- Name of the class to be instantiated.
public static Class getClassForName(String name)
name
-
public static String getName(Object instance)
com.mxgraph.model.mxCell
this returns
mxCell
.
instance
- Instance whose node name should be returned.
|
JGraph X 1.2.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |