Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Annotation

Description

Conversion Annotation

Marker annotation for type conversions at Type level.

CreateIfNull Annotation

For Collection and Map types: Create the types within the Collection or Map, if null.

Element Annotation

For Generic types: Specify the element type for Collection types and Map values.

Key Annotation

For Generic types: Specify the key type for Map keys.

KeyProperty Annotation

For Generic types: Specify the key property name value.

TypeConversion Annotation

Used for class and application wide conversion rules.

...

This is an example for the apt ant target:

Code Block
xml
xml
    <target name="apt">
        <mkdir dir="${build}/generated"/>

        <path id="classpath">
            <pathelement path="${basedir}/build/java"/>
            <pathelement path="${basedir}/build/test"/>
            <!-- xwork.jar and xwork-tiger.jar must be in one of the following lib dirs -->
            <fileset dir="${basedir}/lib/build" includes="*.jar"/>
            <fileset dir="${basedir}/lib/default" includes="*.jar"/>
            <fileset dir="${basedir}/lib/spring" includes="*.jar"/>
        </path>

        <property name="pclasspath" refid="classpath"/>

        <!-- Change the includes attribute value to match your annotated java files -->
        <fileset id="sources" dir="." includes="src/test/**/*.java" />

        <pathconvert pathsep=" " property="sourcefiles" refid="sources"/>

        <echo>

            CLASSPATH ${pclasspath}

            SOURCES: ${sourcefiles}

        </echo>

        <exec executable="apt" >
            <arg value="-s"/>
            <arg value="${build}/generated"/>
            <arg value="-classpath"/>
            <arg pathref="classpath"/>
            <arg value="-nocompile"/>
            <arg value="-factory"/>
            <arg value="com.opensymphony.xwork.apt.XWorkProcessorFactory"/>
            <arg line="${sourcefiles}"/>
        </exec>
    </target>