<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="../../../../misc/Meta.xsl" ?>
<!--
// $Id: //open/util/resgen/src/org/eigenbase/resgen/Resource.xml#4 $
// package org.eigenbase.resgen is an i18n resource generator
// Copyright (C) 2005-2005 The Eigenbase Project
// Copyright (C) 2005-2005 Disruptive Tech
// Copyright (C) 2005-2005 Red Square, Inc.
// Portions Copyright (C) 2000-2005 Kana Software, Inc. and others.
// All Rights Reserved.
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
//
// This file is the Meta Model description of a resource list.
  -->

<Model
name="resource"
dtdName="Resource.dtd"
className="ResourceDef"
packageName="org.eigenbase.resgen"
root="resourceBundle"
version="1.0"
>

<Doc>
  This model specifies the elements which make up a resource file. See
  {@link ResourceGenTask} for more information.
</Doc>

<Element type="resourceBundle">
    <Doc>
        A <code>ResourceBundle</code> is a collection of resources.
        The resource generator generates a class from a resource bundle
        which has an accessor method for each resource.
    </Doc>
    <Attribute name="locale" required="true">
        <Doc>
            The locale of resources in this resource bundle,
            for example, "en_US_Boston", "en_US", or "en".
        </Doc>
    </Attribute>
    <Attribute name="exceptionClassName" required="false">
        <Doc>
            Default class for exceptions.
        </Doc>
    </Attribute>
    <Attribute name="cppNamespace" required="false">
        <Doc>
            C++ Namespace for generated classes. Base
            classes are assumed to be in the same namespace.
        </Doc>
    </Attribute>
    <Attribute name="cppCommonInclude" required="false">
        <Doc>
            C++ common include file.  Included at the
            start of all generated C++ class implementations.
        </Doc>
    </Attribute>
    <Attribute name="cppExceptionClassName" required="false">
        <Doc>
            Default class for exceptions in generated C++.
        </Doc>
    </Attribute>
    <Attribute name="cppExceptionClassLocation" required="false">
        <Doc>
            The location of the C++ header file that contains
            the definition of the defautl C++ exception class.
            Required if the default C++ exception class is
            defined.  This location is also used as the default
            location for resource-specific exception classes.
        </Doc>
    </Attribute>
    <Array name="resources" type="resource"/>
    <Object name="code" type="Code">
        <Doc>
            Text within this element is included in the generated class.
        </Doc>
    </Object>
</Element>

<Element type="Code">
    <CData/>
</Element>

<Element type="resource" abstract="true" keepDef="true">
    <Attribute name="name" required="true">
        <Doc>
            The name of this message or error, unique within this resource
            bundle.
        </Doc>
    </Attribute>
    <Array name="properties" type="property"/>
    <Object name="text" type="text"/>
    <Code>
        abstract org.eigenbase.xom.DOMWrapper getDef();
    </Code>
</Element>

<Element type="message" class="resource" keepDef="true">
    <Doc>
        A message.
    </Doc>
    <Code>
        org.eigenbase.xom.DOMWrapper getDef() { return _def; }
    </Code>
</Element>

<Element type="text">
    <CData/>
</Element>

<Element type="exception" class="resource" keepDef="true">
    <Doc>
        An <code>exception</code> defines a message which is issued in response
        to some invalid condition. It has a type, which must be derived from
        {@link Throwable}. The generated <code>new<i>ExceptionName</i></code>
        method creates an instance of this exception with the appropriate
        parameters.
    </Doc>
    <Attribute name="className" required="false">
        <Doc>
            The name of the exception class. Must be fully qualified,
            unless it is in the package <code>java.lang</code>. If not
            specified, the resource bundle's default exception class is used.
        </Doc>
    </Attribute>
    <Attribute name="cppClassName" required="false">
        <Doc>
            The name of the C++ exception class.  If not specified,
            the resource bundle's default C++ exception class is
            used.
        </Doc>
    </Attribute>
    <Attribute name="cppClassLocation" required="false">
        <Doc>
            The name of the C++ exception class.  If not specified,
            the resource bundle's default C++ exception location is
            used.  One of the two must be specfied if the C++
            exception class is given.
        </Doc>
    </Attribute>
    <Attribute name="cppChainExceptions" required="false">
        <Doc>
            Set to true if the C++ exception classes support
            being chained together.  The default is false.
            If true, an extra method will be generated for
            that takes a const pointer to the C++ exception class.
        </Doc>
    </Attribute>
    <Code>
        org.eigenbase.xom.DOMWrapper getDef() { return _def; }
    </Code>
</Element>

<Element type="property">
    <Attribute name="name" required="true">
        <Doc>
            Name of the property.
        </Doc>
    </Attribute>
    <CData/>
</Element>

</Model>
