Interface ILcdXMLObjectFactory<T>

Type Parameters:
T - The Java class of which instances are created by this object factory.

public interface ILcdXMLObjectFactory<T>
Interface for object factories that can create objects for a specific XML Schema type or element.
It separates the creation of objects from the XML parsing and object initialization. This allows to plug in custom implementations/extensions of objects, as long as the API on which the unmarshallers rely to initialize the objects is respected (e.g. using ILcdDataObject).

This interface has two methods:

  • createObject: creates a new, empty Object that can be filled with XML data.
  • resolveObject: allows an object factory to perform an extra initialization step after an object has been created and filled with data. The object factory is allowed to convert the object into another object, based on its contents.
To create an object via a schema object factory, a user should:

   // First create the object.
   T object = createObject(aContext);

   // Now fill the object with data.
   [...]

   // Allow the schema object factory to perform an additional initialization step.
   object = resolveObject (object, aContext);
 
Since:
9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates and returns a new object for use in an XML context.
    Performs an additional initialization step for the specified object after it has been created.
  • Method Details

    • createObject

      T createObject(ILcdXMLDocumentContext aContext)
      Creates and returns a new object for use in an XML context.
      Parameters:
      aContext - the document context providing additional information about the document in which the object will be included.
      Returns:
      a new object.
    • resolveObject

      T resolveObject(T aObject, ILcdXMLDocumentContext aContext)
      Performs an additional initialization step for the specified object after it has been created. The returned object is either the same as the object that is passed to this method, or another object if a better representation is available for the object.
      Parameters:
      aObject - the object to be further initialized.
      aContext - the document context providing additional information about the document in which the object will be included.
      Returns:
      the object that was passed for initialization, or another object which replaces the specified object.