示例#1
0
 /// <summary>
 /// This <c>read</c> method is used to perform deserialization
 /// of the provided node object using a delegate converter. This is
 /// typically another <c>Composite</c> converter, or if the
 /// node is an attribute a <c>Primitive</c> converter. When
 /// the delegate converter has completed the deserialized value is
 /// assigned to the contact.
 /// </summary>
 /// <param name="node">
 /// this is the node that contains the contact value
 /// </param>
 /// <param name="source">
 /// the type of the object that is being deserialized
 /// </param>
 /// <param name="label">
 /// this is the label used to create the converter
 /// </param>
 public Object Read(InputNode node, Object source, Label label) {
    Object object = ReadObject(node, source, label);
    if(object == null) {
       Position line = node.getPosition();
       Class expect = type.Type;
       if(source != null) {
          expect = source.getClass();
       }
       if(label.isRequired() && revision.IsEqual()) {
          throw new ValueRequiredException("Empty value for %s in %s at %s", label, expect, line);
       }
    } else {
       if(object != label.getEmpty(context)) {
          criteria.Set(label, object);
       }
    }
    return object;
 }