Array containing the variable names that should be ignored by the codec.
Array containing the variable names that should be turned into or converted from references. See Codec.getId and Codec.getObject.
Maps from field names to XML attribute names.
Maps from XML attribute names to fieldnames.
Holds the template object associated with this codec.
Static
allowStatic global switch that specifies if expressions in arrays are allowed.
NOTE: Enabling this carries a possible security risk.
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 field name as a key. If the field name 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.
Hook for subclassers to post-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.
Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. This implementation returns the input node. The return value of this method is returned to the encoder from encode.
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.
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.
Converts booleans and numeric values to the respective types. Values are numeric if isNumericAttribute returns true.
Converts true to "1" and false to "0" is isBooleanAttribute returns true. All other values are not converted.
Parses the given node into the object or returns a new object representing the given node.
Dec is a reference to the calling decoder. It is used to decode complex objects and resolve references.
If a node has an id attribute then the object cache is checked for the object. If the object is not yet in the cache then it is constructed using the constructor of template and cached in Codec.objects.
This implementation decodes all attributes and childs of a node according to the following rules:
For add nodes where the object is not an array and the variable name is defined, the default mechanism is used, allowing to override/add methods as follows:
<Object>
<add as="hello"><![CDATA[
function(arg1) {
mxUtils.alert('Hello '+arg1);
}
]]></add>
</Object>
If no object exists for an ID in idrefs a warning is issued using GlobalConfig.logger.
Returns the resulting object that represents the given XML node or the object given to the method as the into parameter.
Decodes all attributes of the given node using decodeAttribute.
Decodes all children of the given node using decodeChild.
Calls decodeAttributes and decodeChildren for the given node.
Encodes the given GraphView using encodeCell starting at the model's root. This returns the top-level graph node of the recursive encoding.
Recursively encodes the specified cell.
Uses layer as the default node name. If the cell's parent is null, then graph is used for the node name.
If Cell.isEdge returns true
for the cell, then edge is used for the node name, else if Cell.isVertex returns true
for the cell,
then vertex is used for the node name.
Graph.getLabel is used to create the label attribute for the cell. For graph nodes and vertices the bounds are encoded into x, y, width and height. For edges the points are encoded into a points attribute as a space-separated list of comma-separated coordinate pairs (e.g. x0,y0 x1,y1 ... xn,yn). All values from the cell style are added as attribute values to the node.
Encodes the value of each member in then given obj into the given node using encodeValue.
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.
Returns the attribute name for the given field name. Looks up the value in the mapping or returns the input if there is no mapping for the given name.
Returns the field name for the given attribute name. Looks up the value in the reverse mapping or returns the input if there is no reverse mapping for the given name.
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.
Returns the name used for the node names 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 from what this returns.
The default implementation returns the classname of the template class if no name is set.
Returns true if the given attribute is to be ignored by the codec. This implementation returns true if the given field name is in exclude or if the field name equals ObjectIdentity.FIELD_NAME.
Object instance that contains the field.
Fieldname of the field.
Value of the field.
Optional
write: booleanBoolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.
Returns true if the given field name is to be treated as a textual reference (ID). This implementation returns true if the given field name is in idrefs.
Object instance that contains the field.
Field name of the field.
Value of the field.
Optional
write: booleanBoolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.
Writes the given value into node using writePrimitiveAttribute or writeComplexAttribute depending on the type of the value.
Writes the given value as a child node of the given node.
Writes the given value as an attribute of the given node.
Custom encoder for GraphViews.
This class is created and registered dynamically at load time and used implicitly via Codec and the CodecRegistry.
This codec only writes views into an XML format that can be used to create an image for the graph, that is, it contains absolute coordinates with computed perimeters, edge styles and cell styles.