return org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(javaClass.getQualifiedName(), loader);
return org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(javaClass.getQualifiedName(), loader);
/** * INTERNAL: * Convert all the class-name-based settings in this SortedCollectionContainerPolicy 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){ super.convertClassNamesToClasses(classLoader); if(m_comparator==null){ if(comparatorClass==null){ if(comparatorClassName!=null){ Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader); if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){ m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass); }else{ throw ValidationException.invalidComparatorClass(comparatorClassName); } } }else{ if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){ m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass); }else{ throw ValidationException.invalidComparatorClass(comparatorClass.getName()); } } } }
/** * INTERNAL: * Convert all the class-name-based settings in this SortedCollectionContainerPolicy 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){ super.convertClassNamesToClasses(classLoader); if(m_comparator==null){ if(comparatorClass==null){ if(comparatorClassName!=null){ Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader); if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){ m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass); }else{ throw ValidationException.invalidComparatorClass(comparatorClassName); } } }else{ if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){ m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass); }else{ throw ValidationException.invalidComparatorClass(comparatorClass.getName()); } } } }
/** * INTERNAL: * Convert all the class-name-based settings in this SortedCollectionContainerPolicy 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){ super.convertClassNamesToClasses(classLoader); if(m_comparator==null){ if(comparatorClass==null){ if(comparatorClassName!=null){ Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader); if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){ m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass); }else{ throw ValidationException.invalidComparatorClass(comparatorClassName); } } }else{ if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){ m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass); }else{ throw ValidationException.invalidComparatorClass(comparatorClass.getName()); } } } }
/** * Override to avoid exceptions due to lack of get method. */ public void initializeAttributes(Class theJavaClass) throws DescriptorException { if (getAttributeName() == null) { throw DescriptorException.attributeNameNotSpecified(); } try { if (!isWriteOnly()) { Class[] parameterTypes = new Class[1]; parameterTypes[0] = Helper.getClassFromClasseName(parameterTypeAsString, loader); attributeClassification = parameterTypes[0]; setSetMethod(Helper.getDeclaredMethod(theJavaClass, setMethodName, parameterTypes)); } } catch (NoSuchMethodException ex) { DescriptorException descriptorException = DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(ex); throw descriptorException; } }
/** * Override to avoid exceptions due to lack of get method. */ public void initializeAttributes(Class theJavaClass) throws DescriptorException { if (getAttributeName() == null) { throw DescriptorException.attributeNameNotSpecified(); } try { if (!isWriteOnly()) { Class[] parameterTypes = new Class[1]; parameterTypes[0] = Helper.getClassFromClasseName(parameterTypeAsString, loader); attributeClassification = parameterTypes[0]; setSetMethod(Helper.getDeclaredMethod(theJavaClass, setMethodName, parameterTypes)); } } catch (NoSuchMethodException ex) { DescriptorException descriptorException = DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName()); descriptorException.setInternalException(ex); throw descriptorException; } }
try { parameterTypes[0] = Helper.getClassFromClasseName(actualTypeClassName, sourceMapping.getReferenceClass().getClassLoader()); setMethod = Helper.getDeclaredMethod(sourceMapping.getDescriptor().getJavaClass(), setMethodName, parameterTypes); } catch (NoSuchMethodException nsme) {}
try { parameterTypes[0] = Helper.getClassFromClasseName(actualTypeClassName, sourceMapping.getReferenceClass().getClassLoader()); setMethod = Helper.getDeclaredMethod(sourceMapping.getDescriptor().getJavaClass(), setMethodName, parameterTypes); } catch (NoSuchMethodException nsme) {}
JavaClass collectionType = property.getType(); collectionType = containerClassImpl(collectionType); invMapping.useCollectionClass(org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(collectionType.getQualifiedName(), helper.getClassLoader()));
JavaClass collectionType = property.getType(); collectionType = containerClassImpl(collectionType); invMapping.useCollectionClass(org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(collectionType.getQualifiedName(), helper.getClassLoader()));
mapping.setGetMethodName("getValue"); Class attributeClassification = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(factoryMethodParamTypes[0], helper.getClassLoader()); mapping.setAttributeClassification(attributeClassification); mapping.getNullPolicy().setNullRepresentedByEmptyNode(false); mapping.setSetMethodName("setValue"); mapping.setXPath("text()"); Class attributeClassification = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(factoryMethodParamTypes[0], helper.getClassLoader()); mapping.setAttributeClassification(attributeClassification); xmlDescriptor.addMapping((CoreMapping)mapping); mapping.setSetMethodName("setValue"); mapping.setXPath("text()"); Class attributeClassification = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(factoryMethodParamTypes[0], helper.getClassLoader()); mapping.setAttributeClassification(attributeClassification); xmlDescriptor.addMapping((CoreMapping)mapping);
public AnyObjectMapping generateAnyObjectMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo) { AnyObjectMapping mapping = new XMLAnyObjectMapping(); initializeXMLMapping((XMLMapping)mapping, property); // if the XPath is set (via xml-path) use it if (property.getXmlPath() != null) { mapping.setField(new XMLField(property.getXmlPath())); } Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader()); JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType); mapping.setConverter(jaxbElementRootConverter); if (property.getDomHandlerClassName() != null) { jaxbElementRootConverter.setNestedConverter(new DomHandlerConverter(property.getDomHandlerClassName())); } if (property.isLax()) { mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT); } else { mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT); } if (property.isMixedContent()) { mapping.setMixedContent(true); } else { mapping.setUseXMLRoot(true); } return mapping; }
public AnyObjectMapping generateAnyObjectMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo) { AnyObjectMapping mapping = new XMLAnyObjectMapping(); initializeXMLMapping((XMLMapping)mapping, property); // if the XPath is set (via xml-path) use it if (property.getXmlPath() != null) { mapping.setField(new XMLField(property.getXmlPath())); } Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader()); JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType); mapping.setConverter(jaxbElementRootConverter); if (property.getDomHandlerClassName() != null) { jaxbElementRootConverter.setNestedConverter(new DomHandlerConverter(property.getDomHandlerClassName())); } if (property.isLax()) { mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT); } else { mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT); } if (property.isMixedContent()) { mapping.setMixedContent(true); } else { mapping.setUseXMLRoot(true); } return mapping; }
Class actualClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(actualJavaClass.getQualifiedName(), helper.getClassLoader()); mapping.setAttributeClassification(actualClass); if(targetClass != null) { Class fieldClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(targetClass, helper.getClassLoader()); mapping.getField().setType(fieldClass);
Class actualClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(actualJavaClass.getQualifiedName(), helper.getClassLoader()); mapping.setAttributeClassification(actualClass); if(targetClass != null) { Class fieldClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(targetClass, helper.getClassLoader()); mapping.getField().setType(fieldClass);
Class theClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getGenericType().getQualifiedName(), helper.getClassLoader()); mapping.setAttributeElementClass(theClass);
Class theClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getGenericType().getQualifiedName(), helper.getClassLoader()); mapping.setAttributeElementClass(theClass);
Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader()); JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType); mapping.setConverter(jaxbElementRootConverter);
Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader()); JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType); mapping.setConverter(jaxbElementRootConverter);