UIEvolutin Inc.
UJML Language Reference
animal.ujml

The animal.ujml sample component provides data about a thing that is an animal.

This sample is a simple data component that provides basic information about a thing. See Samples, Components, Interfaces

This sample includes the ithings.ujmi interface file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ujml PUBLIC "-//UIEVOLUTION//DTD UJML 2.1//EN" "http://www.uievolution.com/dtd/ujml-2.1.dtd"[]>
<!--
    Copyright (c) 2000-2007 UIEvolution, Inc. U.S.A.
    http://www.uievolution.com
    All rights reserved.

    Provided under the Software License Agreement for Non-commercial Use of
    UIEvolution Platform Software - modification and incorporation into
    applications allowed, subject to the terms thereof.
-->

<!--
    animal.ujml

    Animal 'thing' component.
-->
<ujml>
    <interfaces>
        <include file="ithings.ujmi"/>
    </interfaces>

    <component name="Animal">
        <interfaces>
            <interface name="IThing" access="export"/>
            <interface name="IAnimal" access="export"/>
        </interfaces>

        <variables>
            <var name="mName" type="string"/>
            <var name="mDescription" type="string"/>
            <var name="mImageName" type="string"/>
            <var name="mStringVal" type="string"/>
            <var name="mBooleanVal" type="boolean"/>
        </variables>

        <functions>
            <!--
                Gets the name of the thing.
            -->
            <function name="IThing.getName" type="string">
                <return><eval>mName</eval></return>
            </function>

            <!--
                Gets a description of the thing.
            -->
            <function name="IThing.getDescription" type="string">
                <return><eval>mDescription</eval></return>
            </function>
            <!--
                Gets the image URL of the thing.
            -->
            <function name="IThing.getImageName" type="string">
                <return><eval>mImageName</eval></return>
            </function>

            <!--
               Initializes the thing.
            -->
            <function name="IAnimal.init" type="void">
                <parameters>
                    <var name="name" type="string"/>
                    <var name="description" type="string"/>
                    <var name="imgName" type="string"/>
                    <var name="sound" type="string"/>
                    <var name="isDomesticated" type="boolean"/>
                </parameters>
                <script>
                    mName = name;
                    mDescription = description;
                    mImageName = imgName;
                    mStringVal = sound;
                    mBooleanVal = isDomesticated;
                </script>
            </function>
            <!--
                Gets the sound the thing makes.
            -->
            <function name="IAnimal.getSound" type="string">
                <return><eval>mStringVal</eval></return>
            </function>
            <!--
                Gets a boolean value indicating if the thing is a
                vertibrate.
            -->
            <function name="IAnimal.getIsDomesticated" type="boolean">
                <return><eval>mBooleanVal</eval></return>
            </function>
        </functions>
    </component>
</ujml>
Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
What do you think about this topic? Send feedback!