/** * INTERNAL: * Setup the default classExtractionMethod, or if one was specified by the user make sure it is valid. */ public void initialize(ClassDescriptor descriptor, Session session) throws DescriptorException { setDescriptor(descriptor); Class[] declarationParameters = new Class[1]; declarationParameters[0] = ClassConstants.DatabaseRow_Class; try { setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters)); } catch (NoSuchMethodException ignore) { declarationParameters[0] = ClassConstants.Record_Class; try { setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters)); } catch (NoSuchMethodException exception) { throw DescriptorException.noSuchMethodWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } } catch (SecurityException exception) { throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } // CR#2818667 Ensure the method is static. if (!Modifier.isStatic(getClassExtractionMethod().getModifiers())) { throw DescriptorException.classExtractionMethodMustBeStatic(getClassExtractionMethodName(), descriptor); } }
/** * INTERNAL: * Setup the default classExtractionMethod, or if one was specified by the user make sure it is valid. */ public void initialize(ClassDescriptor descriptor, Session session) throws DescriptorException { setDescriptor(descriptor); Class[] declarationParameters = new Class[1]; declarationParameters[0] = ClassConstants.DatabaseRow_Class; try { setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters)); } catch (NoSuchMethodException ignore) { declarationParameters[0] = ClassConstants.Record_Class; try { setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters)); } catch (NoSuchMethodException exception) { throw DescriptorException.noSuchMethodWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } catch (SecurityException exception) { throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } } catch (SecurityException exception) { throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } // CR#2818667 Ensure the method is static. if (!Modifier.isStatic(getClassExtractionMethod().getModifiers())) { throw DescriptorException.classExtractionMethodMustBeStatic(getClassExtractionMethodName(), descriptor); } }
/** * INTERNAL: * Setup the default classExtractionMethod, or if one was specified by the user make sure it is valid. */ public void initialize(ClassDescriptor descriptor, Session session) throws DescriptorException { setDescriptor(descriptor); Class[] declarationParameters = new Class[1]; declarationParameters[0] = ClassConstants.DatabaseRow_Class; try { setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters)); } catch (NoSuchMethodException ignore) { declarationParameters[0] = ClassConstants.Record_Class; try { setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters)); } catch (NoSuchMethodException exception) { throw DescriptorException.noSuchMethodWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } catch (SecurityException exception) { throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } } catch (SecurityException exception) { throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception); } // CR#2818667 Ensure the method is static. if (!Modifier.isStatic(getClassExtractionMethod().getModifiers())) { throw DescriptorException.classExtractionMethodMustBeStatic(getClassExtractionMethodName(), descriptor); } }