/// <summary> /// This method is used to read the key value from the node. The /// value read from the node is resolved using the template filter. /// If the key value can not be found according to the annotation /// attributes then an exception is thrown. /// </summary> /// <param name="node"> /// this is the node to read the key value from /// </param> /// <returns> /// this returns the value deserialized from the node /// </returns> public Object Read(InputNode node) { Class expect = type.Type; String name = entry.Key; if (name == null) { name = context.GetName(expect); } if (!entry.IsAttribute()) { return(ReadElement(node, name)); } return(ReadAttribute(node, name)); }
/// <summary> /// This method is used to read the key value from the node. The /// value read from the node is resolved using the template filter. /// If the key value can not be found according to the annotation /// attributes then null is assumed and returned. /// </summary> /// <param name="node"> /// this is the node to read the key value from /// </param> /// <returns> /// this returns the value deserialized from the node /// </returns> public Object Read(InputNode node) { Position line = node.getPosition(); Class expect = type.Type; String name = entry.Key; if (name == null) { name = context.GetName(expect); } if (entry.IsAttribute()) { throw new ElementException("Can not have %s as an attribute at %s", expect, line); } return(Read(node, name)); }