Static class that acts as a global registry for codecs. See mxCodec for an example of using this class.
More...
List of all members.
Static Public Member Functions |
static mxObjectCodec | Register (mxObjectCodec codec) |
| 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.
|
static void | AddAlias (string classname, string codecname) |
| Adds an alias for mapping a classname to a codecname.
|
static mxObjectCodec | GetCodec (String name) |
| Returns a codec that handles the given object, which can be an object instance or an XML node.
|
static void | AddNamespace (String ns) |
| Adds the given namespace to the list of known namespaces.
|
static Object | GetInstanceForName (String name) |
| Creates and returns a new instance for the given class name.
|
static Type | GetTypeForName (String name) |
| Returns a class that corresponds to the given name.
|
static String | GetName (Object instance) |
| Returns the name that identifies the codec associated with the given instance. The I/O system uses unqualified classnames, eg. for a com.mxgraph.model.mxCell this returns mxCell.
|
Static Protected Attributes |
static Dictionary< string,
mxObjectCodec > | codecs = new Dictionary<string, mxObjectCodec>() |
| Maps from constructor names to codecs.
|
static Dictionary< string, string > | aliases = new Dictionary<string, string>() |
| Maps from classnames to codecnames.
|
static List< string > | namespaces = new List<string>() |
| Holds the list of known namespaces. Packages are used to prefix short class names (eg. mxCell) in XML markup.
|
Detailed Description
Static class that acts as a global registry for codecs. See mxCodec for an example of using this class.
Member Function Documentation
Adds an alias for mapping a classname to a codecname.
Adds the given namespace to the list of known namespaces.
- Parameters:
-
ns | Name of the namespace to be added. |
Returns a codec that handles the given object, which can be an object instance or an XML node.
- Parameters:
-
- Returns:
Creates and returns a new instance for the given class name.
- Parameters:
-
name | Name of the class to be instantiated. |
- Returns:
- Returns a new instance of the given class.
Returns the name that identifies the codec associated with the given instance. The I/O system uses unqualified classnames, eg. for a com.mxgraph.model.mxCell this returns mxCell.
- Parameters:
-
instance | Instance whose node name should be returned. |
- Returns:
- Returns a string that identifies the codec.
Returns a class that corresponds to the given name.
- Parameters:
-
- Returns:
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.
Member Data Documentation
Maps from classnames to codecnames.
Maps from constructor names to codecs.
Holds the list of known namespaces. Packages are used to prefix short class names (eg. mxCell) in XML markup.
The documentation for this class was generated from the following file:
- src/io/mxCodecRegistry.cs