/** * Encodes the value of each member in then given obj * into the given node using {@link #encodeFields(mxCodec, Object, Node)} * and {@link #encodeElements(mxCodec, Object, Node)}. * * @param enc Codec that controls the encoding process. * @param obj Object to be encoded. * @param node XML node that contains the encoded object. */ protected void encodeObject(mxCodec enc, Object obj, Node node) { mxCodec.setAttribute(node, "id", enc.getId(obj)); encodeFields(enc, obj, node); encodeElements(enc, obj, node); }
/** * Encodes the value of each member in then given obj * into the given node using {@link #encodeFields(mxCodec, Object, Node)} * and {@link #encodeElements(mxCodec, Object, Node)}. * * @param enc Codec that controls the encoding process. * @param obj Object to be encoded. * @param node XML node that contains the encoded object. */ protected void encodeObject(mxCodec enc, Object obj, Node node) { mxCodec.setAttribute(node, "id", enc.getId(obj)); encodeFields(enc, obj, node); encodeElements(enc, obj, node); }
@Override public Node afterEncode(mxCodec enc, Object obj, Node node) { if (obj instanceof mxChildChange) { mxChildChange change = (mxChildChange) obj; Object child = change.getChild(); if (isReference(obj, "child", child, true)) { // Encodes as reference (id) mxCodec.setAttribute(node, "child", enc.getId(child)); } else { // At this point, the encoder is no longer able to know which cells // are new, so we have to encode the complete cell hierarchy and // ignore the ones that are already there at decoding time. Note: // This can only be resolved by moving the notify event into the // execute of the edit. enc.encodeCell((mxICell) child, node, true); } } return node; }
@Override public Node afterEncode(mxCodec enc, Object obj, Node node) { if (obj instanceof mxChildChange) { mxChildChange change = (mxChildChange) obj; Object child = change.getChild(); if (isReference(obj, "child", child, true)) { // Encodes as reference (id) mxCodec.setAttribute(node, "child", enc.getId(child)); } else { // At this point, the encoder is no longer able to know which cells // are new, so we have to encode the complete cell hierarchy and // ignore the ones that are already there at decoding time. Note: // This can only be resolved by moving the notify event into the // execute of the edit. enc.encodeCell((mxICell) child, node, true); } } return node; }
Object tmp = enc.getId(value);
Object tmp = enc.getId(value);