Exception throwableException = exception.getException(); if (throwableException instanceof IllegalAccessException) { throw DescriptorException.illegalAccessWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), throwableException); } else { throw DescriptorException.targetInvocationWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), throwableException); throw DescriptorException.illegalArgumentWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (IllegalAccessException exception) { throw DescriptorException.illegalAccessWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (InvocationTargetException exception) { throw DescriptorException.targetInvocationWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (NullPointerException exception) { throw DescriptorException.nullPointerWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception);
Exception throwableException = exception.getException(); if (throwableException instanceof IllegalAccessException) { throw DescriptorException.illegalAccessWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), throwableException); } else { throw DescriptorException.targetInvocationWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), throwableException); throw DescriptorException.illegalArgumentWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (IllegalAccessException exception) { throw DescriptorException.illegalAccessWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (InvocationTargetException exception) { throw DescriptorException.targetInvocationWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (NullPointerException exception) { throw DescriptorException.nullPointerWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception);
Exception throwableException = exception.getException(); if (throwableException instanceof IllegalAccessException) { throw DescriptorException.illegalAccessWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), throwableException); } else { throw DescriptorException.targetInvocationWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), throwableException); throw DescriptorException.illegalArgumentWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (IllegalAccessException exception) { throw DescriptorException.illegalAccessWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (InvocationTargetException exception) { throw DescriptorException.targetInvocationWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception); } catch (NullPointerException exception) { throw DescriptorException.nullPointerWhileGettingValueThruMethodAccessor(getGetMethodName(), anObject.getClass().getName(), exception);
/** * PUBLIC: * This method is invoked reflectively on the reference object to return the value of the * attribute in the object. This method returns the name of the getMethodName or null if not using method access. */ public String getGetMethodName() { if (!getAttributeAccessor().isMethodAttributeAccessor()) { return null; } return ((MethodAttributeAccessor)getAttributeAccessor()).getGetMethodName(); }
/** * PUBLIC: * This method is invoked reflectively on the reference object to return the value of the * attribute in the object. This method returns the name of the getMethodName or null if not using method access. */ public String getGetMethodName() { if (!getAttributeAccessor().isMethodAttributeAccessor()) { return null; } return ((MethodAttributeAccessor)getAttributeAccessor()).getGetMethodName(); }
/** * PUBLIC: * This method is invoked reflectively on the reference object to return the value of the * attribute in the object. This method returns the name of the getMethodName or null if not using method access. */ public String getGetMethodName() { if (!getAttributeAccessor().isMethodAttributeAccessor()) { return null; } return ((MethodAttributeAccessor)getAttributeAccessor()).getGetMethodName(); }
/** * INTERNAL: * Return the GetMethod return type for this MethodAttributeAccessor. * A special check is made to determine if a missing method is a result of failed weaving. * @return */ // Note: SDO overrides this method and will handle a null GetMethod public Class getGetMethodReturnType() throws DescriptorException { // 323403: If the getMethod is missing - check for "_persistence_*_vh" to see if weaving was expected if(null == getGetMethod() && null != getGetMethodName() && (getGetMethodName().indexOf(Helper.PERSISTENCE_FIELDNAME_PREFIX) > -1)) { // warn before a possible NPE on accessing a weaved method that does not exist AbstractSessionLog.getLog().log(SessionLog.FINEST, "no_weaved_vh_method_found_verify_weaving_and_module_order", getGetMethodName(), null, this); // 323403: We cannot continue to process objects that are not weaved - if weaving is enabled // If we allow the getMethodReturnType to continue - we will throw an obscure NullPointerException throw DescriptorException.nullPointerWhileGettingValueThruMethodAccessorCausedByWeavingNotOccurringBecauseOfModuleOrder(getGetMethodName(), "", null); } if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try { return AccessController.doPrivileged(new PrivilegedGetMethodReturnType(getGetMethod())); } catch (PrivilegedActionException exception) { // we should not get here since this call does not throw any checked exceptions return null; } } else { return PrivilegedAccessHelper.getMethodReturnType(getGetMethod()); } }
/** * INTERNAL: * Return the GetMethod return type for this MethodAttributeAccessor. * A special check is made to determine if a missing method is a result of failed weaving. * @return */ // Note: SDO overrides this method and will handle a null GetMethod public Class getGetMethodReturnType() throws DescriptorException { // 323403: If the getMethod is missing - check for "_persistence_*_vh" to see if weaving was expected if(null == getGetMethod() && null != getGetMethodName() && (getGetMethodName().indexOf(Helper.PERSISTENCE_FIELDNAME_PREFIX) > -1)) { // warn before a possible NPE on accessing a weaved method that does not exist AbstractSessionLog.getLog().log(SessionLog.FINEST, "no_weaved_vh_method_found_verify_weaving_and_module_order", getGetMethodName(), null, this); // 323403: We cannot continue to process objects that are not weaved - if weaving is enabled // If we allow the getMethodReturnType to continue - we will throw an obscure NullPointerException throw DescriptorException.nullPointerWhileGettingValueThruMethodAccessorCausedByWeavingNotOccurringBecauseOfModuleOrder(getGetMethodName(), "", null); } if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try { return AccessController.doPrivileged(new PrivilegedGetMethodReturnType(getGetMethod())); } catch (PrivilegedActionException exception) { // we should not get here since this call does not throw any checked exceptions return null; } } else { return PrivilegedAccessHelper.getMethodReturnType(getGetMethod()); } }
/** * Gets the name of the method to be used when accessing the value of the * back pointer on the target object of this mapping. */ public String getBidirectionalTargetGetMethodName() { if (getBidirectionalTargetAccessor() == null || !getBidirectionalTargetAccessor().isMethodAttributeAccessor()) { return null; } return ((MethodAttributeAccessor)getBidirectionalTargetAccessor()).getGetMethodName(); }
/** * Gets the name of the method to be used when accessing the value of the * back pointer on the target object of this mapping. */ public String getBidirectionalTargetGetMethodName() { if (getBidirectionalTargetAccessor() == null || !getBidirectionalTargetAccessor().isMethodAttributeAccessor()) { return null; } return ((MethodAttributeAccessor)getBidirectionalTargetAccessor()).getGetMethodName(); }
/** * Gets the name of the method to be used when accessing the value of the * back pointer on the target object of this mapping. */ public String getBidirectionalTargetGetMethodName() { if (getBidirectionalTargetAccessor() == null || !getBidirectionalTargetAccessor().isMethodAttributeAccessor()) { return null; } return ((MethodAttributeAccessor)getBidirectionalTargetAccessor()).getGetMethodName(); }
/** * Set get and set method after creating these methods by using * get and set method names */ protected void initializeAttributes(Class theJavaClass, Class[] getParameterTypes) throws DescriptorException { if (getAttributeName() == null) { throw DescriptorException.attributeNameNotSpecified(); } try { setGetMethod(Helper.getDeclaredMethod(theJavaClass, getGetMethodName(), getParameterTypes)); // The parameter type for the set method must always be the return type of the get method. if(!isWriteOnly()) { setSetMethod(Helper.getDeclaredMethod(theJavaClass, getSetMethodName(), getSetMethodParameterTypes())); } } catch (NoSuchMethodException ex) { DescriptorException descriptorException = DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(ex); throw descriptorException; } catch (SecurityException exception) { DescriptorException descriptorException = DescriptorException.securityWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(exception); throw descriptorException; } }
/** * Set get and set method after creating these methods by using * get and set method names */ protected void initializeAttributes(Class theJavaClass, Class[] getParameterTypes) throws DescriptorException { if (getAttributeName() == null) { throw DescriptorException.attributeNameNotSpecified(); } try { setGetMethod(Helper.getDeclaredMethod(theJavaClass, getGetMethodName(), getParameterTypes)); // The parameter type for the set method must always be the return type of the get method. if(!isWriteOnly()) { setSetMethod(Helper.getDeclaredMethod(theJavaClass, getSetMethodName(), getSetMethodParameterTypes())); } } catch (NoSuchMethodException ex) { DescriptorException descriptorException = DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(ex); throw descriptorException; } catch (SecurityException exception) { DescriptorException descriptorException = DescriptorException.securityWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(exception); throw descriptorException; } }
/** * Set get and set method after creating these methods by using * get and set method names */ public void initializeAttributes(Class theJavaClass) throws DescriptorException { if (getAttributeName() == null) { throw DescriptorException.attributeNameNotSpecified(); } try { setGetMethod(Helper.getDeclaredMethod(theJavaClass, getGetMethodName(), (Class[])null)); // The parameter type for the set method must always be the return type of the get method. if(!isWriteOnly()) { Class[] parameterTypes = new Class[1]; parameterTypes[0] = getGetMethodReturnType(); setSetMethod(Helper.getDeclaredMethod(theJavaClass, getSetMethodName(), parameterTypes)); } } catch (NoSuchMethodException ex) { DescriptorException descriptorException = DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(ex); throw descriptorException; } catch (SecurityException exception) { DescriptorException descriptorException = DescriptorException.securityWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(exception); throw descriptorException; } }
method = mapping.getDescriptor().getJavaClass().getDeclaredMethod(methodAccessor.getGetMethodName());
method = mapping.getDescriptor().getJavaClass().getDeclaredMethod(methodAccessor.getGetMethodName());
getMethodName = ((MethodAttributeAccessor)mapping.getAttributeAccessor()).getGetMethodName(); } else if(mapping.getAttributeAccessor() instanceof InstanceVariableAttributeAccessor) {
getMethodName = ((MethodAttributeAccessor)mapping.getAttributeAccessor()).getGetMethodName(); if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) { aMethod = AccessController.doPrivileged(new PrivilegedGetDeclaredMethod(
getMethod = ((MethodAttributeAccessor) mapping.getAttributeAccessor()).getGetMethodName(); setMethod = ((MethodAttributeAccessor) mapping.getAttributeAccessor()).getSetMethodName(); accessor.setValueType(mapping.getAttributeClassification());
getMethod = ((MethodAttributeAccessor) mapping.getAttributeAccessor()).getGetMethodName(); setMethod = ((MethodAttributeAccessor) mapping.getAttributeAccessor()).getSetMethodName(); accessor.setValueType(mapping.getAttributeClassification());