Field property = getFieldOfSetter( thisJoinPointStaticPart.getSignature() );
property.setAccessible(true);
String propertyName = property.getName();
- logger.debug("execSetter: The property is ["+propertyName+"]");
+ //logger.debug("execSetter: The property is ["+propertyName+"]");
try {
// use property attribute directly, not through get method.
// get method might modify things, like setting a UUID when called for the first time.
// Also get methods for booleans start with "is" or "has"
Object oldValue = property.get(cb);
proceed( cb );
- //fireLoggingPropertyChange( cb, propertyName, oldValue, property.get(cb));
cb.firePropertyChange( propertyName, oldValue, property.get(cb));
} catch (NoSuchMethodException e) {
e.printStackTrace();
private Field getFieldOfSetter( Signature signature ){
Field field = null;
String propertyName = "";
- logger.debug( "Getting the field name of setter ["+signature.getName() + "]" );
+ //logger.debug( "Getting the field name of setter ["+signature.getName() + "]" );
try{
String methodName = signature.getName();
propertyName = Character.toLowerCase(methodName.charAt(3)) + methodName.substring(4);
Object oldval,
Object newval) {
- logger.debug( "Event: The property is [" + property + "]");
- logger.debug( "Event: The old value is [" + oldval + "]");
- logger.debug( "Event: The new value is [" + newval + "]");
+ //logger.debug( "PropertyChangeEvent: property [" + property + "], old value [" + oldval + "], new value [" + newval + "]");
// call firePropertyChange in original class. Method defined in CdmBase superclass!
cb.firePropertyChange( property,
( oldval == null ) ? oldval : oldval.toString(),
( newval == null ) ? newval : newval.toString());
}
-
- // *************** SET Version **********************/
-// pointcut setAttribut(CdmBase cb): target(cb) && set(* CdmBase+.*) && withincode(void CdmBase+.set*(..));
-// void around(CdmBase cb) : setAttribut(cb) {
-// logger.setLevel(Level.DEBUG);
-// Field property = getField( thisJoinPointStaticPart.getSignature() );
-// property.setAccessible(true);
-// String propertyName = property.getName();
-// logger.debug("The property is ["+propertyName+"]");
-// try {
-// // use property attribute directly, not through get method.
-// // get method might modify things, like setting a UUID when called for the first time.
-// // Also get methods for booleans start with "is" or "has"
-// Object oldValue = property.get(cb);
-// proceed( cb );
-// cb.firePropertyChange( propertyName, oldValue, property.get(cb));
-// } catch (Exception e) {
-// e.printStackTrace();
-// proceed( cb );
-// }
-// }
-//
-// /**
-// * @param signature
-// * Return the Field object that belongs to the signature of a setter method
-// * Removes first 3 characters of method name to find property name
-// */
-// private Field getField( Signature signature ){
-// Field field = null;
-// logger.debug( "Getting the field name of attribute ["+signature.getName() + "]" );
-// try{
-// String propertyName = signature.getName();
-// field = signature.getDeclaringType().getDeclaredField( propertyName );
-// }catch( NoSuchFieldException nsfe ){
-// nsfe.printStackTrace();
-// }
-// return field;
-// }
-
}