mxGraph
Public Member Functions | Protected Member Functions | List of all members
com.mxgraph.mxStylesheetCodec Class Reference

Codec for mxStylesheets. This class is created and registered dynamically at load time and used implicitely via mxCodec and the mxCodecRegistry. More...

Inheritance diagram for com.mxgraph.mxStylesheetCodec:
com.mxgraph.mxObjectCodec

Public Member Functions

 mxStylesheetCodec ()
 Constructs a new stylesheet codec. More...
 
 mxStylesheetCodec (Object template)
 Constructs a new stylesheet codec for the given template. More...
 
 mxStylesheetCodec (Object template, String[] exclude, String[] idrefs, Dictionary< string, string > mapping)
 Constructs a new stylesheet codec for the given arguments. More...
 
override XmlNode Encode (mxCodec enc, Object obj)
 Encode the given mxStylesheet. More...
 
override Object Decode (mxCodec dec, XmlNode node, Object into)
 Decodes the given mxStylesheet. More...
 
- Public Member Functions inherited from com.mxgraph.mxObjectCodec
 mxObjectCodec (Object template)
 Constructs a new codec for the specified template object. More...
 
 mxObjectCodec (Object template, string[] exclude, string[] idrefs, Dictionary< string, string > mapping)
 Constructs a new codec for the specified template object. The variables in the optional exclude array are ignored by the codec. Variables in the optional idrefs array are turned into references in the XML. The optional mapping may be used to map from variable names to XML attributes. More...
 
string GetName ()
 Returns the name used for the nodenames and lookup of the codec when classes are encoded and nodes are decoded. For classes to work with this the codec registry automatically adds an alias for the classname if that is different than what this returns. The default implementation returns the classname of the template class. More...
 
virtual bool IsExcluded (Object obj, string attr, Object value, bool write)
 Returns true if the given attribute is to be ignored by the codec. This implementation returns true if the given fieldname is in exclude. More...
 
virtual bool IsReference (Object obj, string attr, Object value, bool write)
 Returns true if the given fieldname is to be treated as a textual reference (ID). This implementation returns true if the given fieldname is in idrefs. More...
 
virtual Object BeforeEncode (mxCodec enc, Object obj, XmlNode node)
 Hook for subclassers to pre-process the object before encoding. This returns the input object. The return value of this function is used in encode to perform the default encoding into the given node. More...
 
virtual XmlNode AfterEncode (mxCodec enc, Object obj, XmlNode node)
 Hook for subclassers to Receive-process the node for the given object after encoding and return the Receive-processed node. This implementation returns the input node. The return value of this method is returned to the encoder from encode. More...
 
virtual Object Decode (mxCodec dec, XmlNode node)
 Parses the given node into the object or returns a new object representing the given node. More...
 
bool ProcessInclude (mxCodec dec, XmlNode node, Object into)
 
virtual XmlNode BeforeDecode (mxCodec dec, XmlNode node, Object obj)
 Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by decode. The object is created based on the template in the calling method and is never null. This implementation returns the input node. The return value of this function is used in decode to perform the default decoding into the given object. More...
 
virtual Object AfterDecode (mxCodec dec, XmlNode node, Object obj)
 Hook for subclassers to Receive-process the object after decoding. This implementation returns the given object without any changes. The return value of this method is returned to the decoder from decode. More...
 

Protected Member Functions

string getStringValue (KeyValuePair< string, Object > entry)
 Returns the string for encoding the given value. More...
 
- Protected Member Functions inherited from com.mxgraph.mxObjectCodec
virtual Object CloneTemplate (XmlNode node)
 Returns a new instance of the template object for representing the given node. More...
 
virtual void EncodeObject (mxCodec enc, Object obj, XmlNode node)
 Encodes the value of each member in then given obj into the given node using encodeFields and encodeElements. More...
 
void EncodeFields (mxCodec enc, Object obj, XmlNode node)
 Encodes the members of the given object into the given node. More...
 
void EncodeElements (mxCodec enc, Object obj, XmlNode node)
 Encodes the child objects of arrays, dictionaries and enumerables. More...
 
void EncodeValue (mxCodec enc, Object obj, string fieldname, Object value, XmlNode node)
 Converts the given value according to the mappings and id-refs in this codec and uses writeAttribute to write the attribute into the given node. More...
 
bool IsPrimitiveValue (Object value)
 Returns true if the given object is a primitive value. More...
 
void WriteAttribute (mxCodec enc, Object obj, string attr, Object value, XmlNode node)
 Writes the given value into node using writePrimitiveAttribute or writeComplexAttribute depending on the type of the value.
 
