com::mxgraph::mxCodecRegistry Class Reference

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

static void com::mxgraph::mxCodecRegistry::AddAlias ( string  classname,
string  codecname 
) [inline, static]

Adds an alias for mapping a classname to a codecname.

static void com::mxgraph::mxCodecRegistry::AddNamespace ( String  ns  )  [inline, static]

Adds the given namespace to the list of known namespaces.

Parameters:
ns Name of the namespace to be added.
static mxObjectCodec com::mxgraph::mxCodecRegistry::GetCodec ( String  name  )  [inline, static]

Returns a codec that handles the given object, which can be an object instance or an XML node.

Parameters:
name C# type name.
Returns:
static Object com::mxgraph::mxCodecRegistry::GetInstanceForName ( String  name  )  [inline, static]

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.
static String com::mxgraph::mxCodecRegistry::GetName ( Object  instance  )  [inline, static]

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.
static Type com::mxgraph::mxCodecRegistry::GetTypeForName ( String  name  )  [inline, static]

Returns a class that corresponds to the given name.

Parameters:
name 
Returns:
static mxObjectCodec com::mxgraph::mxCodecRegistry::Register ( mxObjectCodec  codec  )  [inline, static]

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

Dictionary<string, string> com::mxgraph::mxCodecRegistry::aliases = new Dictionary<string, string>() [static, protected]

Maps from classnames to codecnames.

Dictionary<string, mxObjectCodec> com::mxgraph::mxCodecRegistry::codecs = new Dictionary<string, mxObjectCodec>() [static, protected]

Maps from constructor names to codecs.

List<string> com::mxgraph::mxCodecRegistry::namespaces = new List<string>() [static, protected]

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:
Generated on Tue Jul 31 15:03:31 2012 for mxGraph by  doxygen 1.6.3