Skip to content
stemey edited this page Sep 25, 2012 · 5 revisions

Atem javadoc provides a Doclet to generate an xml filecontaining javadoc comments. This can be attached at runtime to the atem types and attributes.

Retrieving the javadoc

// get the type for the class whose javadoc we want to retrieve
EntityType<ExampleDomain> exampleType = entityTypeRepository.getEntityType(ExampleDomain.class);
//get the meta attribute
EntityType<EntityType> metaType = entityTypeRepository.getEntityType(EntityType.class);
SingleAttribute<ClassDescription> javadocAttribute= (...) metaType .getMetaAttribute(JavadocDataStore.META_ATTRIBUTE_CODE);	
// get the javadoc for the type ExampleDomain
ClassDescription classDescription = (ClassDescription) javadocAttribute.getValue(exampleType );

Configuring Maven plugin

		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-javadoc-plugin</artifactId>
			<version>2.8.1</version>
			<configuration>
				<doclet>org.atemsource.atem.doc.javadoc.tool.DocmlDoclet</doclet>
				<docletArtifact>
					<groupId>org.atemsource</groupId>
					<artifactId>atem-javadoc</artifactId>
					<version>0.1.3-SNAPSHOT</version>
				</docletArtifact>
				<show>private</show>
				 <reportOutputDirectory>${project.build.outputDirectory}</reportOutputDirectory>
				 <destDir>.</destDir>	
				<useStandardDocletOptions>true</useStandardDocletOptions>
			</configuration>
		</plugin>

Example for configuring pojo repository

By including '/atem/javadoc/javadoc.xml' the metaAttribute is already configured.

<import resource="classpath:/atem/javadoc/javadoc.xml" />
<import resource="classpath:/atem/pojo/entitytype.xml" />

<bean id="atem-javadoc-example-repository" parent="abstract-atem-scanned-pojo-repository">
	<property name="includedPackage" value="de.test" />
</bean>

<bean id="atem-repository" init-method="init"
	class="org.atemsource.atem.impl.common.EntityTypeRepositoryImpl">
	<property name="repositories">
		<list>
			<ref bean="atem-attribute-repository" />
			<ref bean="atem-entityType-repository" />
			<ref bean="atem-javadoc-repository" />
			<ref bean="atem-javadoc-example-repository" />
		</list>
	</property>
</bean>