/** * INTERNAL: * This method is used to turn the a raw database field value classFieldValue into a Class object. Used to determine * which class objects to build from database results, and for class type expression */ public Class classFromValue(Object classFieldValue, AbstractSession session) throws DescriptorException { Class concreteClass; if (!shouldUseClassNameAsIndicator()) { concreteClass = (Class)getClassIndicatorMapping().get(classFieldValue); if (concreteClass == null) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } else { try { String className = (String)classFieldValue; //PWK 2.5.1.7 can not use class for name, must go through conversion manager. //Should use the root ClassDescriptor's classloader to avoid loading from a loader other //than the one that loaded the project concreteClass = getDescriptor().getJavaClass().getClassLoader().loadClass(className); if (concreteClass == null) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } catch (ClassNotFoundException e) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } catch (ClassCastException e) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } return concreteClass; }
/** * INTERNAL: * This method is used to turn the a raw database field value classFieldValue into a Class object. Used to determine * which class objects to build from database results, and for class type expression */ public Class classFromValue(Object classFieldValue, AbstractSession session) throws DescriptorException { Class concreteClass; if (!shouldUseClassNameAsIndicator()) { concreteClass = (Class)getClassIndicatorMapping().get(classFieldValue); if (concreteClass == null) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } else { try { String className = (String)classFieldValue; //PWK 2.5.1.7 can not use class for name, must go through conversion manager. //Should use the root ClassDescriptor's classloader to avoid loading from a loader other //than the one that loaded the project concreteClass = getDescriptor().getJavaClass().getClassLoader().loadClass(className); if (concreteClass == null) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } catch (ClassNotFoundException e) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } catch (ClassCastException e) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } return concreteClass; }
/** * INTERNAL: * This method is used to turn the a raw database field value classFieldValue into a Class object. Used to determine * which class objects to build from database results, and for class type expression */ public Class classFromValue(Object classFieldValue, AbstractSession session) throws DescriptorException { Class concreteClass; if (!shouldUseClassNameAsIndicator()) { concreteClass = (Class)getClassIndicatorMapping().get(classFieldValue); if (concreteClass == null) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } else { try { String className = (String)classFieldValue; //PWK 2.5.1.7 can not use class for name, must go through conversion manager. //Should use the root ClassDescriptor's classloader to avoid loading from a loader other //than the one that loaded the project concreteClass = getDescriptor().getJavaClass().getClassLoader().loadClass(className); if (concreteClass == null) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } catch (ClassNotFoundException e) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } catch (ClassCastException e) { throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor()); } } return concreteClass; }
throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue, getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(indicator, getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(indicator, getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType, aDescriptor.getInheritancePolicy().getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType, xmlDescriptor.getInheritancePolicy().getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType, aDescriptor.getInheritancePolicy().getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType, xmlDescriptor.getInheritancePolicy().getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType, concreteDescriptor.getInheritancePolicy().getDescriptor());
throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType, xmlDescriptor.getInheritancePolicy().getDescriptor());