Changeset 13078


Ignore:
Timestamp:
12/01/10 22:44:34 (11 years ago)
Author:
Mark Evenson
Message:

The classfile writer now handles the creation of interfaces.

JVM::MAKE-CLASS-INTERFACE-FILE will create a classfile structure
suitable for defining a Java interface. Simply add abstract methods
to complete the definition.

JVM::ADD-SUPERINTERFACE adds an interface definition to a classfile.
For a classfile denoting a Java object, these interfaces correspond
to the contents of a Java language "implements" clause. For a classfile
denoting a Java interface, these interfaces are all added to the
contract defined by this interfaces corresponding to the Java language
"extends" clause.

[Includes accidental update of NetBeans? project files.]

Location:
trunk/abcl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/nbproject/build-impl.xml

    r12749 r13078  
    5656    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    5757        <available file="${manifest.file}" property="manifest.available"/>
     58        <available file="${application.splash}" property="splashscreen.available"/>
    5859        <condition property="main.class.available">
    5960            <and>
     
    8485            </and>
    8586        </condition>
    86         <condition property="manifest.available+mkdist.available">
    87             <and>
    88                 <istrue value="${manifest.available}"/>
    89                 <isset property="do.mkdist"/>
    90             </and>
    91         </condition>
    92         <condition property="manifest.available-mkdist.available">
    93             <or>
    94                 <istrue value="${manifest.available}"/>
    95                 <isset property="do.mkdist"/>
    96             </or>
    97         </condition>
    98         <condition property="manifest.available+main.class-mkdist.available">
    99             <or>
     87        <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
     88            <and>
     89                <istrue value="${manifest.available+main.class+mkdist.available}"/>
     90                <istrue value="${splashscreen.available}"/>
     91            </and>
     92        </condition>
     93        <condition property="do.archive">
     94            <not>
     95                <istrue value="${jar.archive.disabled}"/>
     96            </not>
     97        </condition>
     98        <condition property="do.archive+manifest.available">
     99            <and>
     100                <isset property="manifest.available"/>
     101                <istrue value="${do.archive}"/>
     102            </and>
     103        </condition>
     104        <condition property="do.archive+manifest.available+main.class">
     105            <and>
    100106                <istrue value="${manifest.available+main.class}"/>
    101                 <isset property="do.mkdist"/>
    102             </or>
     107                <istrue value="${do.archive}"/>
     108            </and>
     109        </condition>
     110        <condition property="do.archive+manifest.available+main.class+mkdist.available">
     111            <and>
     112                <istrue value="${manifest.available+main.class+mkdist.available}"/>
     113                <istrue value="${do.archive}"/>
     114            </and>
     115        </condition>
     116        <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
     117            <and>
     118                <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
     119                <istrue value="${do.archive}"/>
     120            </and>
    103121        </condition>
    104122        <condition property="have.tests">
     
    157175        </condition>
    158176        <property name="javac.fork" value="false"/>
     177        <property name="jar.index" value="false"/>
     178        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
    159179    </target>
    160180    <target name="-post-init">
     
    183203        </macrodef>
    184204    </target>
    185     <target name="-init-macrodef-javac">
     205    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
    186206        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
    187207            <attribute default="${src.dir}" name="srcdir"/>
    188208            <attribute default="${build.classes.dir}" name="destdir"/>
    189209            <attribute default="${javac.classpath}" name="classpath"/>
     210            <attribute default="${javac.processorpath}" name="processorpath"/>
     211            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
     212            <attribute default="${includes}" name="includes"/>
     213            <attribute default="${excludes}" name="excludes"/>
     214            <attribute default="${javac.debug}" name="debug"/>
     215            <attribute default="${empty.dir}" name="sourcepath"/>
     216            <attribute default="${empty.dir}" name="gensrcdir"/>
     217            <element name="customize" optional="true"/>
     218            <sequential>
     219                <property location="${build.dir}/empty" name="empty.dir"/>
     220                <mkdir dir="${empty.dir}"/>
     221                <mkdir dir="@{apgeneratedsrcdir}"/>
     222                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
     223                    <src>
     224                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
     225                            <include name="*"/>
     226                        </dirset>
     227                    </src>
     228                    <classpath>
     229                        <path path="@{classpath}"/>
     230                    </classpath>
     231                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
     232                    <compilerarg line="${javac.compilerargs}"/>
     233                    <compilerarg value="-processorpath"/>
     234                    <compilerarg path="@{processorpath}:${empty.dir}"/>
     235                    <compilerarg line="${ap.processors.internal}"/>
     236                    <compilerarg line="${annotation.processing.processor.options}"/>
     237                    <compilerarg value="-s"/>
     238                    <compilerarg path="@{apgeneratedsrcdir}"/>
     239                    <compilerarg line="${ap.proc.none.internal}"/>
     240                    <customize/>
     241                </javac>
     242            </sequential>
     243        </macrodef>
     244    </target>
     245    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
     246        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
     247            <attribute default="${src.dir}" name="srcdir"/>
     248            <attribute default="${build.classes.dir}" name="destdir"/>
     249            <attribute default="${javac.classpath}" name="classpath"/>
     250            <attribute default="${javac.processorpath}" name="processorpath"/>
     251            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
    190252            <attribute default="${includes}" name="includes"/>
    191253            <attribute default="${excludes}" name="excludes"/>
     
    212274            </sequential>
    213275        </macrodef>
     276    </target>
     277    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
    214278        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
    215279            <attribute default="${src.dir}" name="srcdir"/>
     
    228292            <sequential>
    229293                <fail unless="javac.includes">Must set javac.includes</fail>
    230                 <pathconvert pathsep="," property="javac.includes.binary">
     294                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
    231295                    <path>
    232296                        <filelist dir="@{destdir}" files="${javac.includes}"/>
     
    234298                    <globmapper from="*.java" to="*.class"/>
    235299                </pathconvert>
     300                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
     301                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
    236302                <delete>
    237                     <files includes="${javac.includes.binary}"/>
     303                    <files includesfile="${javac.includesfile.binary}"/>
    238304                </delete>
     305                <delete file="${javac.includesfile.binary}"/>
    239306            </sequential>
    240307        </macrodef>
     
    359426        </macrodef>
    360427    </target>
     428    <target name="-init-macrodef-copylibs">
     429        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
     430            <element name="customize" optional="true"/>
     431            <sequential>
     432                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
     433                <pathconvert property="run.classpath.without.build.classes.dir">
     434                    <path path="${run.classpath}"/>
     435                    <map from="${build.classes.dir.resolved}" to=""/>
     436                </pathconvert>
     437                <pathconvert pathsep=" " property="jar.classpath">
     438                    <path path="${run.classpath.without.build.classes.dir}"/>
     439                    <chainedmapper>
     440                        <flattenmapper/>
     441                        <globmapper from="*" to="lib/*"/>
     442                    </chainedmapper>
     443                </pathconvert>
     444                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
     445                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
     446                    <fileset dir="${build.classes.dir}"/>
     447                    <manifest>
     448                        <attribute name="Class-Path" value="${jar.classpath}"/>
     449                        <customize/>
     450                    </manifest>
     451                </copylibs>
     452            </sequential>
     453        </macrodef>
     454    </target>
    361455    <target name="-init-presetdef-jar">
    362456        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
    363             <jar compress="${jar.compress}" jarfile="${dist.jar}">
     457            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
    364458                <j2seproject1:fileset dir="${build.classes.dir}"/>
    365459            </jar>
    366460        </presetdef>
    367461    </target>
    368     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
     462    <target name="-init-ap-cmdline-properties">
     463        <property name="annotation.processing.enabled" value="true"/>
     464        <property name="annotation.processing.processors.list" value=""/>
     465        <property name="annotation.processing.processor.options" value=""/>
     466        <property name="annotation.processing.run.all.processors" value="true"/>
     467        <property name="javac.processorpath" value="${javac.classpath}"/>
     468        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
     469        <condition property="ap.supported.internal" value="true">
     470            <not>
     471                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
     472            </not>
     473        </condition>
     474    </target>
     475    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
     476        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
     477            <isfalse value="${annotation.processing.run.all.processors}"/>
     478        </condition>
     479        <condition else="" property="ap.proc.none.internal" value="-proc:none">
     480            <isfalse value="${annotation.processing.enabled}"/>
     481        </condition>
     482    </target>
     483    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
     484        <property name="ap.cmd.line.internal" value=""/>
     485    </target>
     486    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
    369487    <!--
    370488                ===================
     
    410528        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
    411529    </target>
    412     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
     530    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
    413531        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
    414532        <copy todir="${build.classes.dir}">
     
    416534        </copy>
    417535    </target>
     536    <target if="has.persistence.xml" name="-copy-persistence-xml">
     537        <mkdir dir="${build.classes.dir}/META-INF"/>
     538        <copy todir="${build.classes.dir}/META-INF">
     539            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
     540        </copy>
     541    </target>
    418542    <target name="-post-compile">
    419543        <!-- Empty placeholder for easier customization. -->
     
    448572        <!-- You can override this target in the ../build.xml file. -->
    449573    </target>
    450     <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
     574    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
    451575        <j2seproject1:jar/>
    452576    </target>
    453     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
     577    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
    454578        <j2seproject1:jar manifest="${manifest.file}"/>
    455579    </target>
    456     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
     580    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
    457581        <j2seproject1:jar manifest="${manifest.file}">
    458582            <j2seproject1:manifest>
     
    469593        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
    470594    </target>
    471     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
    472         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
    473         <pathconvert property="run.classpath.without.build.classes.dir">
    474             <path path="${run.classpath}"/>
    475             <map from="${build.classes.dir.resolved}" to=""/>
    476         </pathconvert>
    477         <pathconvert pathsep=" " property="jar.classpath">
    478             <path path="${run.classpath.without.build.classes.dir}"/>
    479             <chainedmapper>
    480                 <flattenmapper/>
    481                 <globmapper from="*" to="lib/*"/>
    482             </chainedmapper>
    483         </pathconvert>
    484         <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
    485         <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
    486             <fileset dir="${build.classes.dir}"/>
    487             <manifest>
     595    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
     596        <basename file="${application.splash}" property="splashscreen.basename"/>
     597        <mkdir dir="${build.classes.dir}/META-INF"/>
     598        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
     599        <j2seproject3:copylibs>
     600            <customize>
    488601                <attribute name="Main-Class" value="${main.class}"/>
    489                 <attribute name="Class-Path" value="${jar.classpath}"/>
    490             </manifest>
    491         </copylibs>
     602                <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
     603            </customize>
     604        </j2seproject3:copylibs>
    492605        <echo>To run this application from the command line without Ant, try:</echo>
    493606        <property location="${dist.jar}" name="dist.jar.resolved"/>
    494607        <echo>java -jar "${dist.jar.resolved}"</echo>
    495608    </target>
    496     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+mkdist.available" name="-do-jar-with-libraries-without-mainclass" unless="main.class.available">
    497         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
    498         <pathconvert property="run.classpath.without.build.classes.dir">
    499             <path path="${run.classpath}"/>
    500             <map from="${build.classes.dir.resolved}" to=""/>
    501         </pathconvert>
    502         <pathconvert pathsep=" " property="jar.classpath">
    503             <path path="${run.classpath.without.build.classes.dir}"/>
    504             <chainedmapper>
    505                 <flattenmapper/>
    506                 <globmapper from="*" to="lib/*"/>
    507             </chainedmapper>
    508         </pathconvert>
    509         <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
    510         <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
    511             <fileset dir="${build.classes.dir}"/>
    512             <manifest>
    513                 <attribute name="Class-Path" value="${jar.classpath}"/>
    514             </manifest>
    515         </copylibs>
    516     </target>
    517     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.mkdist" name="-do-jar-with-libraries-without-manifest" unless="manifest.available">
    518         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
    519         <pathconvert property="run.classpath.without.build.classes.dir">
    520             <path path="${run.classpath}"/>
    521             <map from="${build.classes.dir.resolved}" to=""/>
    522         </pathconvert>
    523         <pathconvert pathsep=" " property="jar.classpath">
    524             <path path="${run.classpath.without.build.classes.dir}"/>
    525             <chainedmapper>
    526                 <flattenmapper/>
    527                 <globmapper from="*" to="lib/*"/>
    528             </chainedmapper>
    529         </pathconvert>
    530         <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
    531         <copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
    532             <fileset dir="${build.classes.dir}"/>
    533             <manifest>
    534                 <attribute name="Class-Path" value="${jar.classpath}"/>
    535             </manifest>
    536         </copylibs>
     609    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
     610        <j2seproject3:copylibs>
     611            <customize>
     612                <attribute name="Main-Class" value="${main.class}"/>
     613            </customize>
     614        </j2seproject3:copylibs>
     615        <echo>To run this application from the command line without Ant, try:</echo>
     616        <property location="${dist.jar}" name="dist.jar.resolved"/>
     617        <echo>java -jar "${dist.jar.resolved}"</echo>
    537618    </target>
    538619    <target name="-post-jar">
     
    540621        <!-- You can override this target in the ../build.xml file. -->
    541622    </target>
    542     <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-mainclass,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/>
     623    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
    543624    <!--
    544625                =================
     
    610691                ===============
    611692            -->
    612     <target depends="init" name="-javadoc-build">
     693    <target depends="init" if="have.sources" name="-javadoc-build">
    613694        <mkdir dir="${dist.javadoc.dir}"/>
    614695        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
     
    623704            </fileset>
    624705        </javadoc>
     706        <copy todir="${dist.javadoc.dir}">
     707            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
     708                <filename name="**/doc-files/**"/>
     709            </fileset>
     710            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
     711                <include name="**/doc-files/**"/>
     712            </fileset>
     713        </copy>
    625714    </target>
    626715    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
     
    644733    </target>
    645734    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
    646         <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
     735        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
    647736        <copy todir="${build.test.classes.dir}">
    648737            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
     
    661750        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
    662751        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
    663         <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
     752        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
    664753        <copy todir="${build.test.classes.dir}">
    665754            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  • trunk/abcl/nbproject/genfiles.properties

    r12749 r13078  
    55# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    66nbproject/build-impl.xml.data.CRC32=742204ce
    7 nbproject/build-impl.xml.script.CRC32=29122cc4
    8 nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45
     7nbproject/build-impl.xml.script.CRC32=330b50b7
     8nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
    99nbproject/profiler-build-impl.xml.data.CRC32=71623fcd
    1010nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
  • trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp

    r13071 r13078  
    512512  class
    513513  superclass
    514   ;; support for implementing interfaces not yet available
    515   ;; interfaces
     514  interfaces
    516515  fields
    517516  methods
    518517  attributes)
     518
     519(defun make-class-interface-file (class)
     520  "Create the components of a class file representing a public Java
     521interface."
     522  (make-class-file class +java-object+ '(:public :abstract :interface)))
    519523
    520524(defun class-add-field (class field)
     
    552556  (push attribute (class-file-attributes class)))
    553557
     558(defun class-add-superinterface (class interface)
     559  "Adds the java-class-name contained in `interface' as a superinterface of the `class'.
     560
     561For a class that represents an object, the requirements in `interface'
     562must then be implemented in the class.  For a class that represents an
     563interface, the `interface' imposes additional requirements to the
     564classes which implement this class."
     565  (push interface (class-file-interfaces class)))
     566
    554567(defun class-attribute (class name)
    555568  "Returns the attribute which is named `name'."
     
    557570        :test #'string= :key #'attribute-name))
    558571
     572(defun finalize-interfaces (class)
     573  "Finalize the interfaces for `class'.
     574
     575Interface finalization first ensures that all the classes referenced
     576by the interfaces members exist in the pool.  Then, it destructively
     577modfies the interfaces members with a list of the references to the
     578corresponding pool indices."
     579  (let ((interface-refs nil))
     580    (dolist (interface (class-file-interfaces class))
     581      (push
     582       (pool-add-class (class-file-constants class)
     583                       interface)
     584       interface-refs))
     585    (setf (class-file-interfaces class) interface-refs)))
    559586
    560587(defun finalize-class-file (class)
     
    575602        (pool-add-class (class-file-constants class)
    576603                        (class-file-class class)))
    577   ;;  (finalize-interfaces)
     604  (finalize-interfaces class)
    578605  (dolist (field (class-file-fields class))
    579606    (finalize-field field class))
     
    685712
    686713  ;; interfaces
    687   (write-u2 0 stream)
     714  (if (class-file-interfaces class)
     715      (progn
     716        (write-u2 (length (class-file-interfaces class)) stream)
     717        (dolist (interface-ref (class-file-interfaces class))
     718          (write-u2 interface-ref stream)))
     719      (write-u2 0 stream))
    688720
    689721  ;; fields
Note: See TracChangeset for help on using the changeset viewer.