Class mxCodecRegistry
java.lang.Object
com.mxgraph.io.mxCodecRegistry
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds an alias for mapping a classname to a codecname.static voidaddPackage(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 mxObjectCodecReturns a codec that handles the given object, which can be an object instance or an XML node.static ObjectgetInstanceForName(String name) Creates and returns a new instance for the given class name.static StringReturns the name that identifies the codec associated with the given instance..static mxObjectCodecregister(mxObjectCodec codec) Registers a new codec and associates the name of the template constructor in the codec with the codec object.
-
Field Details
-
codecs
Maps from constructor names to codecs. -
aliases
-
packages
-
-
Constructor Details
-
mxCodecRegistry
public mxCodecRegistry()
-
-
Method Details
-
register
Registers a new codec and associates the name of the template constructor in the codec with the codec object. Automatically creates an alias if the codename and the classname are not equal. -
addAlias
-
getCodec
Returns a codec that handles the given object, which can be an object instance or an XML node.- Parameters:
name- Java class name.
-
addPackage
Adds the given package name to the list of known package names.- Parameters:
packagename- Name of the package to be added.
-
getInstanceForName
-
getClassForName
-
getName
Returns the name that identifies the codec associated with the given instance.. The I/O system uses unqualified classnames, eg. for acom.mxgraph.model.mxCellthis returnsmxCell.- Parameters:
instance- Instance whose node name should be returned.- Returns:
- Returns a string that identifies the codec.
-