/** * INTERNAL: * Convert all the class-name-based settings in this mapping to actual class-based * settings. This method is used when converting a project that has been built * with class names to a project with classes. * @param classLoader */ public void convertClassNamesToClasses(ClassLoader classLoader){ Class referenceClass = null; if(getReferenceClassName()!= null){ try{ if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try { referenceClass = (Class)AccessController.doPrivileged(new PrivilegedClassForName(getReferenceClassName(), true, classLoader)); } catch (PrivilegedActionException exception) { throw ValidationException.classNotFoundWhileConvertingClassNames(getReferenceClassName(), exception.getException()); } } else { referenceClass = org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(getReferenceClassName(), true, classLoader); } } catch (ClassNotFoundException exc){ throw ValidationException.classNotFoundWhileConvertingClassNames(getReferenceClassName(), exc); } setReferenceClass(referenceClass); } containerPolicy.convertClassNamesToClasses(classLoader); };
public void useMapClassName(String concreteContainerClassName, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteContainerClassName); policy.setKeyName(methodName, getReferenceClass().getName()); this.setContainerPolicy(policy); }
public void useMapClassName(String concreteContainerClassName, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteContainerClassName); policy.setKeyName(methodName, getReferenceClass().getName()); this.setContainerPolicy(policy); }
public void useMapClassName(String concreteContainerClassName, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteContainerClassName); policy.setKeyName(methodName, getReferenceClass().getName()); this.setContainerPolicy(policy); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must be set before calling this method. */ public void useMapClass(Class concreteContainerClass, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteContainerClass); policy.setKeyName(methodName, getReferenceClass()); this.setContainerPolicy(policy); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must be set before calling this method. */ public void useMapClass(Class concreteContainerClass, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteContainerClass); policy.setKeyName(methodName, getReferenceClass()); this.setContainerPolicy(policy); }