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

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

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

Helper.getInstanceFromClass介绍

[英]Return the class instance from the class
[中]从类返回类实例

代码示例

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

/**
 * INTERNAL:
 * Sets a comparator class for this policy to use when instantiating
 * a new SortedSet object.
 */
public void setComparatorClass(Class comparatorClass) {
  if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
    m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  }else{
    throw ValidationException.invalidComparatorClass(comparatorClass.getName());
  }
  this.comparatorClass=comparatorClass;
}

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

/**
 * INTERNAL:
 * Sets a comparator class for this policy to use when instantiating
 * a new SortedSet object.
 */
public void setComparatorClass(Class comparatorClass) {
  if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
    m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  }else{
    throw ValidationException.invalidComparatorClass(comparatorClass.getName());
  }
  this.comparatorClass=comparatorClass;
}

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

/**
 * INTERNAL:
 * Sets a comparator class for this policy to use when instantiating
 * a new SortedSet object.
 */
public void setComparatorClass(Class comparatorClass) {
  if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
    m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  }else{
    throw ValidationException.invalidComparatorClass(comparatorClass.getName());
  }
  this.comparatorClass=comparatorClass;
}

代码示例来源: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: com.haulmont.thirdparty/eclipselink

if(m_comparator==null && comparatorClass!=null){
  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

if(m_comparator==null && comparatorClass!=null){
  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.core

if(m_comparator==null && comparatorClass!=null){
  if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
    m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
  }else{
    throw ValidationException.invalidComparatorClass(comparatorClass.getName());

相关文章

Helper类方法