KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > jpa > verification > JPARulesEngine


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.jpa.verification;
21
22 import java.util.Collection JavaDoc;
23 import java.util.LinkedList JavaDoc;
24 import java.util.List JavaDoc;
25 import javax.lang.model.element.TypeElement;
26 import org.netbeans.modules.j2ee.jpa.verification.common.Rule;
27 import org.netbeans.modules.j2ee.jpa.verification.common.RulesEngine;
28 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.ConsistentAccessType;
29 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.HasNoArgConstructor;
30 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.IdClassOverridesEqualsAndHashCode;
31 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.IdDefinedInHierarchy;
32 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.NoIdClassOnEntitySubclass;
33 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.NonFinalClass;
34 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.PersistenceUnitPresent;
35 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.PublicClass;
36 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.SerializableClass;
37 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.TopLevelClass;
38 import org.netbeans.modules.j2ee.jpa.verification.rules.entity.ValidPrimaryTableName;
39
40 /**
41  *
42  * @author Tomasz.Slota@Sun.COM
43  */

44 public class JPARulesEngine extends RulesEngine {
45     private static final List JavaDoc<Rule<TypeElement>> classRules = new LinkedList JavaDoc<Rule<TypeElement>>();
46     
47     static{
48         classRules.add(new PersistenceUnitPresent());
49         classRules.add(new IdDefinedInHierarchy());
50         classRules.add(new HasNoArgConstructor());
51         classRules.add(new ValidPrimaryTableName());
52         classRules.add(new SerializableClass());
53         classRules.add(new PublicClass());
54         classRules.add(new NonFinalClass());
55         classRules.add(new TopLevelClass());
56         classRules.add(new IdClassOverridesEqualsAndHashCode());
57         classRules.add(new NoIdClassOnEntitySubclass());
58         classRules.add(new ConsistentAccessType());
59     }
60     
61     protected Collection JavaDoc<Rule<TypeElement>> getClassRules() {
62         return classRules;
63     }
64
65 }
66
Popular Tags