/// <summary> /// This creates a <c>Scanner</c> object that can be used to /// examine the fields within the XML class schema. The scanner /// maintains information when a field from within the scanner is /// visited, this allows the serialization and deserialization /// process to determine if all required XML annotations are used. /// </summary> /// <param name="type"> /// the schema class the scanner is created for /// </param> /// <returns> /// a scanner that can maintains information on the type /// </returns> public Scanner GetInstance(Class type) { Scanner schema = cache.get(type); if(schema == null) { schema = new Scanner(type); cache.put(type, schema); } return schema; }
/// <summary> /// Constructor for the <c>Schema</c> object. This is used /// to wrap the element and attribute XML annotations scanned from /// a class schema. The schema tracks all fields visited so that /// a converter can determine if all fields have been serialized. /// </summary> /// <param name="schema"> /// this contains all labels scanned from the class /// </param> /// <param name="context"> /// this is the context object for serialization /// </param> public ClassSchema(Scanner schema, Context context) { this.attributes = schema.getAttributes(context); this.elements = schema.getElements(context); this.caller = schema.getCaller(context); this.factory = schema.Creator; this.revision = schema.Revision; this.decorator = schema.Decorator; this.primitive = schema.IsPrimitive(); this.version = schema.Version; this.text = schema.Text; this.type = schema.Type; }