ट्रेडेड कॉन्फ़िगरेशन ऑब्जेक्ट

ट्रेड किया गया एक्सएमएल कॉन्फ़िगरेशन पार्स किया जाता है और इससे एक Configuration ऑब्जेक्ट बनाया जाता है जो पूरे कॉन्फ़िगरेशन के बारे में बताता है.

इस ऑब्जेक्ट के बारे में Iकॉन्फ़िगरेशन इंटरफ़ेस की मदद से बताया गया है.इसमें एक्सएमएल में तय किए गए सभी ऑब्जेक्ट के एक इंस्टेंस शामिल होंगे.

यह उदाहरण:

<configuration description="<description of the configuration>">
    <!-- A build provider that takes local device information -->
    <build_provider class="com.android.tradefed.build.BootstrapBuildProvider" />

    <!-- Some target preparation, disabled by default -->
    <target_preparer class="com.android.tradefed.targetprep.PreloadedClassesPreparer">
        <option name="disable" value="true" />
    </target_preparer>

    <!-- One test running some unit tests -->
    <test class="com.android.tradefed.testtype.HostTest">
        <option name="class" value="com.android.tradefed.build.BuildInfoTest" />
    </test>
</configuration>

इससे यह मिलेगा:

  • BootstrapBuildProvider इंस्टेंस दिखाने के लिए, IConfiguration#getBuildProvider().
  • PreloadedClassesPreparer वाले इंस्टेंस वाली ITargetPreparer की सूची दिखाने के लिए IConfiguration#getTargetPreparers().
  • HostTest के इंस्टेंस वाली IRemoteTest की सूची दिखाने के लिए, IConfiguration#getTests().

कॉन्फ़िगरेशन ऑब्जेक्ट में मौजूद हर ऑब्जेक्ट को एक्सएमएल डेफ़िनिशन में मैप किया जा सकता है. इससे, आम तौर पर एक्सएमएल की परिभाषा को समझने से यह समझने में मदद मिलती है कि कॉन्फ़िगरेशन ऑब्जेक्ट से क्या उम्मीद की जा सकती है.