Liquid XML Data Binder 2020
In This Topic
    MyRootObject.cls
    In This Topic
    VERSION 1.0 CLASS
    BEGIN
      MultiUse = -1  'True
      Persistable = 0  'NotPersistable
      DataBindingBehavior = 0  'vbNone
      DataSourceBehavior  = 0  'vbNone
      MTSTransactionMode  = 0  'NotAnMTSObject
    END
    Attribute VB_Name = "MyRootObject"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = True
    Attribute VB_PredeclaredId = False
    Attribute VB_Exposed = True
    Option Explicit
    '**********************************************************************************************
    '* Copyright (c) 2001-2020 Liquid Technologies Limited. All rights reserved.
    '* See www.liquid-technologies.com for product details.
    '*
    '* Please see products End User License Agreement for distribution permissions.
    '*
    '* WARNING: THIS FILE IS GENERATED
    '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
    '*
    '* Generation  :  by Liquid XML Data Binder 17.0.1.9233
    '* Using Schema: Cardinality.xsd
    '**********************************************************************************************
    Private m_ElementName As String
    Private mvarASimpleStringMandatoryElement As String 
    Private mvarASimpleDateMandatoryElement As LtXmlComLib18.DateTime 
    Private mvarAComplexMandatoryElement As CardinalityLib.AComplexMandatoryElement   
    Private mvarIsValidASimpleStringOptionalElement As Boolean 
    Private mvarASimpleStringOptionalElement As String 
    Private mvarIsValidASimpleDateOptionalElement As Boolean 
    Private mvarASimpleDateOptionalElement As LtXmlComLib18.DateTime 
    Private mvarAComplexOptionalElement As CardinalityLib.AComplexOptionalElement   
    Private WithEvents mvarASimpleStringCollectionElement As LtXmlComLib18.stringCol 
    Private WithEvents mvarASimpleDateCollectionElement As LtXmlComLib18.dateCol 
    Private WithEvents mvarAComplexCollectionElement As CardinalityLib.AComplexCoionElementCol 
    ' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    ' Add Additional Variable Declarations...
    
    ' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    Implements LtXmlComLib18.XmlObjectBase
    Implements LtXmlComLib18.XmlGeneratedClass
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    Public Property Get ElementName() As String
        ElementName = m_elementName
    End Property
    
    ' Summary:
    '       Represents a mandatory Element in the XML document
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       It is mandatory and therefore must be populated within the XML. 
    '       It is defaulted to . 
    Public Property Get ASimpleStringMandatoryElement As String 
        ASimpleStringMandatoryElement = mvarASimpleStringMandatoryElement
    End Property
    
    Public Property Let ASimpleStringMandatoryElement(ByVal value As String)
        ' Apply whitespace rules appropriately
        value = LtXmlComLib18.WhitespaceUtils.PreserveWhitespace(value)
        mvarASimpleStringMandatoryElement = value
        
    End Property
    ' Summary:
    '       Represents a mandatory Element in the XML document
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       It is mandatory and therefore must be populated within the XML. 
    '       It is defaulted to 1900-01-01. 
    Public Property Get ASimpleDateMandatoryElement As LtXmlComLib18.DateTime 
        Set ASimpleDateMandatoryElement = mvarASimpleDateMandatoryElement
    End Property
    
    Public Property Set ASimpleDateMandatoryElement(ByVal value As LtXmlComLib18.DateTime)
        mvarASimpleDateMandatoryElement.SetDateTimeWithType value, mvarASimpleDateMandatoryElement.dateType 
        
    End Property
    ' Summary:
    '       Represents a mandatory Element in the XML document
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       It is mandatory and therefore must be populated within the XML. 
    '       If this property is set, then the object will be COPIED. If the property is set to null an exception is raised. 
    Public Property Get AComplexMandatoryElement As CardinalityLib.AComplexMandatoryElement
            Set AComplexMandatoryElement = mvarAComplexMandatoryElement
    End Property
    Public Property Set AComplexMandatoryElement(Byval value As CardinalityLib.AComplexMandatoryElement)
        LtXmlComLib18.XmlObjectBaseHelper.Throw_IfPropertyIsNull value, "AComplexMandatoryElement"
        if not value is nothing then
            CastToXmlObjectBase(value).PrivateSetElementName "AComplexMandatoryElement"
        end if
    '    LtXmlComLib18.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "AComplexMandatoryElement"
        Set mvarAComplexMandatoryElement = value
    End Property
            
    ' Summary:
    '       Represents an optional Element in the XML document
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       It is optional, initially it is not valid. 
    Public Property Get ASimpleStringOptionalElement As String 
        if mvarIsValidASimpleStringOptionalElement = false then
            Err.Raise ERR_INVALID_STATE, "MyRootObject.ASimpleStringOptionalElement", "The Property ASimpleStringOptionalElement is not valid. Set ASimpleStringOptionalElementValid = true"
        end if
        ASimpleStringOptionalElement = mvarASimpleStringOptionalElement
    End Property
    
    Public Property Let ASimpleStringOptionalElement(ByVal value As String)
        ' Apply whitespace rules appropriately
        value = LtXmlComLib18.WhitespaceUtils.PreserveWhitespace(value)
        mvarIsValidASimpleStringOptionalElement = true
        mvarASimpleStringOptionalElement = value
    End Property
    
    ' Summary:
    '       Indicates if ASimpleStringOptionalElement contains a valid value.
    ' Remarks:
    '       true if the value for ASimpleStringOptionalElement is valid, false if not. 
    '       If this is set to true then the property is considered valid, and assigned its
    '       default value (). 
    '       If its set to false then its made invalid, and subsequent calls to get ASimpleStringOptionalElement
    '       will raise an exception. 
    Public Property Get IsValidASimpleStringOptionalElement As Boolean 
        IsValidASimpleStringOptionalElement = mvarIsValidASimpleStringOptionalElement
    End Property
                
    Public Property Let IsValidASimpleStringOptionalElement(ByVal value As Boolean)
        if value <> mvarIsValidASimpleStringOptionalElement then
            mvarASimpleStringOptionalElement = LtXmlComLib18.Conversions.stringFromString("", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Preserve)
            mvarIsValidASimpleStringOptionalElement = value
        End if
    End Property
    
    ' Summary:
    '       Represents an optional Element in the XML document
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       It is optional, initially it is not valid. 
    Public Property Get ASimpleDateOptionalElement As LtXmlComLib18.DateTime 
        if mvarIsValidASimpleDateOptionalElement = false then
            Err.Raise ERR_INVALID_STATE, "MyRootObject.ASimpleDateOptionalElement", "The Property ASimpleDateOptionalElement is not valid. Set ASimpleDateOptionalElementValid = true"
        end if
        Set ASimpleDateOptionalElement = mvarASimpleDateOptionalElement
    End Property
    
    Public Property Set  ASimpleDateOptionalElement(ByVal value As LtXmlComLib18.DateTime)
        mvarIsValidASimpleDateOptionalElement = true
        mvarASimpleDateOptionalElement.SetDateTimeWithType value, mvarASimpleDateOptionalElement.dateType 
    End Property
    
    ' Summary:
    '       Indicates if ASimpleDateOptionalElement contains a valid value.
    ' Remarks:
    '       true if the value for ASimpleDateOptionalElement is valid, false if not. 
    '       If this is set to true then the property is considered valid, and assigned its
    '       default value (1900-01-01). 
    '       If its set to false then its made invalid, and subsequent calls to get ASimpleDateOptionalElement
    '       will raise an exception. 
    Public Property Get IsValidASimpleDateOptionalElement As Boolean 
        IsValidASimpleDateOptionalElement = mvarIsValidASimpleDateOptionalElement
    End Property
                
    Public Property Let IsValidASimpleDateOptionalElement(ByVal value As Boolean)
        if value <> mvarIsValidASimpleDateOptionalElement then
            Set mvarASimpleDateOptionalElement = LtXmlComLib18.Conversions.dateFromString("1900-01-01", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Collapse)
            mvarIsValidASimpleDateOptionalElement = value
        End if
    End Property
    
    ' Summary:
    '       Represents an optional Element in the XML document
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       It is optional, initially it is null. 
    Public Property Get AComplexOptionalElement As CardinalityLib.AComplexOptionalElement 
        Set AComplexOptionalElement = mvarAComplexOptionalElement  
    End Property
    Public Property Set AComplexOptionalElement(ByVal value As CardinalityLib.AComplexOptionalElement)
        if value is Nothing then
            Set mvarAComplexOptionalElement = Nothing
        else
            CastToXmlObjectBase(value).PrivateSetElementName "AComplexOptionalElement"
    '       LtXmlComLib18.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "AComplexOptionalElement"
            Set mvarAComplexOptionalElement = value
        End If
    End Property
            
    ' Summary:
    '       A collection of Strings
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       This collection may contain 0 to Many Strings. 
    Public Property Get ASimpleStringCollectionElement As LtXmlComLib18.stringCol 
        Set ASimpleStringCollectionElement = mvarASimpleStringCollectionElement
    End Property
    ' Summary:
    '       A collection of DateTimes
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       This collection may contain 0 to Many DateTimes. 
    Public Property Get ASimpleDateCollectionElement As LtXmlComLib18.dateCol 
        Set ASimpleDateCollectionElement = mvarASimpleDateCollectionElement
    End Property
    ' Summary:
    '       A collection of AComplexCollectionElements
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       This collection may contain 0 to Many objects. 
    Public Property Get AComplexCollectionElement As CardinalityLib.AComplexCoionElementCol 
        Set AComplexCollectionElement = mvarAComplexCollectionElement
    End Property
            
        
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib18.XmlFormatting = LtXmlComLib18.XmlFormatting_Indented, Optional encoding As LtXmlComLib18.XmlEncoding = LtXmlComLib18.XmlEncoding_UTF8, Optional EOL As LtXmlComLib18.EOLType = LtXmlComLib18.EOLType.EOLType_CRLF, Optional context As LtXmlComLib18.XmlSerializationContext = Nothing)
        RegisterProduct
        LtXmlComLib18.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
    End Sub
    Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib18.XmlFormatting = LtXmlComLib18.XmlFormatting_Indented, Optional EOL As LtXmlComLib18.EOLType = LtXmlComLib18.EOLType.EOLType_LF, Optional context As LtXmlComLib18.XmlSerializationContext = Nothing) As String
        RegisterProduct
        ToXml = LtXmlComLib18.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
    End Function
    Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib18.XmlFormatting = LtXmlComLib18.XmlFormatting_Indented, Optional encoding As LtXmlComLib18.XmlEncoding = LtXmlComLib18.XmlEncoding_UTF8, Optional EOL As LtXmlComLib18.EOLType = LtXmlComLib18.EOLType.EOLType_LF, Optional context As LtXmlComLib18.XmlSerializationContext = Nothing) As Variant
        RegisterProduct
        ToXmlStream = LtXmlComLib18.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
    End Function
    Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib18.XmlSerializationContext = Nothing)
        RegisterProduct
        LtXmlComLib18.XmlObjectBaseHelper.FromXml Me, xmlIn, context
    End Sub
    Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib18.XmlSerializationContext = Nothing)
        RegisterProduct
        LtXmlComLib18.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
    End Sub
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''' Private Methods  ''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    ' Summary:
    '       Constructor for MyRootObject
    ' Remarks:
    '       The class is created with all the mandatory fields populated with the
    '       default data.  
    '       All Collection object are created. 
    '           However any 1-n relationships (these are represented as collections) are
    '       empty. To comply with the schema these must be populated before the xml
    '       obtained from ToXml is valid against the schema Cardinality.xsd 
    Private Sub Class_Initialize()
        m_elementName = "MyRootObject"
        XmlGeneratedClass_Init
    End Sub
    
    
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
        m_ElementName = vNewValue
    End Sub
    
    Private Property Get XmlObjectBase_ElementName() As String
        XmlObjectBase_ElementName = m_ElementName
    End Property
    
    Private Property Get XmlObjectBase_TargetNamespace() As String
        XmlObjectBase_TargetNamespace = ""
    End Property
    
    Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
        XmlObjectBase_IsSuitableSubstitution = false
        if InterfaceName = "MyRootObject" _
            then XmlObjectBase_IsSuitableSubstitution = true
    End Function
    
    Private Property Get XmlObjectBase_Namespace() As String
        XmlObjectBase_Namespace = ""
    End Property
    
    Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib18.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
        Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
    End Function
    Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib18.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib18.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
        XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
    End Sub
    Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib18.XmlTextWriter, ByVal context As LtXmlComLib18.XmlSerializationContext)
        XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
    End Sub
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    ' Summary:
    '       Initializes the class
    ' Remarks:
    '       The Creates all the mandatory fields (populated with the default data) 
    '       All Collection object are created.
    '       However any 1-n relationships (these are represented as collections) are
    '       empty. To comply with the schema these must be populated before the xml
    '       obtained from ToXml is valid against the schema Cardinality.xsd.
    Private Sub XmlGeneratedClass_Init()
        mvarASimpleStringMandatoryElement = LtXmlComLib18.Conversions.stringFromString("", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Preserve)
        Set mvarASimpleDateMandatoryElement = LtXmlComLib18.Conversions.dateFromString("1900-01-01", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Collapse)
        Set mvarAComplexMandatoryElement = CF.CreateNamedClass(ClsName_AComplexMandatoryElement, "AComplexMandatoryElement")
        mvarASimpleStringOptionalElement = LtXmlComLib18.Conversions.stringFromString("", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Preserve)
        mvarIsValidASimpleStringOptionalElement = false
        Set mvarASimpleDateOptionalElement = LtXmlComLib18.Conversions.dateFromString("1900-01-01", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Collapse)
        mvarIsValidASimpleDateOptionalElement = false
        Set mvarAComplexOptionalElement = Nothing
        Set mvarASimpleStringCollectionElement = LtXmlComLib18.ClassFactory.Create_stringCol("ASimpleStringCollectionElement", "", 0, -1, "", -1, -1, "", "", "", "", -1, LtXmlComLib18.WhitespaceRule.WhitespaceRule_Preserve, "")
        Set mvarASimpleDateCollectionElement = LtXmlComLib18.ClassFactory.Create_dateCol("ASimpleDateCollectionElement", "", 0, -1, "", -1, -1, "", "", "", "", -1, LtXmlComLib18.WhitespaceRule.WhitespaceRule_Collapse, "")
        Set mvarAComplexCollectionElement = CF.CreateClassCollection(ClsName_AComplexCoionElementCol, "AComplexCollectionElement", "", 0, -1)
        
    
    
    
        ' Force Init ClassInfo
        Dim classInfo As LtXmlComLib18.ClassInfo
        Set classInfo = XmlGeneratedClass_ClassInfo
    
    ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    ' Add Additional Init Settings...
    
    ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    End Sub 
    
    Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib18.ClassInfo
        If g_ClsDataMyRootObject Is Nothing Then
            Set g_ClsDataMyRootObject = New LtXmlComLib18.ClassInfo
            
            g_ClsDataMyRootObject.GroupType = LtXmlComLib18.XmlGroupType.Sequence
            g_ClsDataMyRootObject.ElementType = LtXmlComLib18.XmlElementType.Element
            g_ClsDataMyRootObject.ElementName = "MyRootObject"
            g_ClsDataMyRootObject.ElementNamespaceURI = ""
            g_ClsDataMyRootObject.FromXmlFailIfAttributeUnknown = true
            g_ClsDataMyRootObject.IsClassDerived = false
            g_ClsDataMyRootObject.PrimitiveDataType = LtXmlComLib18.XmlDataType.type_none
            g_ClsDataMyRootObject.PrimitiveFormatOverride = ""
            g_ClsDataMyRootObject.OutputPrimitiveClassAsTextProperty = False
            Set g_ClsDataMyRootObject.ClassFactory = General.CF
            
            g_ClsDataMyRootObject.AddElmSeqPrimMnd "ASimpleStringMandatoryElement", "", "ASimpleStringMandatoryElement", XmlDataType.type_string, "", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
            g_ClsDataMyRootObject.AddElmSeqPrimMnd "ASimpleDateMandatoryElement", "", "ASimpleDateMandatoryElement", XmlDataType.type_date, "", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1
            g_ClsDataMyRootObject.AddElmSeqClsMnd "AComplexMandatoryElement", "", "AComplexMandatoryElement", LtXmlComLib18.XmlElementType.Element, true
            g_ClsDataMyRootObject.AddElmSeqPrimOpt "ASimpleStringOptionalElement", "", "ASimpleStringOptionalElement", "IsValidASimpleStringOptionalElement", XmlDataType.type_string, "", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
            g_ClsDataMyRootObject.AddElmSeqPrimOpt "ASimpleDateOptionalElement", "", "ASimpleDateOptionalElement", "IsValidASimpleDateOptionalElement", XmlDataType.type_date, "", LtXmlComLib18.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1
            g_ClsDataMyRootObject.AddElmSeqClsOpt "AComplexOptionalElement", "", "AComplexOptionalElement", LtXmlComLib18.XmlElementType.Element, ClsName_AComplexOptionalElement
            g_ClsDataMyRootObject.AddElmSeqPrimCol "ASimpleStringCollectionElement", "", "ASimpleStringCollectionElement"
            g_ClsDataMyRootObject.AddElmSeqPrimCol "ASimpleDateCollectionElement", "", "ASimpleDateCollectionElement"
            g_ClsDataMyRootObject.AddElmSeqClsCol "AComplexCollectionElement", "", "AComplexCollectionElement", LtXmlComLib18.XmlElementType.Element
        End If
        Set XmlGeneratedClass_ClassInfo = g_ClsDataMyRootObject
    End Property
    
    ' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    ' Add Additional Methods/Properties Here...
    
    ' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS