Modifier and Type | Field and Description |
---|---|
protected static Hashtable<String,String> |
aliases
Maps from classnames to codecnames.
|
protected static Hashtable<String,mxObjectCodec> |
codecs
Maps from constructor names to codecs.
|
protected static List<String> |
packages
Holds the list of known packages.
|
Constructor and Description |
---|
mxCodecRegistry() |
Modifier and Type | Method and Description |
---|---|
static void |
addAlias(String classname,
String codecname)
Adds an alias for mapping a classname to a codecname.
|
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.
|
protected static Hashtable<String,mxObjectCodec> codecs
public static mxObjectCodec register(mxObjectCodec codec)
public static void addAlias(String classname, String codecname)
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.Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.