The PrimitiveFactory object is used to create objects that are primitive types. This creates primitives and enumerated types when given a string value. The string value is parsed using a matched Transform implementation. The transform is then used to convert the object instance to an from a suitable XML representation. Only enumerated types are not transformed using a transform, instead they use Enum.name.
Inheritance: Factory
Example #1
0
 /// <summary>
 /// Constructor for the <c>Primitive</c> object. This is used
 /// to convert an XML node to a primitive object and vice versa. To
 /// perform deserialization the primitive object requires the context
 /// object used for the instance of serialization to performed.
 /// </summary>
 /// <param name="context">
 /// the context object used for the serialization
 /// </param>
 /// <param name="type">
 /// this is the type of primitive this represents
 /// </param>
 /// <param name="empty">
 /// this is the value used to represent a null value
 /// </param>
 public Primitive(Context context, Type type, String empty)
 {
     this.factory = new PrimitiveFactory(context, type);
     this.type    = type.getType();
     this.context = context;
     this.empty   = empty;
 }
Example #2
0
 /// <summary>
 /// Constructor for the <c>PrimitiveKey</c> object. This is
 /// used to create the key object which converts the map key to an
 /// instance of the key type. This can also resolve references.
 /// </summary>
 /// <param name="context">
 /// this is the context object used for serialization
 /// </param>
 /// <param name="entry">
 /// this is the entry object that describes entries
 /// </param>
 /// <param name="type">
 /// this is the type that this converter deals with
 /// </param>
 public PrimitiveKey(Context context, Entry entry, Type type) {
    this.factory = new PrimitiveFactory(context, type);
    this.root = new Primitive(context, type);
    this.style = context.Style;
    this.context = context;
    this.entry = entry;
    this.type = type;
 }
Example #3
0
 /// <summary>
 /// Constructor for the <c>PrimitiveKey</c> object. This is
 /// used to create the key object which converts the map key to an
 /// instance of the key type. This can also resolve references.
 /// </summary>
 /// <param name="context">
 /// this is the context object used for serialization
 /// </param>
 /// <param name="entry">
 /// this is the entry object that describes entries
 /// </param>
 /// <param name="type">
 /// this is the type that this converter deals with
 /// </param>
 public PrimitiveKey(Context context, Entry entry, Type type)
 {
     this.factory = new PrimitiveFactory(context, type);
     this.root    = new Primitive(context, type);
     this.style   = context.Style;
     this.context = context;
     this.entry   = entry;
     this.type    = type;
 }
Example #4
0
 /// <summary>
 /// Constructor for the <c>Primitive</c> object. This is used
 /// to convert an XML node to a primitive object and vice versa. To
 /// perform deserialization the primitive object requires the context
 /// object used for the instance of serialization to performed.
 /// </summary>
 /// <param name="context">
 /// the context object used for the serialization
 /// </param>
 /// <param name="type">
 /// this is the type of primitive this represents
 /// </param>
 /// <param name="empty">
 /// this is the value used to represent a null value
 /// </param>
 public Primitive(Context context, Type type, String empty) {
    this.factory = new PrimitiveFactory(context, type);
    this.type = type.getType();
    this.context = context;
    this.empty = empty;
 }