Skip to content

Instantly share code, notes, and snippets.

@gsmet
Created Aug 21, 2014
Embed
What would you like to do?
PMD Rules
Rule 1:
//FieldDeclaration[(ancestor::TypeDeclaration/Annotation[MarkerAnnotation/Name[@Image='MappedSuperclass' or @Image='Entity' or @Image='Embeddable']] or ancestor::ClassOrInterfaceDeclaration/ExtendsList/ClassOrInterfaceType[typeof(@Image, 'fr.openwide.core.jpa.business.generic.model.GenericEntity', 'GenericEntity')]) and descendant::ClassOrInterfaceType[typeof(@Image, 'java.lang.Enum', 'Enum')] and (not(preceding-sibling::Annotation[descendant::Name[@Image='Enumerated']]) and (not(preceding-sibling::Annotation[descendant::Name[@Image='Transient']]) or (preceding-sibling::Annotation[descendant::Name[@Image='Enumerated'] and not(descendant::Name[@Image='EnumType.STRING'])]))]
Rule 2:
//MethodDeclaration[(ancestor::TypeDeclaration/Annotation[MarkerAnnotation/Name[@Image='MappedSuperclass' or @Image='Entity' or @Image='Embeddable']] or ancestor::ClassOrInterfaceDeclaration/ExtendsList[ClassOrInterfaceType[@Image='GenericEntity' or typeof(@Image, 'fr.openwide.core.jpa.business.generic.model.GenericEntity', 'GenericEntity')]]) and @Final='true' and @Static='false']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment