Skip to content

grozandrei/exposable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

exposable

Exposable is a an annotation processor designed to generate at compile time the metadata - field names - for classes annotated with @Exposable. It's something similar to Hibernate metamodel generator, but much lighter.

using exposable

If you use maven, please add the dependency in your project pom.xml.

<dependency>
	<groupId>com.github.grozandrei</groupId>
	<artifactId>exposable-annotation</artifactId>
	<version>1.0</version>
</dependency>

Then, you just annotate the classes you want to have the metamodel generated at compile time with @Exposable annotation.

For maven, the following plugins must be used:

<build>
		<plugins>
		...
			<plugin>
				<groupId>org.bsc.maven</groupId>
				<artifactId>maven-processor-plugin</artifactId>
				<version>2.2.4</version>
				<executions>
					<execution>
						<id>process</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>process</goal>
						</goals>
						<configuration>
							<outputDirectory>target/generated-sources/exposable</outputDirectory>
							<processors>
								<processor>com.github.grozandrei.exposable.processor.ExposableProcessor</processor>
							</processors>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>com.github.grozandrei</groupId>
						<artifactId>exposable-processor</artifactId>
						<version>1.0</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.10</version>
				<executions>
					<execution>
						<phase>process-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>target/generated-sources/exposable</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

Then run the usual mvn install build command on your project and the processor will generate metadata information for exposable classes.