org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(12.1k)|赞(0)|评价(0)|浏览(207)

本文整理了Java中org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName()方法的一些代码示例,展示了Helper.getClassFromClasseName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.getClassFromClasseName()方法的具体详情如下:
包路径:org.eclipse.persistence.internal.helper.Helper
类名称:Helper
方法名:getClassFromClasseName

Helper.getClassFromClasseName介绍

暂无

代码示例

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. return org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(javaClass.getQualifiedName(), loader);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. return org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(javaClass.getQualifiedName(), loader);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * INTERNAL:
  3. * Convert all the class-name-based settings in this SortedCollectionContainerPolicy to actual class-based
  4. * settings. This method is used when converting a project that has been built
  5. * with class names to a project with classes.
  6. * @param classLoader
  7. */
  8. public void convertClassNamesToClasses(ClassLoader classLoader){
  9. super.convertClassNamesToClasses(classLoader);
  10. if(m_comparator==null){
  11. if(comparatorClass==null){
  12. if(comparatorClassName!=null){
  13. Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader);
  14. if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
  15. m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  16. }else{
  17. throw ValidationException.invalidComparatorClass(comparatorClassName);
  18. }
  19. }
  20. }else{
  21. if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
  22. m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  23. }else{
  24. throw ValidationException.invalidComparatorClass(comparatorClass.getName());
  25. }
  26. }
  27. }
  28. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * Convert all the class-name-based settings in this SortedCollectionContainerPolicy to actual class-based
  4. * settings. This method is used when converting a project that has been built
  5. * with class names to a project with classes.
  6. * @param classLoader
  7. */
  8. public void convertClassNamesToClasses(ClassLoader classLoader){
  9. super.convertClassNamesToClasses(classLoader);
  10. if(m_comparator==null){
  11. if(comparatorClass==null){
  12. if(comparatorClassName!=null){
  13. Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader);
  14. if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
  15. m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  16. }else{
  17. throw ValidationException.invalidComparatorClass(comparatorClassName);
  18. }
  19. }
  20. }else{
  21. if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
  22. m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  23. }else{
  24. throw ValidationException.invalidComparatorClass(comparatorClass.getName());
  25. }
  26. }
  27. }
  28. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. /**
  2. * INTERNAL:
  3. * Convert all the class-name-based settings in this SortedCollectionContainerPolicy to actual class-based
  4. * settings. This method is used when converting a project that has been built
  5. * with class names to a project with classes.
  6. * @param classLoader
  7. */
  8. public void convertClassNamesToClasses(ClassLoader classLoader){
  9. super.convertClassNamesToClasses(classLoader);
  10. if(m_comparator==null){
  11. if(comparatorClass==null){
  12. if(comparatorClassName!=null){
  13. Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader);
  14. if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
  15. m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  16. }else{
  17. throw ValidationException.invalidComparatorClass(comparatorClassName);
  18. }
  19. }
  20. }else{
  21. if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
  22. m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  23. }else{
  24. throw ValidationException.invalidComparatorClass(comparatorClass.getName());
  25. }
  26. }
  27. }
  28. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. /**
  2. * Override to avoid exceptions due to lack of get method.
  3. */
  4. public void initializeAttributes(Class theJavaClass) throws DescriptorException {
  5. if (getAttributeName() == null) {
  6. throw DescriptorException.attributeNameNotSpecified();
  7. }
  8. try {
  9. if (!isWriteOnly()) {
  10. Class[] parameterTypes = new Class[1];
  11. parameterTypes[0] = Helper.getClassFromClasseName(parameterTypeAsString, loader);
  12. attributeClassification = parameterTypes[0];
  13. setSetMethod(Helper.getDeclaredMethod(theJavaClass, setMethodName, parameterTypes));
  14. }
  15. } catch (NoSuchMethodException ex) {
  16. DescriptorException descriptorException = DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName());
  17. descriptorException.setInternalException(ex);
  18. throw descriptorException;
  19. }
  20. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * Override to avoid exceptions due to lack of get method.
  3. */
  4. public void initializeAttributes(Class theJavaClass) throws DescriptorException {
  5. if (getAttributeName() == null) {
  6. throw DescriptorException.attributeNameNotSpecified();
  7. }
  8. try {
  9. if (!isWriteOnly()) {
  10. Class[] parameterTypes = new Class[1];
  11. parameterTypes[0] = Helper.getClassFromClasseName(parameterTypeAsString, loader);
  12. attributeClassification = parameterTypes[0];
  13. setSetMethod(Helper.getDeclaredMethod(theJavaClass, setMethodName, parameterTypes));
  14. }
  15. } catch (NoSuchMethodException ex) {
  16. DescriptorException descriptorException = DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(), getGetMethodName(), theJavaClass.getName());
  17. descriptorException.setInternalException(ex);
  18. throw descriptorException;
  19. }
  20. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. try {
  2. parameterTypes[0] = Helper.getClassFromClasseName(actualTypeClassName, sourceMapping.getReferenceClass().getClassLoader());
  3. setMethod = Helper.getDeclaredMethod(sourceMapping.getDescriptor().getJavaClass(), setMethodName, parameterTypes);
  4. } catch (NoSuchMethodException nsme) {}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. try {
  2. parameterTypes[0] = Helper.getClassFromClasseName(actualTypeClassName, sourceMapping.getReferenceClass().getClassLoader());
  3. setMethod = Helper.getDeclaredMethod(sourceMapping.getDescriptor().getJavaClass(), setMethodName, parameterTypes);
  4. } catch (NoSuchMethodException nsme) {}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. JavaClass collectionType = property.getType();
  2. collectionType = containerClassImpl(collectionType);
  3. invMapping.useCollectionClass(org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(collectionType.getQualifiedName(), helper.getClassLoader()));

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. JavaClass collectionType = property.getType();
  2. collectionType = containerClassImpl(collectionType);
  3. invMapping.useCollectionClass(org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(collectionType.getQualifiedName(), helper.getClassLoader()));

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. mapping.setGetMethodName("getValue");
  2. Class attributeClassification = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(factoryMethodParamTypes[0], helper.getClassLoader());
  3. mapping.setAttributeClassification(attributeClassification);
  4. mapping.getNullPolicy().setNullRepresentedByEmptyNode(false);
  5. mapping.setSetMethodName("setValue");
  6. mapping.setXPath("text()");
  7. Class attributeClassification = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(factoryMethodParamTypes[0], helper.getClassLoader());
  8. mapping.setAttributeClassification(attributeClassification);
  9. xmlDescriptor.addMapping((CoreMapping)mapping);
  10. mapping.setSetMethodName("setValue");
  11. mapping.setXPath("text()");
  12. Class attributeClassification = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(factoryMethodParamTypes[0], helper.getClassLoader());
  13. mapping.setAttributeClassification(attributeClassification);
  14. xmlDescriptor.addMapping((CoreMapping)mapping);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. public AnyObjectMapping generateAnyObjectMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo) {
  2. AnyObjectMapping mapping = new XMLAnyObjectMapping();
  3. initializeXMLMapping((XMLMapping)mapping, property);
  4. // if the XPath is set (via xml-path) use it
  5. if (property.getXmlPath() != null) {
  6. mapping.setField(new XMLField(property.getXmlPath()));
  7. }
  8. Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader());
  9. JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType);
  10. mapping.setConverter(jaxbElementRootConverter);
  11. if (property.getDomHandlerClassName() != null) {
  12. jaxbElementRootConverter.setNestedConverter(new DomHandlerConverter(property.getDomHandlerClassName()));
  13. }
  14. if (property.isLax()) {
  15. mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
  16. } else {
  17. mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT);
  18. }
  19. if (property.isMixedContent()) {
  20. mapping.setMixedContent(true);
  21. } else {
  22. mapping.setUseXMLRoot(true);
  23. }
  24. return mapping;
  25. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. public AnyObjectMapping generateAnyObjectMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo) {
  2. AnyObjectMapping mapping = new XMLAnyObjectMapping();
  3. initializeXMLMapping((XMLMapping)mapping, property);
  4. // if the XPath is set (via xml-path) use it
  5. if (property.getXmlPath() != null) {
  6. mapping.setField(new XMLField(property.getXmlPath()));
  7. }
  8. Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader());
  9. JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType);
  10. mapping.setConverter(jaxbElementRootConverter);
  11. if (property.getDomHandlerClassName() != null) {
  12. jaxbElementRootConverter.setNestedConverter(new DomHandlerConverter(property.getDomHandlerClassName()));
  13. }
  14. if (property.isLax()) {
  15. mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
  16. } else {
  17. mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT);
  18. }
  19. if (property.isMixedContent()) {
  20. mapping.setMixedContent(true);
  21. } else {
  22. mapping.setUseXMLRoot(true);
  23. }
  24. return mapping;
  25. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. Class actualClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(actualJavaClass.getQualifiedName(), helper.getClassLoader());
  2. mapping.setAttributeClassification(actualClass);
  3. if(targetClass != null) {
  4. Class fieldClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(targetClass, helper.getClassLoader());
  5. mapping.getField().setType(fieldClass);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. Class actualClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(actualJavaClass.getQualifiedName(), helper.getClassLoader());
  2. mapping.setAttributeClassification(actualClass);
  3. if(targetClass != null) {
  4. Class fieldClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(targetClass, helper.getClassLoader());
  5. mapping.getField().setType(fieldClass);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. Class theClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getGenericType().getQualifiedName(), helper.getClassLoader());
  2. mapping.setAttributeElementClass(theClass);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. Class theClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getGenericType().getQualifiedName(), helper.getClassLoader());
  2. mapping.setAttributeElementClass(theClass);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  1. Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader());
  2. JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType);
  3. mapping.setConverter(jaxbElementRootConverter);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. Class declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getActualType().getQualifiedName(), helper.getClassLoader());
  2. JAXBElementRootConverter jaxbElementRootConverter = new JAXBElementRootConverter(declaredType);
  3. mapping.setConverter(jaxbElementRootConverter);

相关文章

Helper类方法