void WritePrimitiveAttribute (mxCodec enc, Object obj, string attr, Object value, XmlNode node)
 Writes the given value as an attribute of the given node. More...
 
void WriteComplexAttribute (mxCodec enc, Object obj, string attr, Object value, XmlNode node)
 Writes the given value as a child node of the given node. More...
 
virtual Object ConvertValueToXml (Object value)
 Converts true to "1" and false to "0". All other values are ignored. More...
 
virtual Object ConvertValueFromXml (Type type, Object value)
 Converts XML attribute values to object of the given type. More...
 
string GetAttributeName (string fieldname)
 Returns the XML node attribute name for the given C# field name. That is, it returns the mapping of the field name. More...
 
string GetFieldName (string attributename)
 Returns the C# field name for the given XML attribute name. That is, it returns the reverse mapping of the attribute name. More...
 
Object GetFieldValue (Object obj, string name)
 Returns the value of the field with the specified name in the specified object instance. More...
 
void SetFieldValue (Object obj, string name, Object value)
 Sets the value of the field with the specified name in the specified object instance. More...
 
void DecodeNode (mxCodec dec, XmlNode node, Object obj)
 Calls decodeAttributes and decodeChildren for the given node. More...
 
void DecodeAttributes (mxCodec dec, XmlNode node, Object obj)
 Decodes all attributes of the given node using decodeAttribute. More...
 
void DecodeAttribute (mxCodec dec, XmlNode attr, Object obj)
 Reads the given attribute into the specified object. More...
 
void DecodeChildren (mxCodec dec, XmlNode node, Object obj)
 Reads the given attribute into the specified object. More...
 
void DecodeChild (mxCodec dec, XmlNode child, Object obj)
 Reads the specified child into the given object. More...
 
Object GetFieldTemplate (Object obj, String fieldname, XmlNode child)
 Returns the template instance for the given field. This returns the value of the field, null if the value is an array or an empty collection if the value is a collection. The value is then used to populate the field for a new instance. For strongly typed languages it may be required to override this to return the correct collection instance based on the encoded child. More...
 
void AddObjectValue (Object obj, String fieldname, Object value, Object template)
 Sets the decoded child node as a value of the given object. If the object is a map, then the value is added with the given fieldname as a key. If the fieldname is not empty, then setFieldValue is called or else, if the object is a collection, the value is added to the collection. For strongly typed languages it may be required to override this with the correct code to add an entry to an object. More...
 

Additional Inherited Members

- Protected Attributes inherited from com.mxgraph.mxObjectCodec
Object template
 Holds the template object associated with this codec. More...
 
List< string > exclude
 Array containing the variable names that should be ignored by the codec. More...
 
List< string > idrefs
 Array containing the variable names that should be turned into or converted from references. See mxCodec.getId and mxCodec.getObject. More...
 
Dictionary< string, string > mapping
 Maps from from fieldnames to XML attribute names. More...
 
Dictionary< string, string > reverse
 Maps from from XML attribute names to fieldnames. More...
 
- Properties inherited from com.mxgraph.mxObjectCodec
Object Template [get]
 Returns the template object associated with this codec. More...
 

Detailed Description

Codec for mxStylesheets. This class is created and registered dynamically at load time and used implicitely via mxCodec and the mxCodecRegistry.

Constructor & Destructor Documentation

com.mxgraph.mxStylesheetCodec.mxStylesheetCodec ( )
inline

Constructs a new stylesheet codec.

com.mxgraph.mxStylesheetCodec.mxStylesheetCodec ( Object  template)
inline

Constructs a new stylesheet codec for the given template.

com.mxgraph.mxStylesheetCodec.mxStylesheetCodec ( Object  template,
String[]  exclude,
String[]  idrefs,
Dictionary< string, string >  mapping 
)
inline

Constructs a new stylesheet codec for the given arguments.

Member Function Documentation

override Object com.mxgraph.mxStylesheetCodec.Decode ( mxCodec  dec,
XmlNode  node,
Object  into 
)
inlinevirtual
override XmlNode com.mxgraph.mxStylesheetCodec.Encode ( mxCodec  enc,
Object  obj 
)
inlinevirtual

Encode the given mxStylesheet.

Reimplemented from com.mxgraph.mxObjectCodec.

References com.mxgraph.mxCodec.Document.

string com.mxgraph.mxStylesheetCodec.getStringValue ( KeyValuePair< string, Object >  entry)
inlineprotected

Returns the string for encoding the given value.


The documentation for this class was generated from the following file: