mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 06:39:59 +00:00
No effective change - format
This commit is contained in:
1 parent
1085a8d608
commit
a1ff9034b6
1 file changed
+61
-61
@@ -13,66 +13,66 @@ import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanProperty;
|
||||
*/
|
||||
public abstract class AnnotationBase {
|
||||
|
||||
protected final DatabasePlatform databasePlatform;
|
||||
protected final NamingConvention namingConvention;
|
||||
protected final DeployUtil util;
|
||||
|
||||
protected AnnotationBase(DeployUtil util) {
|
||||
this.util = util;
|
||||
this.databasePlatform = util.getDbPlatform();
|
||||
this.namingConvention = util.getNamingConvention();
|
||||
}
|
||||
|
||||
/**
|
||||
* read the deployment annotations.
|
||||
*/
|
||||
public abstract void parse();
|
||||
|
||||
/**
|
||||
* Checks string is null or empty .
|
||||
*/
|
||||
protected boolean isEmpty(String s) {
|
||||
if (s == null || s.trim().length() == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the annotation for the property.
|
||||
* <p>
|
||||
* Looks first at the field and then at the getter method.
|
||||
* </p>
|
||||
*/
|
||||
protected <T extends Annotation> T get(DeployBeanProperty prop, Class<T> annClass) {
|
||||
T a = null;
|
||||
Field field = prop.getField();
|
||||
if (field != null){
|
||||
a = field.getAnnotation(annClass);
|
||||
}
|
||||
if (a == null) {
|
||||
Method m = prop.getReadMethod();
|
||||
if (m != null) {
|
||||
a = m.getAnnotation(annClass);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
protected final DatabasePlatform databasePlatform;
|
||||
protected final NamingConvention namingConvention;
|
||||
protected final DeployUtil util;
|
||||
|
||||
protected AnnotationBase(DeployUtil util) {
|
||||
this.util = util;
|
||||
this.databasePlatform = util.getDbPlatform();
|
||||
this.namingConvention = util.getNamingConvention();
|
||||
}
|
||||
|
||||
/**
|
||||
* read the deployment annotations.
|
||||
*/
|
||||
public abstract void parse();
|
||||
|
||||
/**
|
||||
* Checks string is null or empty .
|
||||
*/
|
||||
protected boolean isEmpty(String s) {
|
||||
if (s == null || s.trim().length() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the annotation for the property.
|
||||
* <p>
|
||||
* Looks first at the field and then at the getter method. then at class level.
|
||||
* </p>
|
||||
*/
|
||||
protected <T extends Annotation> T find(DeployBeanProperty prop, Class<T> annClass) {
|
||||
T a = get(prop, annClass);
|
||||
if (a == null) {
|
||||
a = prop.getOwningType().getAnnotation(annClass);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the annotation for the property.
|
||||
* <p>
|
||||
* Looks first at the field and then at the getter method.
|
||||
* </p>
|
||||
*/
|
||||
protected <T extends Annotation> T get(DeployBeanProperty prop, Class<T> annClass) {
|
||||
T a = null;
|
||||
Field field = prop.getField();
|
||||
if (field != null) {
|
||||
a = field.getAnnotation(annClass);
|
||||
}
|
||||
if (a == null) {
|
||||
Method m = prop.getReadMethod();
|
||||
if (m != null) {
|
||||
a = m.getAnnotation(annClass);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the annotation for the property.
|
||||
* <p>
|
||||
* Looks first at the field and then at the getter method. then at class level.
|
||||
* </p>
|
||||
*/
|
||||
protected <T extends Annotation> T find(DeployBeanProperty prop, Class<T> annClass) {
|
||||
T a = get(prop, annClass);
|
||||
if (a == null) {
|
||||
a = prop.getOwningType().getAnnotation(annClass);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user