public class mxCodecRegistry
extends java.lang.Object
mxCodec
for an example.Modifier and Type | Field and Description |
---|---|
protected static java.util.Hashtable<java.lang.String,java.lang.String> |
aliases
Maps from classnames to codecnames.
|
protected static java.util.Hashtable<java.lang.String,mxObjectCodec> |
codecs
Maps from constructor names to codecs.
|
protected static java.util.List<java.lang.String> |
packages
Holds the list of known packages.
|
Constructor and Description |
---|
mxCodecRegistry() |
Modifier and Type | Method and Description |
---|---|
static void |
addAlias(java.lang.String classname,
java.lang.String codecname)
Adds an alias for mapping a classname to a codecname.
|
static void |
addPackage(java.lang.String packagename)
Adds the given package name to the list of known package names.
|
static java.lang.Class<?> |
getClassForName(java.lang.String name)
Returns a class that corresponds to the given name.
|
static mxObjectCodec |
getCodec(java.lang.String name)
Returns a codec that handles the given object, which can be an object
instance or an XML node.
|
static java.lang.Object |
getInstanceForName(java.lang.String name)
Creates and returns a new instance for the given class name.
|
static java.lang.String |
getName(java.lang.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.
|
protected static java.util.Hashtable<java.lang.String,mxObjectCodec> codecs
protected static java.util.Hashtable<java.lang.String,java.lang.String> aliases
protected static java.util.List<java.lang.String> packages
public static mxObjectCodec register(mxObjectCodec codec)
public static void addAlias(java.lang.String classname, java.lang.String codecname)
public static mxObjectCodec getCodec(java.lang.String name)
name
- Java class name.public static void addPackage(java.lang.String packagename)
packagename
- Name of the package to be added.public static java.lang.Object getInstanceForName(java.lang.String name)
name
- Name of the class to be instantiated.public static java.lang.Class<?> getClassForName(java.lang.String name)
name
- public static java.lang.String getName(java.lang.Object instance)
com.mxgraph.model.mxCell
this returns
mxCell
.instance
- Instance whose node name should be returned.Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.