view src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng @ 0:0961a4a21176

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children 31822b475baa
line wrap: on
line source
<?xml version="1.0"?>
<grammar
 xmlns="http://relaxng.org/ns/structure/1.0"
 xmlns:r="http://relaxng.org/ns/structure/1.0"
 xmlns:a="http://relaxng.org/ns/annotation/1.0"
 xmlns:ref="urn:crossreference"
 xmlns:c="http://www.xml.gr.jp/xmlns/relaxngcc"
 c:runtime-type="com.sun.tools.internal.jxc.NGCCRuntimeEx"
 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
 c:package="com.sun.tools.internal.jxc.gen.config">


<start c:class="Config" c:access="public">

 <c:java-import>
    import java.util.List;
    import java.util.ArrayList;
    import java.io.File;
 </c:java-import>

<c:java-body>
   private File baseDir;
   private Classes classes;
   private List schema = new ArrayList();
   public Classes getClasses() { return this.classes;}
   public File getBaseDir() { return baseDir;}
   public List getSchema() { return this.schema;}
</c:java-body>

  <element name="config">
     <attribute name="baseDir">
        bd = <data type="string"/>
        baseDir = $runtime.getBaseDir(bd);
     </attribute>
     <ref name="Classes" c:alias="classes"/>
     <zeroOrMore>
        <ref name="Schema" c:alias="_schema" />(baseDir);
        this.schema.add (_schema);
     </zeroOrMore>
     </element>
  </start>


   <define name="Classes" c:access="public">
   <c:java-import>
    import java.util.List;
    import java.util.ArrayList;
    </c:java-import>
     <c:java-body>
       private List includes = new ArrayList();
       public List getIncludes() { return $runtime.getIncludePatterns(this.includes);}
       private List excludes = new ArrayList();
       public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);}
       </c:java-body>
     <element name="classes">

        <element name="includes">
            <list>
               <oneOrMore>
                <data type="string" c:alias="include_content"/>
                <c:java> this.includes.add(include_content); </c:java>
               </oneOrMore>
            </list>

         </element>
        <optional>
        <element name="excludes">
            <list>
               <zeroOrMore>
                <data type="string" c:alias="exclude_content"/>
                <c:java> this.excludes.add(exclude_content); </c:java>
               </zeroOrMore>
            </list>

         </element>
        </optional>
     </element>
    </define>


   <define name="Schema" c:access="public" c:params="File baseDir">
     <c:java-import>
       import java.io.File;
     </c:java-import>
     <c:java-body>
       private File location;
       private String namespace;
       public String getNamespace() { return this.namespace;}
       public File getLocation() { return this.location;}
     </c:java-body>
     <element name="schema">
       <optional>
         <attribute name="namespace">
           namespace = <data type="string" />
         </attribute>
       </optional>

       <optional>
         <attribute name="location">
           loc = <data type="string" />
           location = new File(baseDir,loc);
         </attribute>
       </optional>
     </element>
  </define>
</grammar>