Search in sources :

Example 6 with Transient

use of java.beans.Transient in project MantaroBot by Mantaro.

the class PlayerData method marryDate.

@Transient
public String marryDate() {
    if (getMarriedSince() == null)
        return null;
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault());
    final Date date = new Date(getMarriedSince());
    return sdf.format(date);
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Transient(java.beans.Transient)

Example 7 with Transient

use of java.beans.Transient in project coprhd-controller by CoprHD.

the class DataObjectType method isColumnField.

public static boolean isColumnField(String className, PropertyDescriptor pd) {
    if (pd.getName().equals("class")) {
        return false;
    }
    Method readMethod = pd.getReadMethod();
    Method writeMethod = pd.getWriteMethod();
    if (readMethod == null || writeMethod == null) {
        _log.info("{}.{} no getter or setter method, skip", className, pd.getName());
        return false;
    }
    // Skip Transient Properties
    if (readMethod.isAnnotationPresent(Transient.class) || writeMethod.isAnnotationPresent(Transient.class)) {
        _log.info("{}.{} has Transient annotation, skip", className, pd.getName());
        return false;
    }
    return true;
}
Also used : CtMethod(javassist.CtMethod) CtNewMethod(javassist.CtNewMethod) Method(java.lang.reflect.Method) Transient(java.beans.Transient)

Aggregations

Transient (java.beans.Transient)7 SimpleDateFormat (java.text.SimpleDateFormat)4 Date (java.util.Date)2 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)1 CustomException (com.hfut.exception.CustomException)1 ReadablePhone (gov.ca.cwds.data.ReadablePhone)1 ApiPhoneAware (gov.ca.cwds.data.std.ApiPhoneAware)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1 CtMethod (javassist.CtMethod)1 CtNewMethod (javassist.CtNewMethod)1 Subject (org.apache.shiro.subject.Subject)1