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

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

本文整理了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

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

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

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

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

/**
 * 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());
       }
     }
  }
}

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

/**
 * 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());
       }
     }
  }
}

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

/**
 * 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());
       }
     }
  }
}

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

/**
 * 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;
  }
}

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

/**
 * 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;
  }
}

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

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

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

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

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

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

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

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

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

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);

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

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;
}

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

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;
}

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

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);

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

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);

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

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

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

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

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

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

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

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

相关文章

Helper类方法